cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in refreshing the dropdown values

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

sorry its not effects other nodes but i meant other attributes..

Regards,

Ashish singh

gill367
Active Contributor
0 Kudos

HI

What you can do is create one seperate node and add the attributes to it which are bound to dropdown.

just invalidate it and fill it with the new values.

otherwise tell me are you not invalidating the model node when executing the RFC.

Thanks

Sarbjeet

Former Member
0 Kudos

Hey Sarbjeet ,

I created the new node and the attribute which is bound to the dropdown.... but after execution ,the dropdown is getting disabled...

regards,

Ashish

Former Member
0 Kudos

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

gill367
Active Contributor
0 Kudos

Hi

r u refilling it after invalidating with new elements.

Sarb

Former Member
0 Kudos

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)

Former Member
0 Kudos

yes i have to refill it after the invalidate....

invalidate i have used before populating the data in dropdown..... when i click on GetCategory buton the dropdown is getting d9isabled... and i m populating the dropdown when i click that button....

regards,

Ashish singh

Former Member
0 Kudos

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

Former Member
0 Kudos

Yes i m adding the data,

valueSet.put(AppCategory,AppCategory"-"listOfCommDesc);

former_member214651
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

gill367
Active Contributor
0 Kudos

HI

Invalidate the node in the first line of your eventhandler for the get category button.

This will make the attribute empty and will fill it again with new values from MDM..

Thanks

sarbjeet Singh

Former Member
0 Kudos

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

gill367
Active Contributor
0 Kudos

HI

You can invalidate the node which is having the attribute bound to the dropdown

before populating it again with the new values.

wdcontext.node<nodename>().invalidate();

Thanks

Sarbjeet Singh.

former_member214651
Active Contributor
0 Kudos

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