on 03-25-2008 3:12 PM
Hi, I have several RadioButtons and DropDownBoxesByKey which are filled with options by Simple Type enumerations. So I made an Simple Type, added enumerations, that simple type is binded to RB or DDB context and such context into the layout item itself. Usual way.
In case of normal InputField, either of type of String or Date I have:
String ctx1 = wdContext.currentContextElement().getCtx1();
Date ctx2 = wdContext.currentContextElement().getCtx2();
that works fine and I can do with it whatever I want. In case of an context to which I have binded SimpleType I dont know what type should I use, how can I "pick" chosen value (either from DDB or RB)? Please advice. Balmer
Hi,
just type
wdContext.currentEuropeElement().
then Pres ctrl+space
here you can see all the methods and check whether getCountries method is present .
if it is there means , look what is the return type.
organize imports >rightclick>Source-->organize imports.
Edited by: fazal ahamed on Mar 25, 2008 5:58 PM
Edited by: fazal ahamed on Mar 25, 2008 6:00 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, funny thing is that
String ctx1 = wdContext.currentContextElement().getCtx1().toString();
works in both cases, DDB and RB. It didnt show me that option after ctrlspace normally, it did when I used in between already written wdContext.currentContextElement()."ctrlspace".toString(); Even that, it showed error, I saved metadata anyway and bam, no errors. Works fine.
So that issue is resolved, got familiar issue with "set" now
How to reverse from String to previous type? I use
stUpdate.execute("select tablename Ctx1");
wdContext.currentContextElement().setCtx1(resultSet.getString(1));
and it works fine. I went through ctrl+space option but no resolution was found. Please advice. Balmer.
hi Balmer,
I understand your requirement is to find the selected value fromt he DDK or RDK to which the simple type is added. Now the simple type has enumeration attached to it. Say, you dropdownkey is mapped to attribute "Key" in node "DropKey". Now say your enumeration has 2 values 1-product1 and 2-product3.
Now to get the values,
you have to:
String value = wdContext.currentDropKeyElement().getKey();
if(value.equals("1"))
{
// Action for Selection of Product 1
}
else if(value.equals("2"))
{
//Action for Selection of Product 1
}
it can easily work this way.
Now if you select Product1 from the dropdownkey, a particular action occurs, and if select Product2 another...
regards,
pinki
Hi Balmer,
You can find the type of the simpleType here:
Open Simple Type
Open definition Tab (default tab)
See built-in Type
You have to use the same type
If it is a String you can get read the selected key like this:
String key = wdContext.currentContextElement().getRBKey();
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.