09-23-2009 05:49 AM - edited 09-23-2009 05:52 AM
Hi,
am adding controls to a manager as shown below..ie controls get added as and when the button is clicked.Later on when i want to access each control and get the values , i would like to know which control gave me which value..
For Eg : Say the button gets clicked 10 times..So i ll have 10 choice fields.. when i retrieve the values by iterating through the field manager i need to know if which choice field gave which value. That is if the first choice field has been set with "Choice 1" and second with "Choice 2" , i need to know that the first choice field gave " Choice 1 ".
Is there a way of setting some label of some kind so that i can just say choicefield with this particular " label " gave me this value or choicefield with this particular "id " gave me this value..???
<CODE>
FieldChangeListener changed= new FieldChangeListener()
{
public void fieldChanged(Field field , int context)
{
String choices[] = {"Choice1", "Choice2", "Choice3"};
choiceField = new ObjectChoiceField("Project and Activity :", choices,0, choiceField.FIELD_LEFT);
verticalmanager.add(choiceField);
}
}
button.setChangeListener(changed);
</CODE>
09-23-2009 05:57 AM
09-23-2009 06:39 AM
09-23-2009 06:46 AM
09-23-2009 07:01 AM