cancel
Showing results for 
Search instead for 
Did you mean: 

BindEnabled + path to context attribute

Former Member
0 Kudos

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,

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Roelof,

The nodeelement therefore must contain a boolean value. This boolean can be bount to the button in your tablerow.

This is exactly i need/want to do,..... but dont know how to bound this context attribute with the button.....

Regards,

Former Member
0 Kudos

Hi,

There is a property called enabled for the button which you will get in the properties view.

Here you can add attribute of type boolean.

thanks & regards,

Manoj

Former Member
0 Kudos

Hi Manoj,

I am not creating the button at design time, i am creating the button dynamically .... and need to set the context model attribute to this enable property of the button... ( as I have a node which contains this model context attribute i.e. boolen value )

Regards,

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hello Armin,

I tried this varinat also earlier, but did not work, but I just tried this again, and guess what, it works now

Thanks all for your post and Armin for your resposne.

Regards,

Former Member
0 Kudos

Hi,

You can use the method setEnabled() for enabling and disabling the button.

thanks & regards,

Manoj

former_member197348
Active Contributor
0 Kudos

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