[Gambas-user] Behaviour of built-in buttons of DataBrowser

Doug Hutcheson owlbrudder at gmail.com
Sat Jan 20 08:08:10 CET 2018



On Sat, 2018-01-20 at 16:44 +1000, Doug Hutcheson wrote:
> On Sun, 2018-01-14 at 12:46 +1000, Doug Hutcheson wrote:
> > Hi everyone.
> > 
> > I'm on Fedora 27 using the latest gambas3 from the git
> > repository -
> > full system details at the end of this email
> > 
> > As I plan to
> > use Gambas for data-oriented applications, it is important
> > to me to
> > understand how all the data-aware controls work.
> > 
> > At present I am having
> > issues with the DataBrowser as follows:
> > 
> > 1. Form freezes when ‘Enter’ is
> > pressed in last row of data.
> > Explanation: During an edit or view session
> > on a MySql table, or a
> > PostgreSQL table, if I navigate to the right-most 
> > column of the last
> > row of data and press Enter, the form freezes and has
> > to be dismissed
> > using the Stop button in the IDE. This does not happen
> > on any other row
> > of data. If the data in the last row were changed, the
> > change is
> > correctly transmitted to the database even though the form has
> > frozen.
> > 
> > 2. 'Editable’ DataBrowser reports numerous null objects when
> > opening a
> > larger PostgreSQL table.
> > Explanation: When opening a PostgreSQL
> > table containing many rows
> > (tested with 180 rows) in an ‘Editable’
> > DataBrowser, the control
> > displays “DataView.TableView_Data.420: Null
> > Object” for all visible
> > rows. Navigating toward the beginning of the
> > table causes normal
> > information to be displayed eventually. At this
> > point, navigating to
> > the end of the table again sees all data displayed
> > normally. This
> > behaviour is not seen when opening a PostgreSQL table
> > with few records
> > (eg tested with a table containing only 12 rows). See
> > attachment.
> > 
> > 3. Attempt to delete from non-editable DataBrowser using a
> > PostgreSQL
> > table throws errors and locks form.
> > Setup: Create a
> > DataBrowser on a PostgreSQL table containing mixed-case 
> > column names.
> > With the DataBrowser property ‘Editable’ set to False, if
> > the ‘Delete’
> > button of the control is clicked, error messages relating
> > to the mixed-
> > case columns are displayed. The form becomes unresponsive
> > and must be
> > dismissed by the ‘Stop’ button in the IDE. This does not
> > happen when
> > using a MySql table with mixed-case  column names; in this
> > case the
> > chosen row is deleted as expected. See attachment.
> > 
> > 4. “New” button seems
> > inoperative.
> > This one I m sure is due to my lack of understanding, but I
> > can't work
> > it out.
> > Explanation:
> >  - If the DataBrowser control ‘Editable’
> > property is ‘False’, clicking
> > the “New” button does not open a new row
> > to edit.
> > 
> >  - If the DataBrowser control ‘Editable’ property is ‘True’, a
> > new row
> > is always available to edit and clicking the “New” button does
> > not
> > change this.
> > 
> > I expected the behaviour would be to toggle between
> > presenting a new
> > row and not presenting a new row.
> > 
> > 
> > I have attached
> > everything I believe is needed to reproduce the
> > problems, except for the
> > larger PostgreSQL table which contains live
> > personal data. The project
> > tar is on my Google Drive at https://drive.google.com/open?id=1qwmu
> > kGeA
> > VEQK73BsmFmx7L9tIRkU11FJ as it was too big to get by the mailecop.
> > 
> > I am
> > not sure at which point I should be raising bug reports, but the
> > informa
> > tion on http://gambaswiki.org/wiki/doc/report says "If you
> > cannot solve
> > your problem, first try to ask on the mailing list. Maybe
> > someone could
> > help you, who knows ?", so here I am.
> > 
> > As always, any help would be
> > appreciated.
> > 
> > Kind regards,
> > Doug
> > 
> > ------------------------------------------
> > -----------------------------
> > [System]
> > Gambas=3.10.90 ce6d6e7e9 (master)
> > O
> > peratingSystem=Linux
> > Kernel=4.14.13-300.fc27.x86_64
> > Architecture=x86_64
> > Di
> > stribution=redhat Fedora release 27 (Twenty Seven)
> > Desktop=GNOME
> > Theme=Gt
> > k
> > Language=en_AU.UTF-8
> > Memory=15860M
> > 
> > [Libraries]
> > Cairo=libcairo.so.2.11510.
> > 0
> > DBus=libdbus-1.so.3.19.3
> > GStreamer=libgstreamer-1.0.so.0.1204.0
> > GTK+2=li
> > bgtk-x11-2.0.so.0.2400.31
> > OpenGL=libGL.so.1.0.0
> > SQLite=libsqlite3.so.0.8.
> > 6
> > 
> > [Environment]
> > BASH_FUNC_module%%=() {  eval `/usr/bin/modulecmd bash
> > $*`
> > }
> > BASH_FUNC_scl%%=() {  if [ "$1" = "load" -o "$1" = "unload" ]; then
> > 
> >  eval "module $@";
> >  else
> >  /usr/bin/scl "$@";
> >  fi
> > }
> > COLORTERM=truecolor
> > CVS_RS
> > H=ssh
> > DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> > DESKTOP_SESSI
> > ON=gnome-xorg
> > DISPLAY=:0
> > GB_GUI=gb.qt4
> > GDMSESSION=gnome-xorg
> > GDM_LANG=en_AU
> > .UTF-8
> > GJS_DEBUG_OUTPUT=stderr
> > GJS_DEBUG_TOPICS=JS ERROR;JS LOG
> > GNOME_DESK
> > TOP_SESSION_ID=this-is-deprecated
> > HISTCONTROL=ignoredups
> > HISTSIZE=1000
> > HOM
> > E=<home>
> > HOSTNAME=<hostname>
> > IMSETTINGS_INTEGRATE_DESKTOP=yes
> > IMSETTINGS_M
> > ODULE=none
> > JOURNAL_STREAM=9:44770
> > KDEDIRS=/usr
> > LANG=en_AU.UTF-8
> > LESSOPEN=||
> > /usr/bin/lesspipe.sh %s
> > LOADEDMODULES=python-sphinx/python3-sphinx
> > LOGNAM
> > E=<user>
> > LS_COLORS=rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;
> > 5;13:do=
> > 38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;
> > 9:mi=01;
> > 05;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;
> > 5;226:tw
> > =48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;
> > 40:*.tar
> > =38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.l
> > ha=38;5;
> > 9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38
> > ;5;9:*.t
> > zo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=
> > 38;5;9:*
> > .gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.
> > zst=38;5
> > ;9:*.tzst=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=3
> > 8;5;9:*.
> > tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*
> > .ear=38;
> > 5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=3
> > 8;5;9:*.
> > cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.wim=38;5;9:*
> > .swm=38;
> > 5;9:*.dwm=38;5;9:*.esd=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.mj
> > pg=38;5;
> > 13:*.mjpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.
> > pgm=38;5
> > ;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.t
> > if=38;5;
> > 13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.
> > mng=38;5
> > ;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.
> > m2v=38;5
> > ;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.
> > m4v=38;5
> > ;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.w
> > mv=38;5;
> > 13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.av
> > i=38;5;1
> > 3:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=3
> > 8;5;13:*
> > .xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.ogv=38
> > ;5;13:*.
> > ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=38;
> > 5;45:*.m
> > id=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;
> > 5;45:*.o
> > gg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.oga=38;5;45:*.opus=38;5
> > ;45:*.sp
> > x=38;5;45:*.xspf=38;5;45:
> > MAIL=/var/spool/mail/<user>
> > MODULEPATH=
> > /etc/scl/modulefiles:/etc/scl/modulefiles:/usr/share/Modules
> > /modulefile
> > s:/etc/modulefiles:/usr/share/modulefiles
> > MODULESHOME=/usr/share/Modules
> > 
> > OLDPWD=<home>/Downloads/MySql
> > PATH=/usr/libexec/python3-
> > sphinx:/usr/lib64/qt-
> > 3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/loca
> > l/sbin:/usr/bin:/usr/
> > sbin:<home>/.local/bin:<home>/bin
> > PWD=<home>/Downlo
> > ads/Gambas/gambasdevel
> > QTDIR=/usr/lib64/qt-3.3
> > QTINC=/usr/lib64/qt-
> > 3.3/include
> > QTLIB=/usr/lib64/qt-3.3/lib
> > QT_IM_MODULE=xim
> > SESSION_MANAGER=l
> > ocal/unix:@/tmp/.ICE-unix/7782,unix/unix:/tmp/.ICE-
> > unix/7782
> > SHELL=/bin/
> > bash
> > SHLVL=2
> > SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
> > SSH_AUTH_S
> > OCK=/run/user/1000/keyring/ssh
> > S_COLORS=auto
> > TERM=xterm-256color
> > TZ=:/etc/
> > localtime
> > USER=<user>
> > USERNAME=<user>
> > VTE_VERSION=5002
> > WINDOWID=79691782
> > WIN
> > DOWPATH=2
> > XAUTHORITY=/run/user/1000/gdm/Xauthority
> > XDG_CURRENT_DESKTOP=GN
> > OME
> > XDG_DATA_DIRS=<home>/.local/share/flatpak/exports/share/:/var/lib/f
> > l
> > atp
> > ak/exports/share/:/usr/local/share/:/usr/share/
> > XDG_MENU_PREFIX=gnome
> > -
> > XDG_RUNTIME_DIR=/run/user/1000
> > XDG_SEAT=seat0
> > XDG_SESSION_DESKTOP=gnome-
> > xorg
> > XDG_SESSION_ID=2
> > XDG_SESSION_TYPE=x11
> > XDG_VTNR=2
> > XMODIFIERS=@im=none
> > _=
> > /usr/bin/gambas3
> > _LMFILES_=/usr/share/modulefiles/python-sphinx/python3-
> > sphinx
> 
> I have solved problem #2 above - the null objects - by populating the
> DataSource via an SQL query instead of directly opening the table.
> This solution is fine, but I am still curious ...
> 
> This also solves problem #1 - form freezing when enter is pressed on
> the rightmost field of the last row.
> 
> The problem as described as actually more subtle in that the data
> presented top the control was actually corrupted, with the same
> hundred or so rows repeated until the row count of the table was
> reached. Very curious, but no longer important.
> 
> Problem #3 above still exists
> 
> Problem #4 above has changed: if I click on the 'Add' button, Gambas
> throws an 'Out of bounds' error..
> 
> Still digging ...
> 
> Kind regards,
> Doug

I forgot to add that it would be very useful to have access to the
button events in the DataBrowser, so I could write my own code for Add,
Edit, Delete and Refresh. I can't see these events exposed anywhere.
Cheers,
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180120/7ce33168/attachment.html>


More information about the User mailing list