0

test

asked 2009-01-17 04:44:35 +0800

robertlee gravatar image robertlee
561

test

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2009-01-17 04:44:47 +0800

robertlee gravatar image robertlee
561

tester

link publish delete flag offensive edit

answered 2009-01-20 02:12:29 +0800

robertlee gravatar image robertlee
561

test

link publish delete flag offensive edit

answered 2009-02-24 09:43:55 +0800

dennis gravatar image dennis
3679 1 6
http://www.javaworld.com....

Ok, I try to simulate your code and have some result.

you should not set a component's label if it bind with a value( in your case label="@{proc.sendTime, save-when='self.onCheck', load-when='buttonUpdate.onClick'}").
in you case, you call checkUpdate to update the label, and then databinding load the value of proc.sendTime and set the label back.
you should change the value of proc, not component's value.

I rewrite some code to accomplish your case. (since you didn't provide what is CommonData , so I created fake one)

code: null
<zscript> void checkUpdate(Checkbox chbx,test.CommonData.Data data){ java.util.Date now = new Date(); String timestamp = java.text.DateFormat.getDateTimeInstance().format(now); data.setSendTime(timestamp); } ></zscript> ... ... <rows> <row self="@{each='proc'}" value="@{proc,save-when=none,load-when=none}"> <label style="padding-left:15px;color:green" value="@{proc.name}" /> <label value="@{proc.owner}" /> <checkbox checked="@{proc.sent, save-when='self.onCheck', load-when='buttonUpdate.onClick'}" label="@{proc.sendTime, save-when='self.onCheck', load-when='buttonUpdate.onClick'}" onCheck="checkUpdate(self,self.parent.value)" /> <checkbox checked="@{proc.loaded, save-when='self.onCheck', load-when='buttonUpdate.onClick'}" /> </row> </rows>
</p><p>check the line , it binds the proc to row whitout any save/load<div style="class=code" class="code"><pre><div class="error">code: null</div>
<row self="@{each='proc'}" value="@{proc,save-when=none,load-when=none}">

and , get the 'proc' back with self.parent.value
onCheck="checkUpdate(self,self.parent.value)" />

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-01-17 04:44:35 +0800

Seen: 51 times

Last updated: Feb 24 '09

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