cancel
Showing results for 
Search instead for 
Did you mean: 

Using UI Element Input Field

Former Member
0 Kudos

Hi,

I have created two views.In the first view I have created a input field and attached that to Model attribute inside model node.

Created a model and then binded the model with the context of controller.Then binded the controller context with my view context.

When I see the output I am getting the input field as disabled.

Should I do any thing more.

Regards,

Suraj.

Accepted Solutions (1)

Accepted Solutions (1)

former_member85655
Active Participant
0 Kudos

This could be because of 2 things

1. You have not created an instance of the modelclass and bound it to the context at runtime.

2. The model attribute maybe readonly.

But I think (1) is mostly the case here.

Regards,

Arun

Answers (4)

Answers (4)

former_member193726
Active Participant
0 Kudos

Hi Suraj,

What Mukesh said is right.

As per the senario, you have a view controller's context structure as:

-BAPI_NODE

- OUTPUT_NODE

- INPUT_ATTRIBUTE

and you are trying to bind the input field directly to the INPUT_ATTRIBUTE. This makes your input field greyed out/read only.

All you have to do is, create another attribute called "USER" for example under the comp. controller's root node. Map it to your view controller. Bind this to your Input field.

In your component controller's implementation code where you execute your BAPI you will have code like this:

(1) BAPI_NODE input = new BAPI_NODE();

(2) wdContext.nodeBAPI_NODE().bind(input);

(3) try {

(4) input.execute();

(5) } catch (Exception e) {

(6) e.printStackTrace();

(7) }

Please add the following code in between (2) and (3).

input.setINPUT_ATTRIBUTE(wdContext.currentContextElement().getUSER);

Change the cardinality of the BAPI_NODE back to 0:n.

Try to execute your code. It should work fine now.

Regards,

Rekha Malavathu

Former Member
0 Kudos

Hi Suraj,

1. Bind the input with other context attribute

2. assign the model input values from the context attribute.

wdContext.current<BapiNodeInput>Element.set<Param>(wdContext.current<node>Element.get<Param>());

and check the cardinality of <node> is 1..1 or 0..1

Kind Regards

Mukesh

former_member182372
Active Contributor
0 Kudos

Hi Suraj,

You have to instantiate model class and bind it to context node first. Your model node doesn`t contain any elements. That`s the reason why input fields are disabled.

Best regards, Maksim Rashchynski.

pravesh_verma
Active Contributor
0 Kudos

Hi,

Change the node cardinality of the Model node you have mapped the input feild to; equal to 1:n.

It would have been 0:n, I guess.

OR

In the wdDoInit() function crete and element of that model node.

wdContext.node<Model_Node>.createAndAddElement();

I hope this will solve your problem

Regards

Pravesh

PS: Please consider rewarding points if helpful or solved.