Skip to Content
avatar image
Former Member

Binding model attributes disables UI elements

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Feb 04, 2009 at 02:46 PM

    Hi,

    Did you execute the model from webdynpro?

    Regards

    Ayyapparaj

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 04, 2009 at 03:17 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • avatar image
    Former Member
    Feb 05, 2009 at 05:40 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 05, 2009 at 05:47 AM

    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

    Add comment
    10|10000 characters needed characters exceeded