on 07-29-2008 12:09 PM
Hi experts,
I am creating a few buttons dynamically (button1, button2 etc.).
I also have a context attribute (visBtn) with the type "Visibility".
Is it possible to bind the visibility attribute of each button to a element of the context attribute?
So button1 is bound to visBtn[1], button2 to visBtn[2] etc.
Thanks in advance
Felix
Your question suggests (at least to me) that you want to bind the "visible" property of the given buttons to an attribute of a context node such that the first button is bound to the first context node element, the second to the second etc.
If that is your goal, it is not possible.
However you can bind the "visible" property of each button to a different context attribute which could be defined at the context root level or inside a common 1:1-cardinality value node.
The code to do that has already been described correctly.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
that was exactly what I wanted to do.
But in this case I think I will try it they way, you are recommending.
Thanks and best regards
Felix
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this code
IWDAttributeInfo visattr = wdContext.getNodeInfo().getAttribute("visBtn");
if(firstTime){
IWDButton button = (IWDButton) view.createElement(IWDButton.class, "button1");
button.setText("Click");
button.bindVisible( visBtn);
}
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Also check this pdf for more info
PradeeP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Following is the code to do it
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("visBtn");
IWDButton button =(IWDButton)view.createElement(IWDButton.class);
button.bindVisible(attributeInfo);
//Align this according to your context. I assume visBtn is under Root of the context
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.