cancel
Showing results for 
Search instead for 
Did you mean: 

caling dropdown box in the table

Former Member
0 Kudos

Hi

I created a web dynpro application.In that I created Table elements

Expense--Debit Account-Creditaccount-CreditAccount--sub Account

under this table

For Expense

Air_Fare---

Bus _Fare

.

.

.

Under Debit account

Each dropdownbox has to be displayed in the debit account.In that one option should be selected.

similar to the Credit account also------

Please provide the code for me to do this..

thanks in advance

Regards

Sushma

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

thanks

Former Member
0 Kudos

Hi Sushma,

For getting dropdowns as columns of a table:

1) Create a node structure as:

ParentNode

ExpenseAttribute

DebitAccountNode

CreditAccountNode

SubAccountAttribute

2) Right click on RootUiElementContainer>Select Apply Template>Select Table Click Next>Select ParentNode Click Next>In the editor property of the Columns DebitAccount, CreditAccount Chose the Editor DropDownByIndex and Click Finish.

3) Use the code I have given in my earlier posts to populate the drop downs.

Regards.

Rajat

Former Member
0 Kudos

Hi,

Alternatively you can create a simple type enumeration of String in the dictionary.

Add the key value pairs in this enumeration.

Create the context attribute which is of this simple type.

In the table cell editor use the Use the UI element drop down by key element

Bind the selected key property of this UI element with this context attribute.

At run time the value which you selected from the drop down box will be present in that context attribute

or you can copy the same in other context attribute of type String

Regards

Ardhendu

Sharathmg
Active Contributor
0 Kudos

Hello,

From what I understand from the Question, the table has columns(Debit, Credit, Expense etc.) and one of the column needs to be a dropdown.

Assuming that, you can proceed with declaring the element and during binding of the table and dropdown by key. For ex: While creating the binding option, declare the Debit Account variable as DropdownByKey

If the values of the context attribute is fixed and small in number, a dictionary type shall be created and bound to the context attribute.

IPrivate<ViewName>View.I<ContextNode>Element conEle =  wdcontext.node<ContextNode>.create<ContextNode>Element();

conEle.set.. all the values for the first element.

wdcontext.node<ContextNode>.addElement(conEle);

Follow the above steps to add all the elements to the table.

For dropdown, create a simpleType of debit account. Add the values to appear in dropdown to the enumeration of the simple type. Later change the context attribute debitacc type to the simpleType.

The dropdown values appear automatically.

Regards,

Sharath

Former Member
0 Kudos

Hi Sushma,

1) First of all to set the elements in the dropdown you need the following code:


IPrivate<viewname>view.I<nodename>Element 
childele = wdContext.create<nodename>Element();
childele.set<attribute name> ("");
childnode.addElement(childele);
childnode.moveNext();

2) To get the selected element:

When user selects one element in drop down it automatically set lead selection of node binded to dropdown.

So to take this chosed element use this code


wdContext.current<name of the node>Element().get<attribute name>();

Regards.

Rajat