[Gambas-user] Two bugs on gb.web.gui

Bruce Steers bsteers4 at gmail.com
Mon Nov 14 16:49:26 CET 2022


On Mon, 14 Nov 2022 at 10:44, Marco Ancillotti <gambas at servinfo.it> wrote:

> HI all ,
>
> I think I found two bug on gb.web.gui .
>
> FIRST:
> I've create a simple web page with a webtabpanel and a webcombobox linked
> by code:
>
> *Public Sub cbox_Click()*
> *  tab.index = cbox.Index*
> *End*
>
> So when combobox change tabpanel change as well.
> Now on webform_open I have a
>
>
> *tab.index = 2 cbox.index = 2*
>

By setting the cbox.index without locking it first it will trigger the
cbox_Click event so tabs.index gets set twice.
Having the cbox_Click() event means you should only have to set cbox.Index
and tab.index will update itself so try removing tabs.Index = 2.
(I do not think this is the reason for the hang though)

> And everythink work as expected...
> BUT if I put before the index change a simple webtextbox.text =
> "somethink" ti completely hangs.
>
Yes for some reason the tab cannot set itself in WebForm_Open
I fixed it by creating a WebTimer and in WebForm_Open() i start the timer,
then set tab.Index in the timer event.
This frees the main event loop i believe thus preventing the hang.

SECOND:

if I call the same webform from another as form.showmodal() the tabbox
don't refresh the tab selected if I change it
on form opening.

I attach an example of bugs.
>
WebTabPanel not setting in a modal window does seem like a bug but modal
windows are different.
Attached is a working version using a webtimer.
I also made it set the cbox.Index if tab changes and use tab.Refresh in the
cbox_Click event to ensure tab shows correctly.

It all seems to function/refresh correctly with the minor change to using a
timer

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221114/279aaba1/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sviluppowebform-0.0.2.tar.gz
Type: application/gzip
Size: 13211 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221114/279aaba1/attachment-0001.gz>


More information about the User mailing list