0

Variable binded to the "visible" property is never updated when using grid auto menupopup

asked 2009-05-25 14:59:52 +0800

bob007 gravatar image bob007
384 3 4

updated 2009-05-25 15:01:03 +0800

Hi,

It seem when we check/uncheck to set column visibility in the grid auto menupopup the variable binded to the "visible" property is never updated.

boolean colNameVisible = true;
...
<columns menupopup="auto">
<column visible="@{colNameVisible}"/>
...

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2009-05-26 07:27:59 +0800

robertpic71 gravatar image robertpic71
1275 1

I think there are no default-actions for databinding and visible. Try some load-when/save-when-actions.

/Robert

link publish delete flag offensive edit

answered 2009-05-26 14:07:05 +0800

bob007 gravatar image bob007
384 3 4

I mean the databinding with a boolean variable and the visible property is working when I use my own checkboxs to change the value (true/false) of the binded variable.

But if I use the checkbox in the auto menupopup ( menupopup="auto") of the grid to set wich column is visible or not visible there is no update on the binded variable value. So I can't use it elsewhere. I need it to save the user preferences and display only the selected column at each visit. And at the next visit load the preferences and set the columns visibility.

Since the grid auto menupopup don't update the variable binded to the visible property I used my own checkboxs instead. Its working now.

Regards,

link publish delete flag offensive edit

answered 2009-05-26 20:57:27 +0800

robertpic71 gravatar image robertpic71
1275 1

updated 2009-05-26 20:58:16 +0800

>> when I use my own checkboxs to change the value (true/false) of the binded variable

From the lang-addon.xml (inside the zkplus.jar)

<component>
  <component-name>checkbox</component-name> 
  <extends>checkbox</extends> 
- <annotation>
  <annotation-name>default-bind</annotation-name> 
  <property-name>checked</property-name> 
- <attribute>
  <attribute-name>access</attribute-name> 
  <attribute-value>both</attribute-value> 
  </attribute>
- <attribute>
  <attribute-name>save-when</attribute-name> 
  <attribute-value>self.onCheck</attribute-value> 
  </attribute>
  </annotation>
  </component>

There is a defaultbinding for checkboxes and a default save-when. For visible there is no default-binding. For this case (grid automenu) i could not find any event that is good for save-when...

Sometimes a manual binder.saveAll() or binder.saveComponent(...) before you need the data - could help.

/Robert

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-05-25 14:59:52 +0800

Seen: 283 times

Last updated: May 26 '09

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