on 08-23-2010 1:16 PM
Hi experts,
In my application when user enters the input ,with the help of search criteria i m populating the dropdown.
Now when the user changes the input i need to refresh the dropdown but it is not getting refreshed....
i have used valueSet.clear() also even then i m getting the old values that were fetched on the first try.
can anybody help in out in this.
with regards,
Ashish
Hi Poojith,Sarbjeet,Jeetendra..
Thanks for the reply... I sorted out the problem,,,,
Code was fine but there was the problem with the
data in the MDM... But ur replies were very helpful,
so i have given points for the reply thanks...
regards,
Ashish singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi sarbjeet,
The node that has the attribute which is bound to the dropdown has lots of other attribute also so if i invalidate the node it will effect the other nodes also.... can u tell me any other solution
Regards,
Ashish singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey prince,
The drop down is getting disabled because you are not getting any data from the Model as i think, check that there is no error in execution of model and did you binded the model attributes directly to UI element. one more possibility is that the cardinality of the node which is binded with ui is 0-n check and let us know what is the case.
Regards
Jeetendra
Cardinality is 0...n,
and if i m not invalidating the node i m able to populate the dropdown,
i m binding the node and attribute in wdinit() as follow,
IDropDownNodeNode node1 = wdContext.nodeDropDownNode();
IDropDownNodeElement element1 = node1.createDropDownNodeElement();
node1.bind(element1);
before populating rthe data in the drop down i m using following code
IWDAttributeInfo NodeInfo = wdContext.nodeDropDownNode().getNodeInfo().getAttribute("appCat");
ISimpleTypeModifiable simpleTypeModifiable = NodeInfo.getModifiableSimpleType();
IModifiableSimpleValueSet valueSet = simpleTypeModifiable.getSVServices().getModifiableSimpleValueSet();
valueSet.clear();
AND IF I INVALIDATE the node ,
i think the data is populating in the dropdown but the problem is it is DISABLED.....
i searched in sdn to how to refresh dropdown and every where the ans valueSet.clear();,, but i donno y it is not happening...
with regards,
Ashish singh(prince)
Hi Prince,
what about after this code piece.?
IWDAttributeInfo NodeInfo = wdContext.nodeDropDownNode().getNodeInfo().getAttribute("appCat");
ISimpleTypeModifiable simpleTypeModifiable = NodeInfo.getModifiableSimpleType();
IModifiableSimpleValueSet valueSet = simpleTypeModifiable.getSVServices().getModifiableSimpleValueSet();
valueSet.clear();
are you adding the values again to valueSet. if you are not adding the values then it may be a reason for getting the dropdown disabled.
please check it and let us know.
Regards
Jeetendra
Hi,
Try the following:
1. Create a context attibute of type String.
2. Bind the attrbute to Dropdown UI element.
3. Create a method in ur view.
4. Call this method on the action of the button with the following code:
IWDAttributeInfo attrDD = wdContext().currentContextElement().getNodeInfo().getAttribute("<context attribute name>");
ISimpleTypeModifiable simpDD = attrDD.getModifiableSimpleType();
IModifiableValueSet valueDD = simpDD.getSVServices().getModifiableSimpleValueSet();
valueDD.clear();
//write the code here to pass the 4 input field values and get the output from MDM
for(int i = 0; i < <outputNode>.size(); i++)
{
valueDD.put(<outputNode>.get<outputNode>ElementAt(i).get<Key>,<outputNode>.get<outputNode>ElementAt(i).get<Value>,);
}
Hope this helps you.
Regards,
Poojith MV
Hi,
After you have tried the approach suggested by others, try the code as below:
IWDAttributeInfo attrDD = wdContext.nodeButtonState().getNodeInfo().getAttribute("<context attribute name>");
ISimpleTypeModifiable simpDD = attrDD.getModifiableSimpleType();
IModifiableSimpleValueSet valueDD = simpDD.getSVServices().getModifiableSimpleValueSet();
valueDD.clear();
if(valueDD.isEmpty()) { // To check if it is really cleared.
wdComponentAPI.getMessageManager().reportSuccess("Its empty");
}
// Then add it...
for(int i = 0;i<ouput.size;i++) {
valueDD.put("key", "value");
}
Bit surprised why it is not getting refreshed. If valuset does not get cleared then it wil retain the previous values and also append the new values to it when you get the data from MDM and add it to the valueset collection.
Regards,
Manoj
Hi Poojith,
thanks for the reply,...In my senario there r 4 input fields, when the user enters the input field and click the button GetCategory
then i m populating the dropdown from MDM by searching the above 4 input field in MDM.
Now when the user changes the entry in the above 4 input fields and hits the GetCategory button i need to refresh the dropdown and fill the dropdown with the new data according to the search but in my case the dropdown is not getting refreshed...
I did use the valueSet.clear() before populating the dropdown.
regards,
Ashish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
When the user selects a new value have u written the clear() statement on action of the Input? else, try the following:
1. write the code to populate the dropdown in another method
2. Call this method on action of the search field.
Hope this helps you.
Regards,
Poojith MV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.