cancel
Showing results for 
Search instead for 
Did you mean: 

Empty row in DropDownByIndex at run time

Former Member
0 Kudos

Hi all,

When i inserting values from database table to webdynpro dropdownbyindex at run time, one empty row is inserted above the rows in dropdownby index.

Is there any way to restrict the blank row in dropdownbyindex.Plz tell me.

Thanks.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

You can add empty row in backend database!

Regards

ravi

sridhar_k2
Active Contributor
0 Kudos

Hi,

Can you please check from the database whether first row is empty or not? When the first record is empty, drop down list box gets the empty record. You can check it from database returning object size also.

Regards,

Sridhar

Former Member
0 Kudos

Hi Krishnaveni,

I have a similar requirement of inserting values from Database into my DropDownByIndex. Can you please tell me the procedure you followed. Can you send me PDF or step-by-step procedure. My mail id: ganesh.jonna@gmail.com

Former Member
0 Kudos

HI,

Kindly close this thread if your problem get solved

Regards,

Sarvanan K

Former Member
0 Kudos

Hi Saravanan,

Can you please tell me the step-by-step development procedure, right from designing views, and their properties...connecting to back end and the code that gets the values from database into my DropDownByIndex.

Thanks a lot in advance

regards,

Ganesh

Former Member
0 Kudos

Hi Ganesh Jonna/Krishnaveny,

Follow the steps

Create one Node using the following code. Inside the DoInit() method

Step 1:

IWDNodeInfo multiplenode = multipleinfo.addChild("MultiNode" , null, true, false, true, true, false, true, null, null, null);

multiplenode.addAttribute("roles", "ddic:com.sap.dictionary.string");

Step 2:

Assign values for Dropdown

IWDNode node1 = wdContext.nodeNodeA().getChildNode("MultiNode", IWDNode.NO_SELECTION);

IWDNodeElement elem1;

for(int s=0;s<5;s++){

elem1 = node1.createElement();

elem1.setAttributeValue("roles","Value"+s);

node1.addElement(elem1);

}

Step 3:

Inside Domodifyview create IWDDropDownByIndex UI Element and Bind it.

IWDDropDownByIndex dropDownList = (IWDDropDownByIndex)view.createElement(IWDDropDownByIndex.class, "drop");

IWDAttributeInfo info = wdContext.getNodeInfo().getChild("NodeA").getChild("MultiNode").getAttribute("roles");

dropDownList.bindTexts(info);

dropDownList.setWidth("100");

Finally add this Dropdown into container. Like this you can create more Dropdown and add action to the dropdown as dynamically.

<b>If you remove Blankspace at top position then

set Cadinality node to 1..1

Value answer=points</b>

Kind Regards,

S.Saravanan.

Message was edited by: Saravanan S

Message was edited by: Saravanan S

Former Member
0 Kudos

Why do you propose to do all this stuff by code instead of using the tools? IMHO this will irritate new Web Dynpro users.

Armin

Former Member
0 Kudos

Hi Sarvanan,

Its working fine for Context Value node. But In my case, It is model node and I am not able to change Selection propery for that context node. I also tried on manually created modelnode. But not able to change selection property.

Please provide solution for model node.

Thank you very much.

Regards,

Mehul

Former Member
0 Kudos

In My case, Mapping Type is Collection_and_Selection.

for other cases, your solution works.

Former Member
0 Kudos

Hi,

Set the selection property of node to 1..1

Regards,

Saravanan K