cancel
Showing results for 
Search instead for 
Did you mean: 

DropDown in a table problem

Former Member
0 Kudos

Hi all,

I am working with NetweaverMobile Client for Handheld. Here I am facing one problem with DropDown.

I have one DropDown in a Table UI Element. I am trying to access the currently selected value in that

dropdown. But Only the first value in dropdown coming even I change leadselection.

Please help me regarding this.

Thanks in advance

Narayana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

What I did was created a select action on the dropdown. The event that is passed with the action has the index of the item selected.

public void onActionSelect<dropdown item>(Event wdEvent) {

//@@begin onActionSelect<dropdown item>(ServerEvent)

Integer selobj = (Integer)wdEvent.getEventData("index");

wdContext.node<dropdown item>().setLeadSelection(selobj.intValue());

//@@end

}

Hope this helps.

Brian Timothy

Former Member
0 Kudos

Hi Brian,

I already tried this code. It's worked fine for DropDown. But it's not working for DropDown in a Table.

I mean <DDNode> is a child node of <TableNode>. If table having set of rows, then i need to access

different values based on selection on DD in each row.

Can anybody have update on this?

Thanks

Narayana

Edited by: Narayana L on Nov 14, 2008 8:15 AM

Former Member
0 Kudos

Hi all,

This issue is reslved.

I have taken one extra attribute as child of <TableNode> , say 'text'.

I used code given by Brian in the action of DD ( dd in table).

More than that sorry to say, this only not helped me.

I added one more statement to his code to set currently selected value to the above attribute 'text'

This is the code

Integer selobj = (Integer)wdEvent.getEventData("index");

wdContext.node<TableNode>.node<DDNode>.setLeadSelection(selobj.intValue());

wdContext.node<TableNode>().current<TableNode>Element().set<Text>(""+wdContext.node<TableNode>().node<DDNode>.current<DDNode>Element().get<Text>);

I used the variable 'text' for each record of table to get the selected dd value.

If anybody need clarification revert me.

Thanks

Narayana

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

check you selection. It seems to me you always select item 0 of the box - not the selected item iteslf. Is the 0 hard coded perhaps? You need to set it to the line selected by the mouse. I am not sure about the exact syntax cause I am not at my desk at the moment, but I hope at least the hint helps.

Regards,

Oliver

Former Member
0 Kudos

Hi

Thanks for your reply. I am not hard coding anything. I have , say 3 values in DD, and I am selecting 2nd

value. And then I am displaying the selected value. But it's displaying first value only.

This is the statement I am using to get value.

wdContext.node<TableNode>().node<DDNode>().current<DDNode>Element().get<attribute>();

Can you help me regarding this...

Thanks in advance

Narayana

Former Member
0 Kudos

Hi,

I am not 100% sure, but I would do it a little different. If the DropDown has a name, then I would say:

wdContext.currentContextElement().get<name>()

And this would give me the name - perhaps I need on .toString() - but this depends on what I want to do with it........

Not sure if it helps?

Regards,

Oliver