cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with drop down in a table.

Former Member
0 Kudos

Dear friends,

I am using a dropdownbyindex in one of the column in

a table.

What is happening is that--

say for first row I choose some value from the dropdown.

when i choose any other row than what happens is...

All the rows shows the same value of drop down as

selected in Ist row.

Regards,

Arun

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Let X be the data source node of the table. Add a subnode Y, cardinality 0:N, singleton=false, with an attribute A of type "string".

Bind the DropDownByIndex.texts property to A. Done.

Armin

Former Member
0 Kudos

Hi Armin,

I did as u said.

But got exception while populating the node(used for drop down).

<b>Exception</b>

java.lang.NullPointerException

com.sap.app.wdp.IPrivateBulkUpdationOfOrders$IContextNode<b>.createInvoiceElement</b>(IPrivateBulkUpdationOfOrders.java:483)

at com.sap.app.BulkUpdationOfOrders.wdDoModifyView(BulkUpdationOfOrders.java:163)

at com.sap.app.wdp.InternalBulkUpdationOfOrders.wdDoModifyView(InternalBulkUpdationOfOrders.java:1202)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java(Compiled Code))

at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java(Compiled Code))

... 26 more

regards

Arun

Former Member
0 Kudos

Hi Arun,

Please post you context node structure.

Did you created and added the element in the main node, before creating and adding the element in the sub node? If no then do it first.

If still there is problem, please post your code for wdDoModifyView.

Regards,

Shubham

Former Member
0 Kudos

Why do you create context elements inside wdDoModifyView()?

Armin

Former Member
0 Kudos

Hi shubham,

<b>CODE OF wdDoModifyView</b>

public static void wdDoModifyView(IPrivateBulkUpdationOfOrders wdThis, IPrivateBulkUpdationOfOrders.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

{

//@@begin wdDoModifyView

String[] letters = new String[] { "SAFEXP", "BLAZE", "FIRST FLIGHT", "FLASH" };

List nodeElements = new ArrayList();

for (int i = 0; i < letters.length; ++i) {

IPrivateBulkUpdationOfOrders.ICourElement courier = wdContext.nodeCour().createCourElement();

courier.setName(letters<i>);

nodeElements.add(courier);

}

wdContext.nodeCour().bind(nodeElements);

wdContext.nodeCour().setLeadSelection(0);

}

<b>THE CONTEXT STRUCTURE</b>

<b>model node output</b>(top node)

model node listorders(binded to datasource of table)

value node cour(having attribute name)

other model attributes of listorders

**node cour has property Singelton = false

cardinality = 0..n

regards

Arun

Former Member
0 Kudos

Hi Arun,

First things first.

As rightly pointed by Armin, wdDoModifyView should be used to dynamically modify the View. So you should move your coding to some other method.

Now coming to your problem.

Your code should look something like this

String[] letters = new String[] { "SAFEXP", "BLAZE", "FIRST FLIGHT", "FLASH" };

List nodeElements = new ArrayList();

IPrivateBulkUpdationOfOrders.ICourElement courier;

IPrivateBulkUpdationOfOrders.IListOrdersElement element;

for(int index=0; index<wdContext.nodeListOrders().size(); index++){

element = wdContext.nodeListOrders().getListOrdersElementAt(index);

for (int i = 0; i < letters.length; i++) {

courier = wdContext.nodeCour().createCourElement();

element.nodeCour().addElement(courier);

courier.setName(letters<i>);

}

}

}

Make sure you have created node elements in your Model Node.

Regards,

Shubham

P.S. I am not sure if you are able to see in the line courier.setName(letters<i>), the "[" i "]" after letters.

Message was edited by: Shubham Tripathi

Message was edited by: Shubham Tripathi

Former Member
0 Kudos

Hi Shubham,

I have written the code in wdinit() but still

I am getting error at this line.

<b>courier = wdContext.nodeCour().createCourElement();</b>

regards,

Arun.

Former Member
0 Kudos

Hi Arun,

I am not sure now what can be the problem.

Please try courier = wdContext.createCourElement();

If still problem please attach the complete stack trace.

Regards,

Shubham

Former Member
0 Kudos

Please post the stacktrace.

Armin