cancel
Showing results for 
Search instead for 
Did you mean: 

Lead selection Issue

Former Member
0 Kudos

Hi all,

I am having dropdown by index as a table column. I am filling the node by supply function.

IPublicTests.ITabNode node = testController.wdGetContext().nodeTab();

int size = srcNode.size();

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

{

IPublicTests.ITabElement srcElement = srcNode.getTabElementAt(i);

com.sap.wdp.IPrivateView.IActionElement element = node.createActionElement();

element.setActioncode(srcElement.getid() + " " + srcElement.getDes());

node.addElement(element);

}

My dropdown is filling correctly.

But i want to display different values to be selected initially based on some condition ,in each rows dropdown.

How to set different lead values for each rows initially..

Plz its urgent...

Thanks&Regards

Karthik.

Accepted Solutions (1)

Accepted Solutions (1)

sridhar_k2
Active Contributor
0 Kudos

Karthi,

Try this one.

Lets assume TestNode is your Node and test2 is your context variable, which is binded to the drop down.

Depend on your condition, you can set any value to the particular row and particular cell value.

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

if(i==0) //condition to set value

{

wdContext.nodeTestNode().getElementAt(1).setAttributeValue("test2","Val2");

}

if(i==2){

wdContext.nodeTestNode().getElementAt(2).setAttributeValue("test2","Val1");

}

}

//test2 - is the dropdown key

//Val1 - which you want to show for that cell.

Regards,

Sridhar

Former Member
0 Kudos

Sridhar,

I tried ur code. But it is setting the value for only first rows dropdown.

Regards

Karthik

sridhar_k2
Active Contributor
0 Kudos

You have to instantiate the node, whichever row you want to set values, like this.

Let us assume if you want to set values to the 3rd row, use this code.

if(keep your logic here){

wdContext.nodeTestNode().getElementAt(2).setAttributeValue("test2","Val1");

}

In the same you can set for any row table values.

Regards,

Sridhar

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Karthikeyan,

Let your Value node corresponding to your table be 'Tab'

and your this tabnode's subnode(for dropdown by index) be 'Action'.

And this 'Action' node's value attribute(for dropdown by index element) be 'ActionCode'.

Then take the propety of 'ActionCode' attribute.

set 'Calculated' as true.

Then goto implementation. there will be 2 methods(getter and setter methods for the attribute

In the getter method set value to Action Code for a condition.

If it is not working, try the same with dropdown by Key. Surely it will work, for this

'tab' be ur table node, and its attribute 'ActionCode' be your attribute for 'dropdown by key. Implement EVS to populate values to dropdown.

Set its 'Calculated=true'.

Then in Gettermethod,


 public java.lang.String getTabActionCode(IPrivateTestCompView.ITabElement element)
  {
    //@@begin getTabActionCode(IPrivateTestCompView.ITabElement)
    //element refers to a table's row.'val' be another coumn attribute
    String actioncode="";
    if(element.getVal().equals("V1"))
      {
      	actioncode="T1"; //t1 be the key for dropdown.
      	element.setActionCode(actioncode);
     }
    return actioncode;
    //@@end
  }

Hope it will work

thanks

SMitha

Former Member
0 Kudos

Hi,

Make the attribute as calculated.

inside the getter based on your criteria return the values.

public java.lang.String getTabActionCode(IPrivateTestCompView.ITabElement element)

{

//@@begin getTabActionCode

if(// YOUR CONDITION)

{

return "aa" // SOME VALUES

}

return "bb";

//@@end

}

Regards

Ayyapparaj