cancel
Showing results for 
Search instead for 
Did you mean: 

Table Fields , readonly problem

Former Member
0 Kudos

Hello SAPians,

I have created a table in a view from Context elements using template. But, at runtime these table fields are being readonly. I have read some other similar posts. But they told to change the cardinality of UI context. But, I could not able to change the UI context cardinality. I have tried to change the root node custum controller context cardinality to 0..n but of no use. Could you please tell me some solution.

Thanking you.

Best Regards,

Ajay

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ajaykumar,

You have created table with template. You must have chosen value attributes available under one value node.

Lets say, value node is Node1.

first of all, you need to initialize your value node Node1 with following code.

wdcontext.nodeNode1().addElement(wdcontext.nodeNode1().createNode1());

You need to execute this line as many time as you required enabled rows in your table.

Another point:

when you create table using template, it will create table columns with textView UI element. It means, it is read only.

If you want Input field for all columns then at the time of creating table with template, specify UI element against each table column.

Hope it will work for you.

Regards,

Bhavik

Former Member
0 Kudos

Hello Bhavik,

I tried to change to Textview to Input field but of no use. The cells of the table are still readonly.

@ Ashwani & Bhavik: Initializing is really tediuos work. As my table fields are more. And you told me that I have to do the times I want my rows to be enabled. Which I think is not a suitable solution as we dont know, how many records we will create, right?

Thanking you.

Regards,

Ajay.

Former Member
0 Kudos

Hi,

You do not need to initialize each and every table fields. You have to execute that line each time you require new record in the table.

This you can do by providing one button on top of the table for "Insert".

On action of this button, you can write this line to add new blankline in table.

Regards,

Bhavik

Answers (3)

Answers (3)

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi Ajay

First you declare the use of custom controller(incase you created) or component controller.This can be done by looking into the properties of the view.Then Go to the Node created in the View Context -


>(Rightclick)Select Appropriate mapping option,map the attr and save the changes.

regards

kalyan

former_member186016
Active Contributor
0 Kudos

Hi,

You have to initiailize the context elements, then they will appear editable if bound to editable UI elements.

Setting cardinaility also does the same thing.

Regards,

Ashwani Kr Sharma

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi

Dont attempt to change the Root Node Context.Create a Node and bind this to table node and change the cardinality of this if you need as per your requirements.Better not attempt to bind the columns directly to the independent attributes.Create node and attr in that node.Bind the dataSource property of the table to the Node you created.The attributes in that Node you bind to the table cell editor of the table columns.

regards

kalyan

Former Member
0 Kudos

Hello kalyan,

I tried to create a Node under my view context and then I tried to do context mapping. but, I could not bind controller context elements to the node that I created. It says incompatible context element type.

Scenario: For example, I have BAPI_salesoder_CreateFromData2 and I made context mapping to my custom Controller. And now, I want to bind these context elements to my view. But, when I created my own node and tried to make context mapping, Iam having problem. And I cannot create each attribute under my own node. I have to use graphical tool to bring this attributes. Any further help..

Thanking you.

Regards,

Ajay