0

A bug?Through the Action for Texbox assignment can not get in the server-to-value

asked 2009-11-24 02:32:20 +0800

gaoj2008 gravatar image gaoj2008
70 1

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>

delete flag offensive retag edit

1 Reply

Sort by » oldest newest

answered 2009-11-26 22:26:31 +0800

tmillsclare gravatar image tmillsclare
799 2 5 30

updated 2009-11-26 22:26:51 +0800

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.

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: 2009-11-24 02:32:20 +0800

Seen: 283 times

Last updated: Nov 26 '09

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