cancel
Showing results for 
Search instead for 
Did you mean: 

Binding model attributes disables UI elements

Former Member
0 Kudos

Hi ,

I have created a model. and did bind its attributes to the UI elements. RFC is working fine.

But in the runtime all UI elements are disabled bydefault when i bind these to the model attributes but to the same UI element if i bind it to the local attribute its working fine...

I have tried reimpor and recreating model , and also changing the cardinality but not working...

Would not it be possible to bind UI elements to model attributes ? By using model attributes how the UI elements can be enabled ?

Please help me out...

Regards

Sireesha.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

If you bind UI Elements to model attributes, you will need to initialize them to see the fields enabled i.e. you will need to create an instance of the model object in wdDoInit() method of the view controller.

Kind Regards,

Nitin

Former Member
0 Kudos

HI Sireesha,

Please cross check these steps.

1.Right click on comp and choose Open data modeler

2.Check the data link between model and compcontroller.

3.Right click on datalink and say edit,drag and drop your elements(from model to controller).

4.Go to compcontroller and check whether model attributes are avilable or not?

5.In the view context create the attributes->right click and select edit context binding(from comp).

5.In view->Layout tab->set the text/value property for your UI elelments.

6.Finally bind the modelobject and then execute.

wdContext.nodemodel().bind(new Model());

wdContext.currentModelElement().modelObject().execute();

Regards,

Lavanya.G

Former Member
0 Kudos

hi,

this occurs becoz u would have bound the i/p element to a model attibute whose value is null.

to solve dis,

1)create a context attribute in ur view

2)bind the i/p elements to that context attr

3)while executing the rfc , get the value of this context attr and set it to the model attr.

for example if u have a model attr 'name_mo ' which u have to bind to the i/p field element

create a context attr -


name_vn

bind name_vn to the i/p field element

while executind ur rfc,

Test_Input ip = new Test_Input();

ip.setName_mo(wdContext.currentContextElement().getName_vn());

Test_Input is the name of the model node that is bound from model to the view via comp.ctller

Regards

Jayapriya

Former Member
0 Kudos

Hi Jayapriya,

I think its not bcoz of the model attributes is null...

Once you key-in some value in the Ui element then model attribute holds the value. No where we r binding it to the null value as per my analysis...

Finally it got worked after creating the model. I am getting this UI elements disabled when i reimport the model.

I have tried creating the new model all UI elements are enabled after this...

Its working now...

Regards

Sireesha.

Former Member
0 Kudos

Hi,

Did you execute the model from webdynpro?

Regards

Ayyapparaj