on 06-15-2007 5:04 PM
Hi,
I have a page where I display 3 dropdowns from the same model node. But I cannot get different default values set for the dropdowns, as when I do leadSelection set for 1 dropdown, its sets the same leadSelection for all the dropdowns. So, I have created another context node and copy the model node to the context node.But, my problem is that I know only at runtime, how many items to be created (hence how many dropdowns would be created), so I have created a node
-Item (node) -
> List (node) (for dropdowns)---->attribute (attribute) (for values to be stored)
When I set the items (which I know at runtime), I copy the model node into List node (for each item).. so I have different list for each item.
But I am not able to display the dropdown. It shows me error:
java.lang.NullPointerException
at com.sap.tc.webdynpro.clientimpl.mobile.uradapter.DropDownByIndexAdapter.getSelectedKey
Please tell me the right approach to do this.
Thanks
Hi,
wdContext.nodeEx_State_List().moveFirst();
for(int i=0;i<wdContext.nodeEx_State_List().size();i++)
{
if(wdContext.currentEx_State_ListElement().getState_Desc().equals(wdContext.currentEx_Project_Search_ResultsElement().getState_Desc()))
{
wdContext.nodeEx_State_List().setLeadSelection(i);
break;
}
wdContext.nodeEx_State_List().moveNext();
}
Change the code according to your Context. it will set default value.
Regards
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Create 3 different nodes
1.Node1 -- key
-
Value
2.Node2 -- key
---Value
3.Node3 ---key
-
Value
<b>write 3 supply functions fill above nodes with Model Node</b> and change node properties cardinality 0 .n selection mode : 1-n
Take 3 DropdownByIndexs bind with above nodes.
Rgds
SS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
looks like you might need to dynamically define your structures.
refer to the tutorial on this:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c8780... [original link is broken] [original link is broken]
Depending on how flexible your application is you may want to actually code up n context elements to hold the dropdowns and just hide/unhide the ones you use (easier!) or dynamically create all of it.
Good luck,
Chris
Hi,
What i suggest is create node (DDBINode) and don't add any attributes to the node.
During runtime create attributes equal to the number of dropdowns and map the attributes to dropdown "texts" property while
creating the dropdowns dynamically.In this way each drop down will have its own context attribute.
For data copy the data from Model node to the dynamically created attributes under node (DDBINode) by creating elements under the node.
When you select value in one drop down it will not effect the value in other drop down.
Hi SAP Learner,
Check this threads.
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.