04-15-2010 01:43 AM
Solved! Go to Solution.
04-15-2010 04:05 AM
04-15-2010 09:56 PM
Thank you sir. Do you have some sample of that code?
04-16-2010 04:02 AM
you want a sample for a string? or a sample for overwriting toString?
04-16-2010 04:21 AM
*ashame*
Issit something like this :
ObjectChoiceField myChc = new ObjectChoiceField("Choices : ", myChcOb.value.tostring(), 0, ObjectChoiceField.FIELD_LEFT)
and if i wanna read the "hidden" value, i just get it like this :
selectedVal = myChc.getChoice(myChc.getSelectedIndex());
Now, how should i create myChcOb?
I know it is more like OOP subject rather than BB. ![]()
04-16-2010 04:47 AM
you create the field with an array of objects.
your object could look like this:
public class Bean{
private String secret;
private String description;
public Bean(String description, String secret){
this.secret=secret;
this.description=description;
}
public String getSecret(){
return secret;
}
public String toString(){
return description;
}
}
now create an array of Bean objects and initialize your field with it:
ObjectChoiceField myChc = new ObjectChoiceField("Beans : ", beans, 0, ObjectChoiceField.FIELD_LEFT)
04-16-2010 04:55 AM
You have sent me to the right direction, sir. Thank you very much! ![]()