cancel
Showing results for 
Search instead for 
Did you mean: 

Currency drop down problem?

Former Member
0 Kudos

hi

I have made 2 dropdownbyindex inputfield and bind it to Value attribute TCurrency(type currency)of Value Node TradeCurrency and Value attribute CCurrency(type currency)

of Value node counter currency respectively.I want that if user selected inr in TradeCurrency drop down then value in CounterCurrency drop down selected is US Dollar and viceversa.

Can i use concept of index in this?(I think so no if yes hw?)

In enumeration tab of currency I get an option generate a class representation of the enumeration?what is use of this option ?

please help me

Regards

Nidhideep.

Accepted Solutions (0)

Answers (1)

Answers (1)

sridhar_k2
Active Contributor
0 Kudos

Hi,

Try to use this code. If you select Indian Rupee from Trade Currency - US Dollar will be selected in CounterCurrency.

For this i created a simple type, whose type is Currency(Select it from BaseType) assign it to Trade Currency - TCurreny . Create another simple type to Counter Currency - CCurrency.


String tradeSelectedVal = wdContext.nodeTradeCurrency().currentTradeCurrencyElement().getTCurrency();
manager.reportSuccess("Came hre : "+tradeSelectedVal);
IWDAttributeInfo attributeInfoLevelClass = wdContext.nodeTradeCurrency().getNodeInfo().getAttribute(wdContext.currentTradeCurrencyElement().T_CURRENCY);
ISimpleTypeModifiable levelType = attributeInfoLevelClass.getModifiableSimpleType();
IModifiableSimpleValueSet valueSetLevel = levelType.getSVServices().getModifiableSimpleValueSet(); 
String tradeSelectedTxt = valueSetLevel.getText(tradeSelectedVal);
String counterTargetTxt = null;
if(tradeSelectedVal != null){
if(tradeSelectedVal.equalsIgnoreCase("inr")){
counterTargetTxt = valueSetLevel.getText("USD");
}
}
wdContext.nodeCounterCurrency().currentCounterCurrencyElement().setCCurrency(counterTargetTxt);

Reply me, if you are not clear with above.

Regards,

Sridhar