on 12-14-2010 1:52 PM
dear all
i create to key dropdonlist that take their element from simple type built dictionary development component.
i need to know how to make them dependent so when for example i choose the usa element from the first dropdownlist the second dropdownlist show the states of usa
regards
dear Segmentation
could you pass the link for me because i cant find it
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IWDAttributeInfo attributeInfo = wdContext
.nodeMatchingField()
.getNodeInfo()
.getAttribute(
IPublicSLNCreationComp.IMatchingFieldElement.RELATIONSHIP_TYPE);
ISimpleTypeModifiable tablesType = attributeInfo
.getModifiableSimpleType();
IModifiableSimpleValueSet valueSet = tablesType.getSVServices()
.getModifiableSimpleValueSet();
valueSet.clear();
//populate the states, and put them to vauleset
valueSet.put("","")
the code is an example, you have to adapt to your case, only some name change, i think.
dear all
i try to do everything you told me to do but nothing works
what im doing is i have to 2 simple types and make it as public parts
and bind this types to the view context
and i this working with me
but i need to make the second depend on the first i pend the hole day searching and trying to do this
but no result
so plz any one have any other idea
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
- Define two DDIC types "Country" and "State" inside the IDE. Don't add values yet.
- Define context attributes "country" and "state" accordingly.
- Add DDByKey "CountrySelector" and "StateSelector" to your view.
- Bind the "selectedKey" properties of both DDByKey elements to "country" and "state".
- Assign an action "CountrySelected" to the "onSelect" event of the "CountrySelector"
- In wdDoInit() fill the value set of the "Country" type.
- In the action handler for "CountrySelected" check the value of the "country" context attribute and fill the value set of the "State" type depending on that value.
The code to fill a value set of a DDIC type can be found by searching this forum.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tareq,
do code like below. cosider you have 2 dropdown fileds country and state. 1st take country in the context parameter, like below -
String sCountry = wdContext.currentContextElement().getCountry();
then take state in the 2nd property paramer like above - String sState = wdContext.currentContextElement().getState();
then use for loop like - for(int i=0; i<sState .size(); i++) - in it, populate the states corresponding to the country using java, it would require some sort mechanism.
you'll get this type of code in google.
Regards,
Sen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
dear
plz explain how could i do this
im new to sap developer studio
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
dear
i know
but i need the code because i dont know how to write it
i dont want to give the second dropdownlist element from an array i define
i want this dropdownlist take spicific element from the simple type
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Tareq,
Your values should be like this to filter.
CountryNode.
IN India
USA America
AUS Australia
StateNode
IN KA Karnataka
IN TN Tamil Naud
IN KL Kerela
IN DL Delhi and so on for USA and AUS.
so in first drop down if you select India then get the key value "IN" by using
String Country = wdContext.currentCountryNodeElement().getCountry().
IprivateSampleView.IStateDDNodeElement element;
for(int i=0;i<wdContext.StateNode().size();i++)
{
if(wdContext.nodeStateNode().getStateNodeElementAt(i).equalsIgnoreCase(Country);
{
element = wdContext.createStateDDNodeElement();
element.setState(wdContext.nodeStateNode().getStateNodeElementAt(i).getState();
wdContext.nodeStateDDNode().addElement(element);
}
}
StateDDNode is the one you are going to bind to Second Drop Down.
Rever for any queries.
Regards
Nizamudeen SM
I think it's all up to you,
you can put the code in onSelect event of the first dropdown to manipulate the data of second dropdown
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 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.