cancel
Showing results for 
Search instead for 
Did you mean: 

InputField - Disabled

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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)

Regards,Anilkumar

monalisa_biswal
Contributor
0 Kudos

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>);

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi KLK,

Here ModelName should be replaced with your actual WebserviceModelName.

I mean then name that you see when you expand the Models in your WebDynpro project.

Regards,Anilkumar

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Answers (6)

Answers (6)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

hi K.L.K,

Check out this thread which discusses the same.

Regards,

Gopi

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Check if value property of the input field is linked to view context.

Vito