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

Bruce Steers bsteers4 at gmail.com
Mon Nov 14 20:10:35 CET 2022

On Mon, 14 Nov 2022 at 18:30, Bruce Steers <bsteers4 at gmail.com> wrote:

> On Mon, 14 Nov 2022 at 15:54, Marco Ancillotti <gambas at servinfo.it> wrote:
>> Il 14/11/22 16:49, Bruce Steers ha scritto:
>> > ...
>> I also found a workaround, if I insert a message.info when changing the
>> tab everything works magically, in my opinion, however, the bug remains.
> If it is a bug? , it could be a limitation.
> As much as gb.web.gui tries to mimic gb.gui it's not the same and
> restricted in some ways.
> I do not know why but moving setting the combo from the Open() event and
> into a timer started in Open() seems to fix everything.
> I tried all manner of different ways to get it all to work in the Open()
> event but all failed in various ways, mostly the tab view would not update
> as you say when changing.
> The difference with my workaround is the WebTimer happens client-side
> after the code is sent not server-side. I don't understand the exact reason
> it makes it work but it does. (plus i think more reasonable than calling
> Message())
> I have had a few previous issues with gambas that the problem turned out
> to be "You should not do that inside an event handler". The answer was to
> use a timer as I have here instead thus freeing the event handler.  That
> was why i thought of it as a solution to this problem and it worked :)
> I noticed things like using WebForm_Event() in the main form triggers
> okay. in the form opened by the main form it does not.
> There seems to be a few differences with a main window and a sub window in
> web.gui.
> Perhaps there is a big difference that causes limitations?
> Or it's just a bug? ;)
> Benoit of course is the best qualified to know the difference here i
> think, I'm just good at workarounds :)

Pretty sure it's a bug in WebTabPanel
after all i said there i changed the other form to be the Startup class and
when that was the main form It still hangs.

changing cbox.Index did not hang but tab.Index did.

I think it is because the tabs have not initialized properly before you set
the text box items.

The following code also fixes it by setting index to all tabs before you
set the text box strings...

Public Sub WebForm_Open()

' Run through the tabs to initialize them
For c As Integer = tab.Count - 1 DownTo 0
   tab.Index = c

' nothing fails now :)

   cbox.Index = 2

  T1.Text = "CIAO1"
  T2.Text = "CIAO2"
  T3.Text = "CIAO3"


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221114/4b601cea/attachment-0001.htm>

More information about the User mailing list