0

Textbox focus

asked 2006-03-17 14:53:31 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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.

delete flag offensive retag edit

10 Replies

Sort by ยป oldest newest

answered 2006-03-17 15:13:42 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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.

link publish delete flag offensive edit

answered 2006-03-20 16:06:17 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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>

link publish delete flag offensive edit

answered 2006-03-20 16:08:43 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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()"/>


link publish delete flag offensive edit

answered 2006-03-20 16:16:14 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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


link publish delete flag offensive edit

answered 2006-03-20 16:21:05 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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.


link publish delete flag offensive edit

answered 2006-03-20 16:25:29 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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>

link publish delete flag offensive edit

answered 2006-03-20 16:25:50 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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>

link publish delete flag offensive edit

answered 2006-03-20 16:28:04 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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.

link publish delete flag offensive edit

answered 2006-03-20 16:34:52 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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.

link publish delete flag offensive edit

answered 2006-03-20 16:44:51 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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>


link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2006-03-17 14:53:31 +0800

Seen: 1,711 times

Last updated: Mar 20 '06

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More