cancel
Showing results for 
Search instead for 
Did you mean: 

problem Creating a webdynpro component with Inputfield

lakshmi_narayana2
Active Participant
0 Kudos

Am trying to create a wbedynrpo component which consists of 2/3 Inputfields.

But when i deploy and run the webdynpro application i always see the input fields in read only mode.

I can't enter any data.

The following are the properties i set for the input field.

enabled = true

value = Data.Name

where Data is the context.

visible = visible.

Pl let me know if i need to set any other properties.

Thanks in advance

Accepted Solutions (0)

Answers (4)

Answers (4)

lakshmi_narayana2
Active Participant
0 Kudos

readonly is set to false.

Is it not possible to create a simple form with input fields without binding.

lakshmi_narayana2
Active Participant
0 Kudos

Am not able to modify the cardinality.

Former Member
0 Kudos

hi narmun,

For input field "value" parameter is mandatory. You will have to bind it to a context attribute. This context attribute need not be in a node.

When you want to get the value entered in the node you can do it by

wdContext.currentcontextelement.get()

if it is a simple attribute

see this link

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/a-c/creating your first web dynpro application.pdf

Hope this helps you

Regards

Rohit

Message was edited by: Rohit Radhakrishnan

lakshmi_narayana2
Active Participant
0 Kudos

I created a context attribute and binded is programaticcaly but still my inputfilds are greyed out(readonly0 and am not able to modify the cardinality of the node as mentioned earlier.

lakshmi_narayana2
Active Participant
0 Kudos

Got my problem solved!!!

Former Member
0 Kudos

Have you done any context mapping with component controller or custom controller. If so change the cardinality of the node in the controller's context.

If u havenot done any mapping then u can change the cardinality in the view controller's context itself.

Otherwise try the below code in the wdDoInit() method

IPrivate<view name>View.I<node name>Element e=wdContext.node<node name>().create<node name>Element();

wdContext.node<node name>().addElement(e);

Hope this helps.

Regards,

saravana.

Former Member
0 Kudos

Hello All

I'm facing the same problem and I've made all your recomendations and nothing happens. I've place the code on the doInit Method, change the cardinalities (but that gives me an error when I run the app) and my app still has the fields read only.

What can I do?

Thanks in advance

Former Member
0 Kudos

Maria,

an InputField is rendered read-only if it has no storage location assigned for its "value" property. You must bind the "value" property to a context attribute and there must be a context element providing the storage location.

So you should check the property binding and then follow the complete context mapping chain from the view controller down to the component controller and the model.

Armin

Former Member
0 Kudos

hi

Check the cardinality property of ur node. If it is in 0..n change that property to 1..n .

Regards,

saravana.

Former Member
0 Kudos

Hi,

If you bind an input field to an attribute in a node of cardinality 0..n you will have to instantiate the node in doinit.

IPrivate<view name>.I<node name> node = wdContext.node<node name>

Otherwise input field will be read only.Otherwise make the cardinality 1..n or 1..1

Regards

Rohit

chintan_virani
Active Contributor
0 Kudos

Narmun,

U need to just set the readOnly property for the InputField to false to resolve your issue.

- Chintan.

Former Member
0 Kudos

Hi Narmun,

Check whether ur read only property is set to true or false.Just make it false for giving some inputs in it.

Regards,

Nagarajan.