-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3635112
By: nobody
I am trying to set the focus on a textbox control and not having any luck.
Ideally I would want the textbox to have focus when it is created.
<textbox id="_quickSearchText" value="" onCreate="self.focus()"/>
This does not work for me.
any suggestions.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3635146
By: tomyeh
I cannot reproduce your issue. Would you post more complete codes? Try to use the demo to find a minimal ZUML codes that could illustrate the issue.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3639907
By: jim_bo_lisa
Here is the code I am using:
<window id="_quickSearchWin" title="" border="normal" closable="false" width="100%"
style="background-color:#b0c4de;">
<vbox>
<groupbox id="_quickSearchBox" mold="3d" width="99%" open="true"
onOpen="toggle(self, expandButtonQuickSearch, collapseButtonQuickSearch)">
<caption label="Quick" onClick="_quickSearchBox.open=true">
<image src="/images/arrow-down.png" id="expandButtonQuickSearch"
onClick="_quickSearchBox.open=true;expandButtonQuickSearch.setVisible(false);col
lapseButtonQuickSearch.setVisible(true)" />
<image src="/images/arrow-up.png" id="collapseButtonQuickSearch"
visible="false"
onClick="_quickSearchBox.open=false;expandButtonQuickSearch.setVisible(true);col
lapseButtonQuickSearch.setVisible(false)" />
</caption>
Search for:
<textbox id="_quickSearchText" value="" />
<button id="_quickSearchButton" label="Search"
use="condenserii.webtier.zkextensions.SearchButton" />
</groupbox>
</vbox>
</window>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3639914
By: jim_bo_lisa
Note the line:
<textbox id="_quickSearchText" value="" />
Now reads:
<textbox id="_quickSearchText" value="" onCreate="self.focus()"/>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3639928
By: jim_bo_lisa
I grabbed some of the demo code and was able to get the demo forking and having the textbox focus set. The only difference in the code is that my window component above is a child to a tabbedPanel. I also have another bug with the grid height and the grid is a child to a tabpanel.
Could the Tabpanel being causing the problem?
Jim
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3639952
By: tomyeh
Jim,
It will be much helpful if you could make the codes directly runnable at the demo. For example, you sould remove the use attribute.
Then, I could post it to demo and see what went wrong.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3639965
By: tomyeh
It works under demo:
<window id="_quickSearchWin" title="" border="normal" closable="false" width="100%"
style="background-color:#b0c4de;">
<vbox>
<groupbox id="_quickSearchBox" mold="3d" width="99%" open="true"
onOpen="toggle(self, expandButtonQuickSearch, collapseButtonQuickSearch)"> <caption label="Quick" onClick="_quickSearchBox.open=true">
<image src="/images/arrow-down.png" id="expandButtonQuickSearch"
onClick="_quickSearchBox.open=true;expandButtonQuickSearch.setVisible(false);col
lapseButtonQuickSearch.setVisible(true)" /> <image src="/images/arrow-up.png" id="collapseButtonQuickSearch" visible="false"
onClick="_quickSearchBox.open=false;expandButtonQuickSearch.setVisible(true);col
lapseButtonQuickSearch.setVisible(false)" /> </caption>
Search for:
<textbox id="_quickSearchText" value="" onCreate="self.focus()"/> <button id="_quickSearchButton" label="Search" /> </groupbox> </vbox> </window>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3639967
By: jim_bo_lisa
Here is the cleaned up code. Is this what you want?
<window id="_quickSearchWin" title="" border="normal" closable="false" width="100%"
style="background-color:#b0c4de;">
<vbox>
<groupbox id="_quickSearchBox" mold="3d" width="99%" open="true"
onOpen="toggle(self, expandButtonQuickSearch, collapseButtonQuickSearch)"> <caption label="Quick" onClick="_quickSearchBox.open=true">
<image src="/images/arrow-down.png" id="expandButtonQuickSearch"
onClick="_quickSearchBox.open=true;expandButtonQuickSearch.setVisible(false);col
lapseButtonQuickSearch.setVisible(true)" /> <image src="/images/arrow-up.png" id="collapseButtonQuickSearch" visible="false"
onClick="_quickSearchBox.open=false;expandButtonQuickSearch.setVisible(true);col
lapseButtonQuickSearch.setVisible(false)" /> </caption>
Search for:
<textbox id="_quickSearchText" value="" onCreate="self.focus()"/>
</groupbox>
</vbox>
</window>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3639979
By: tomyeh
Probably. Could you try to add tabbox back to the sample codes? Make sure it can run directly on demo. As soon as we reproduce the problem, the fix is quck.
Thanks.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3639993
By: tomyeh
It works under demo. Looks like you have to add back tabbox and other stuffs and see when it stops working.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3640018
By: jim_bo_lisa
Ok, I had 2 tabs. The textbox was on the 2nd tab that did not initiall have focus. I was thinking that when I clicked on the 2nd tab, focus would immediately go to the textbox from the onCreate call. I need to programmtically set the focus in the Tab callback. I am learning more every minute..
Here is the test code:
<tabbox width="100%">
<tabs>
<tab label="My Desktop1" />
<tab label="My Desktop2" />
</tabs>
<tabpanels>
<tabpanel>
</tabpanel>
<tabpanel>
<vbox>
<groupbox id="_searchView" mold="3d" width="100%" open="true" onOpen="toggle(self, expandButtonSearch,collapseButtonSearch)">
<caption label="Quick Query">
<image src="/images/arrow-down.png" id="expandButtonSearch"
onClick="_searchView.open=true;expandButtonSearch.setVisible(false);collapseButt
onSearch.setVisible(true)" />
<image src="/images/arrow-up.png" id="collapseButtonSearch" visible="false"
onClick="_searchView.open=false;expandButtonSearch.setVisible(true);collapseButt
onSearch.setVisible(false)" />
</caption>
<zscript>
(Window) Executions.createComponents("/quickSearchWin.zul", self, null); </zscript> </groupbox> </vbox>
</tabpanel>
</tabpanels>
</tabbox>
Asked: 2006-03-17 14:53:31 +0800
Seen: 1,723 times
Last updated: Mar 20 '06