cancel
Showing results for 
Search instead for 
Did you mean: 

Urgeny : Not able to add subnode Drop Down to table

Former Member
0 Kudos

Dear WebDynPro Gurus

I am facing a issue of populating subnode currency to Table

The requirement is for NewExpenseView to create table with columns as

1. Amount

2. Currency (Drop Down)

3. Date

Steps followed

1. Created UI Table with I/P fields for Amount, Date and Selection Drop Down for Currency.

2.Created advanceTable in context with Value attribute for Amount , Date and Value node for Currency.

Code used to add the row in the table.

IPrivateNewExpenseView.IAdvanceTableElement advRowElement;

advRowElement = wdContext.nodeAdvanceTable().createAdvanceTableElement();

wdContext.nodeAdvanceTable().addElement(advRowElement);

IPrivateNewExpenseView.IAdvanceCurrElement elAdvCurr;

wdContext.nodeCurr().moveFirst();

int currSize = wdContext.nodeCurr().size();

for(int i = 1; i <= currSize; i++)

{

elAdvCurr = wdContext.nodeAdvanceCurr().createAdvanceCurrElement();

elAdvCurr.setCurrId(wdContext.currentCurrElement().getId());

elAdvCurr.setCurrValue(wdContext.currentCurrElement().getId());

<b>//advRowElement..addElement(elAdvCurr); //Node is not getting when typed '.'

//advRowElement</b>.

wdContext.nodeCurr().moveNext();

}

Issue:

I am not able to add Currency Node values to advRowElement.

Accepted Solutions (1)

Accepted Solutions (1)

monalisa_biswal
Contributor
0 Kudos

Hi Maruti,

If you are using DropDownByIndex UI element.

1.First of all u have to set singleton property of subnode to false.

2.You cant add elements to element reference.You can straightway add your element to your subnode.

If you are using DropDownByKey UI element.

1.U can create a value attribute for holding the valueset.

2.There is a dictionary type available in Web Dynpro under local dictionary->com.sap.dictionary.predefined.currency.U can bind this value attribute to this dictionary type or you can manually fill in valueset.

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear All,

Thanks for your replies. I am able to solve this by setting Singleton as false.

Regards,

Maruti Prasad

Former Member
0 Kudos

Hi,

Try this way

1. Create a node and bind two att Amount and Date.

2. Create another node inside this and bind an att Currency. Set the singleton property to false.

Do the following code ,

IPrivateMessageAppView.IParentElement parentelement = null;

IPrivateMessageAppView.IChileElement child = null;

for(int i=0;i<5;i++)

{

parentelement = wdContext.createParentElement();

parentelement.setParent_ele(<value>);

wdContext.nodeParent().addElement(parentelement);

for(int j=0;j<5;j++)

{

child = wdContext.nodeParent().nodeChile().createChileElement();

child.setChild_ele(<drop down value>);

wdContext.nodeParent().nodeChile(i).addElement(child);

}

}

Note: The code i have given is just a sample. Follow the same steps for ur case.

Hope it help,

- Nagarajan.