<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:large"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 14 Nov 2022 at 10:44, Marco Ancillotti <<a href="mailto:gambas@servinfo.it">gambas@servinfo.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>HI all , <br>
</p>
<p>I think I found two bug on gb.web.gui .<br>
</p>
<p>FIRST:<br>
I've create a simple web page with a webtabpanel and a webcombobox
linked by code:</p>
<p><i><span class="gmail_default" style="font-size:large"></span>Public Sub cbox_Click()</i><i><br>
</i><i>Â tab.index = cbox.Index</i><i><br>
</i><i>End</i></p>
<p>So when combobox change tabpanel change as well.<br>
Now on webform_open I have a <i><br>
</i></p>
<p><i>tab.index = 2<br>
cbox.index = 2</i></p></div></blockquote><div><br></div><div><div style="font-size:large" class="gmail_default">By setting the cbox.index without locking it first it will trigger the cbox_Click event so tabs.index gets set twice.<br></div><div style="font-size:large" class="gmail_default">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.<br></div></div><div style="font-size:large" class="gmail_default">(I do not think this is the reason for the hang though)</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<p>And everythink work as expected... <br>
BUT if I put before the index change a simple webtextbox.text =
"somethink" ti completely hangs.</p></div></blockquote><div><div><span class="gmail_default" style="font-size:large">Yes for some reason the tab cannot set itself in WebForm_Open <br></span></div><div><span class="gmail_default" style="font-size:large">I fixed it by creating a WebTimer and in WebForm_Open() i start the timer, then set tab.Index in the timer event.<br></span></div><div><span class="gmail_default" style="font-size:large">This frees the main event loop i believe thus preventing the hang.<br></span></div><div><span class="gmail_default" style="font-size:large"><br></span></div><div><p>SECOND:</p>
<p>if I call the same webform from another as form.showmodal() the
tabbox don't refresh the tab selected if I change it<br>
on form opening.<br></p></div></div><div style="font-size:large" class="gmail_default"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><p>
</p>
<p>I attach an example of bugs. <br>
</p></div></blockquote><div><span class="gmail_default" style="font-size:large">WebTabPanel not setting in a modal window </span><span class="gmail_default" style="font-size:large">does seem like a bug but modal windows are different.</span></div><div><span class="gmail_default" style="font-size:large">Attached is a working version using a webtimer.<br></span></div><div><span class="gmail_default" style="font-size:large">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.<br></span></div><div><span class="gmail_default" style="font-size:large"><br></span></div><div><span class="gmail_default" style="font-size:large">It all seems to function/refresh correctly with the minor change to using a timer<br></span></div><div><span class="gmail_default" style="font-size:large"><br></span></div><div><span class="gmail_default" style="font-size:large">Respects</span></div><div><span class="gmail_default" style="font-size:large">BruceS<br></span></div></div></div>