on 07-20-2006 7:49 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.