on 02-15-2007 2:32 PM
Hi all,
I am using a webservice in webdynpro , i have imported the WSDL (local FS)
then did all the bindings from model to controller and then from controller to View
in the view I have a input field , the value is mapped to context - > requestwsdl ->eno .when I run the application the field is disabled
Properties of Input field
Enabled true
readonly false
Rgds
KLK
Hi KLK,
you need to create an instance of your request object and bind it to the model node in the init() of componentcontroller.
Ex :
ModelName model=new ModelName();
Request_XXX modelclass=new Request_XXX (model);
modelclass.setEno();
wdContext.nodeRequest_XXX().bind(modelclass);
Regards,ANilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
first of all big thanks to each and every one of u ,
Anil and Jansi I think u understod my problem correctly
Let me explain my scenario once again so that it is clear to every body here
I have a WSDL file on my PC , I have imported that into my NWDS
As web service model and binding that to controller (service template)
From controller to view.
So all the context elements are created automatically by the wizard
Now requirement is to pass two parameters from the view to the model
So I have bound the Request_EmpXXX(model node)empdetail(Model node)
--- Eno (Model attribute) to the input field
when I deploy the application the input field is disabled
The WSDL does nt have a Response parameter and the WSDL is generated by XI
After importing inside the Root Request model node I can see another model node
Called complex structure which has my input parameters ENO and tablename
If I am not clear pls let me know
Regards
KLK
Since you have binded input field to a model node attribute you have to bind one instance of model class to the model node.As you metioned "Eno" is the model attribute which is directly coming under parent model node Request_EmpXXX binding instance of model class for Request_EmpXXX to the model node will suffice.
<Model Class of Request_EmpXXX> <ref> = new <Model Class of Request_EmpXXX>();
wdContext.node<Request_EmpXXX>.bind(<ref>);
Hallo K.L.K,
I think Anilkumar's source code should solve your problem:
ModelName model=new ModelName();
Empdetail detail=new empdetail(model);
detail.setEno(100);
Request_XXX reqClass=new Request_XXX (model);
reqClass.setE,pDetails(detail);
wdContext.nodeRequest_XXX ().bind(reqClass)
Anilkumar demonstrated how to correctly implment context-to-model binding on a model object graph level.
Do you use the new Adaptive Web Service Model or the former one? For the new Adaptive Web Service Model you must explicitly pass a model instance to the model object constructors.
Regards, Bertram
Bertram and Anil,
Pardon for my ignorance, but I cannt get this class ModelName in my View.
Even when I say organize imports nothing is getting added and when I checked the
An available class with Model, the popup window shows ModelClass but no ModelName .
Aruna,
I tried all that ..
Fahad,
I am trying to push values to Model node ??
Regards
KLK
Hi Anil,
Sorry for the delay in reply
Now my problem is solved doing some thing like this as u said :
// Request_DBEmpDetailsMI_DBEmpDetailsMI model = new Request_DBEmpDetailsMI_DBEmpDetailsMI();
// For Complex XSD element
SenderDetails[] SenderDet = new SenderDetails[1];
SenderDet[0] = new SenderDetails();
SenderDet[0].setENO("xi");
SenderDet[0].setTablename("xitb");
model.set_DBEmpDetailsMT(SenderDet);
wdContext.nodeRequest_DBEmpDetailsMI_DBEmpDetailsMI().bind(model);
one last question :
in ur code uasked me to create a class of the model
ModelName model = new ModelName();
My code : Request_DBEmpDetailsMI_DBEmpDetailsMI model = new Request_DBEmpDetailsMI_DBEmpDetailsMI();
again u asked me to create another object of the same class
"Request" Request_XXX reqClass=new Request_XXX (model);
Did i get u wrong ?
Regards
KLK
Hi KLK,
Still I don't think your code is 100% rite !!!
I have a feeling that your model name is not correct , i mean "Request_DBEmpDetailsMI_DBEmpDetailsMI" is the request node.The modelname should be something different.
Select the modelNode in your context and goto the properties.
You can find a property called modelclass. There the name before "." is the modelclass name.
Please post the value of the above property so that i can give you the code.
Regards, ANilkumar
hi klk,
<b>1.try to intialise the webservice in wdoinit() method ie</b>
public void wdDoInit()
{
//@@begin wdDoInit()
Request_WSAddViDocument_add obj = new Request_WSAddViDocument_add ();
wdContext.nodeRequest_WSAddViDocument_add().bind(obj);
//@@end
}
2<b>. <b>And call the execute() of model object from the utility method.</b> i.e here my utility method is getUser().</b>
public void getUser( )
{
//@@begin getUser()
try {
wdContext.currentRequest_WSAddViDocument_addElement().modelObject().execute();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
wdContext.nodeResponse().invalidate();
regards,
Aruna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi KLK,
Create a new context variable in the context and bind it to the Inputfield. After the model is executed, get the value from model attribute and assign to this context variable
Regards
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi KLK,
When u bind a value attribute under a value node which has a cardinality of 0-n or 0-1 to the input field then you must first create a node element and bind it to the node in the <b>init()</b> of Component Controller..
Try out the below code:
iprivate<<ViewName>>.I<<Node>> Element nodeEl = wdcontext.create<<Node>>Element;
wdContext.node<ValueNode>.addElement(nodeEl);
If you have bounded your input field to model attribute which is under model node then you can create an instance and bind it to the model node as suggested by Anil.
/** Hook method called to initialize controller. */
public void wdDoInit()
{
//@@begin wdDoInit()
// Create a new element in the Bapi_Flight_Getlist_Input node
Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();
wdContext.nodeBapi_Flight_Getlist_Input().bind(input);
// Create new elements in the Destination_From and Destination_To nodes
input.setDestination_From(new Bapisfldst());
input.setDestination_To(new Bapisfldst());
//@@end
}
For more information refer to this tutorial:
<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/76b45d9688e04abe1a1070410ddc1e/frameset.htm">Creating a Web Dynpro Application Accessing ABAP Functions</a>
Regards,
Jhansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
The remaining fields are enaled or only this is only.
If all fields are disbled try to binding once again.
Or other wise bound the value attribute once again with the input field.
Or might be if the field is under the node if that cardinality is 0..n then also might be the problem some times only the value will coming one value.
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check if value property of the input field is linked to view context.
Vito
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.