-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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.valueonCheck="checkUpdate(self,self.parent.value)" />