cancel
Showing results for 
Search instead for 
Did you mean: 

regarding dropdowns

jnmurthi
Participant
0 Kudos

Hi all,

I have a problem with dropdowns. I am using dropdown by key. When my screen loads, the dropdown gets filled in by some values from bapi. Now, I have got a requirement that I need to add a null value to the dropdown(i.e., there needs to be a empty value which should allowed for selection along with the values from the BAPI.).

How can I do that? Can I add new values to the dropdown which is populating from a BAPI? And if i can do that, how can add a space(or a null value at the top of the list)

Could anyone please help me regarding this?

Regards,

Murthy.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Let ur DDKey context variable be DDVAL.

For getting an empty field in DDKey,

IWDAttributeInfo att=wdContext.getNodeInfo().getAttribute(IPrivate<View>.IContextElement.DDVAL);

ISimpleTypeModifiable stm=att.getModifiableSimpleType();

IModifiableSimpleValueSet svs=stm.getSVServices().getModifiableSimpleValueSet();

svs.put(null,null);//Puts Empty value First

//svs.put(null,<SELECT>);//Shows <SELECT> First. Returns null while getting value

for(int i=0;i<masterNode.size();i++)//PUTTING THE REST OF VALUES

{

String id=""+masterNode().getmasterElementAt(i).getId();

String desc=""+masterNode().getmasterElementAt(i).getDescription();

svs.put(id,desc);

}

Regards

Fahad Hamsa

jnmurthi
Participant
0 Kudos

Hi,

Thank you.

My problem is solved.

Full 10 points awarded.

Regards,

Murthy.

Answers (2)

Answers (2)

former_member182374
Active Contributor
0 Kudos

Hi,

Do you use drop down by key?

If yes, add to the IModifiableSimpleValueSet object something like

svs.put("NO_SELECT","") before you populate it from the BAPI

Omri

Former Member
0 Kudos

Hi,

For this you will have to create a value node with the required fields from the BAPI and the new required field. Populate the fields and bind it to the dropdown.

Regards,

Shyam.