on 01-25-2008 1:38 PM
At the moment I am using DropDownByIndex.
IPrivateUserRegistrationView.ICountryElement ele;
for (int i = 0; i < countrynames.length; i++) {
ele = wdContext.nodeCountry().createCountryElement();
ele.setCountryname(countrynames<i>);
wdContext.nodeCountry().addElement(ele);
}
There is no problem with this.
However i would like to display value='England" and key = "EN"
that means when the user selects England, the backend server receive as "EN"
How can i achieve this?
Hi,
In CountryElement, create an additional String attribute for countrycode.
In your onSelectAction that is linked to your dropdownbyindex, you can get the user selected country code through:
wdContext.currentCountryElement().getCountryCode();
Good luck, Roelof
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In wdDoInit I would say.
You can also put it in wdModifyView, but then you must do it only once:
if (firsttime) {
fill context node here.
}
wdDoInit is preferred however.
Good luck, Roelof
PS Even better would be to do it in the wdDoInit method of the controller where do the backend call. You can map the context node to your view.
The advantage is that the selected country code is available in your controller, you don´t have to pass parameter variables from view to controller.
Edited by: R. Knibbe on Jan 25, 2008 3:44 PM
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.