cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown by Index: Initial lead selection

Former Member
0 Kudos

All,

<b>This is my requirement:</b> I have a dropdown (By Index), By default I wanted to have blank as selected value.

If user selected any of the value, it has to be seleted value.

<b>What i did so far is:</b>

I set selection of node to 0..1, cardinality as 0;n and set initializeLeadSelection to false

<b>The problem:</b> I have is, by default im getting the blank space in dropdown, no issue here.

but when user selects any value from drop down, it always showing the space. not the selected value.

Thanks ...

BM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bharathi

Clear one doubt, you said " when user selects any value from drop down, it always showing the space. not the selected value."

1)is it changing the selection to blank in dropdown ?

2) is it stroing a blank value to the backend?

Regards

Chaitanya.A

Former Member
0 Kudos

Thanks for your reply..

Say I have 2 value in the dropdown, 1. Space 2 . ABC

When user selects some value(ABC), it always set the space as selected. Not ABC. ABC is remain unselected.

Hope this is clear..

BM

Former Member
0 Kudos

Hi Bharathi

is your list is static or dynamic?

i mean are you using Enumeration for Simple Type

Regards

Chaitanya.A

Former Member
0 Kudos

THis is how im populating the Dropdown:

IPublicMYAppl.IRNode modelNode = wdContext.nodeR();

int size = modelNode.size();

for (int i = 0; i < size; i++)

{

IPublicMYAppl.IRElement modelElement = modelNode.getRElementAt(i);

String reqID = modelElement.getRid();

IWDNodeElement newElement = node.createElement();

newElement.setAttributeValue("rD", rID);

newElement.setAttributeValue(

"org",

this.getOrgUnitName(modelElement.getOrgunitid()));

node.addElement(newElement);

}

BM

Former Member
0 Kudos

For your information, that above code is in DoModifyView. If I place the same code in DoInit, the dropdown value is blank.

I mean it doesnt bring any value.

Please anyone help me..I haev been sturgging with this issue for last 2 days..

BM

Former Member
0 Kudos

Hi Bharti,

Where are you executing your BAPI. Just write this code immediately after executing your BAPI and if you want this list to be populated only once then keep it under condition if(firtTime)in wdDoModifyView() method but your output model node should be populated either in the wdDoInit() of the view controller or the component controller.

Warm Regards,

Murtuza

Former Member
0 Kudos

You might try this:

Create a context value node "Items", cardinality 0:N, selection 0:1 with a supply function "supplyItems".

In the supply function, create the node elements that should appear in the dropdown-list.


void supplyItems(IItemsNode node, ...)
{
  for (int i = 0; i < wdContext.nodeR().size(); ++i)
  {
    IRElement e = wdContext.nodeR().getRElementAt(i);
    IItemsElement item = node.createItemsElement();
    node.addElement(item);
    item.setRD(e.getRid());
    item.setOrg(getOrgUnitName(e.getOrgunitid()));
  }
  node.setLeadSelection(IWDNode.NO_SELECTION);
}

At the event handler that calls the BAPI and changes the model node content, just call wdContext.nodeItems().invalidate() to trigger the supply function and will the items with the updated values from the model.

(You might also give your context nodes and attributes more useful names)

Armin

Former Member
0 Kudos

I solved the issue..The issue was altogether different..Thanks guys for responding & helping..

BM

Adi_Bathineni
Participant
0 Kudos

Hi Bharathi,

I'm facing the same problem with the drop down by index.

When i selected some value from the Drop Down By Index it is always selecting the First Row....

Please give me the solution.

Thanks in advance.

Regards,

Adi.