on 11-05-2007 3:25 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.