on 01-24-2008 10:32 AM
Hello Friends,
I have created a table dynamically, one column of the table contains the button ( also placed dynamically ) now I have to enable or disable this button ( via seting a context model attribute ).
butt.bindEnabled(string path )...
Can anyone please let me know how I can determine the path of my context model attribute ?
( because when I do right click properties of my context model attribute, that path entry is empty )..
Regards,
Each row in your table corresponds with a nodeElement in your node.
The nodeelement therefore must contain a boolean value. This boolean can be bount to the button in your tablerow.
However, you mention that you make use of model nodes. Maybe the model does not have such a boolean field.
I Usually create an extra custom cpntroller in my app, in which I import the model. In this custom controller, I map the Model nodes to Value nodes. After doing this, I can easily add the required boolean attribute. You can map the value node through the Component Controller to the view.
Alternatively, you can modify the RFC (or webservice) so that additionally the required boolean attribute is added to the model, and reimport the model.
Good luck,
Roelof
Edited by: R. Knibbe on Jan 24, 2008 11:45 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let's say the attribute is named "buttonEnabled" and lives inside node named "Rows".
Then do something like
IWDButton button = (IWDButton) view.getElement("button_id");
IWDAttributeInfo attribute = wdContext.nodeRows().getNodeInfo().getAttribute("buttonEnabled");
button.bindEnabled(attribute);
Armin
Well you can see from the other posts how to bind the context attribute to the button.
I guess the problem is that there is no available boolean attribute. In that case you still have to decide if you are going to do:
1 map model node to value node and create the attribute
2 modify the RFC and reimport.
Am I right?
Regards, Roelof
Hi,
You can use the method setEnabled() for enabling and disabling the button.
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shah,
Give like this:
butt.bindEnabled("nodename.attributename");
bindEnabled is for Input field.
As Mr.Manoj told for buttons you need to change your code
butt.setEnabled("nodename.attributename");
nodename - is table node
attributename - is boolean value attribute which is used to enable/disable the button
regards,
Siva
Edited by: Siva Rama Krushna on Jan 24, 2008 4:21 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.