cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down by index default Value

Former Member
0 Kudos

Hi all,

I have a DropDownByIndex.This is populated after executing RFC.This is done.But its having one empty row and other rows are having values.I want to avoid that empty row and instead of that i want to show -Select network- as a default value.How to accomplish this?can anyone help me out?

Thankx in advance.

Regards,

Karthick

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Set the "Selection Cardinality" property of the node which your DropDownByIndex is bound to.

Selection Cardinality 1..1

the blank row will not appear again

the blank row appears if 0 is allowed for "Selection Cardinality"

Former Member
0 Kudos

Hi Nibu ,

Thankx for your valuable suggestions.I'll test it on Monday and If I face any problem I'll raise the message again.....

Thankx again.

Regards,

Karthick

Former Member
0 Kudos

Hi Karthick,

Sorry for the earlier reply. I had misunderstood your requirement.

The posssible way to achieve this is to remove the blank row coming in the dropdown, then add a new element in the first index with the required text.

Let the attribute bound to the dropdown be 'attr' .Let it's parent node be 'parent_node'.

So to remove the blank row, set the 'selection' property of 'parent_node' as '1..1' instead of '0..1'. Since it is a mapped node, you won't be able to change this in the view, but only from the component controller context.

Now after calling the RFC write these lines of code in the view:

IPrivate<View>.I<parent_node>Element elmt = wdContext.create<parent_node>Element();

elmt.setAttrib("Select network");

wdContext.node<parent_node>().addElement(0,elmt);

wdContext.node<parent_node>().setLeadSelection(0);

This will show the first row of the dropdown as required.

Hope this helps,

Best Regards,

Nibu.

Message was edited by: Nibu Wilson