-
FEATURED COMPONENTS
First time here? Check out the FAQ!
In the course of using the zk,I encountered a problem.I think this is a bug.Questions are as follows:
When you use the Action for the assignment Textbox,If the Textbox has focus,You can from the server and client to obtain the value of this Textbox;But if this is not the focus of Textbox,You can only get the value from the client.
Example:
The following is a zk code,I attribute Action of button SetValue to set a value for the Text,And the Text textbox has not been focus.You can click on each button to see the results of 'get value from client' and 'get value from server'.
<window title="My First Window" border="normal" width="200px">
<textbox id="text"/>
<button id="setValue" label="setValue" action='onclick:#{text}.value="aa"'/>
<button label="get value from client" action='onclick:alert(#{text}.value)'/>
<button label="get value from server" onClick="alert(text.value)"/>
</window>
Alternatively the code is as follows:
<window title="My First Window" border="normal" width="200px">
<textbox id="text1"/>
<button label="setValue" action='onclick:#{text1}.focus();#{text1}.value="aa"'/>
<button label="get value from client" action='onclick:alert(#{text1}.value)'/>
<button label="get value from server" onClick="alert(text1.value)"/>
</window>
Hey gaoj2008
If you want to use client side actions I highly recommend you use ZK 5. You can take a look at this link for more information.
Please let me know if this suits your needs.
Asked: 2009-11-24 02:32:20 +0800
Seen: 283 times
Last updated: Nov 26 '09