10-05-2010 03:49 AM
Hello,
I am using a FieldChangeListener to detect when an option has been selected in an ObjectChoiceField. This listener gets invoked twice on the focus and finally once selected.
How do I distinguish when the selection is complete ?
Here is the code that gets used:
class FieldListenerViewItem implements FieldChangeListener
{
public void fieldChanged(Field field, int context)
{
try
{
}
catch (Exception e)
{
Dialog.alert(e.toString());
}
}
}
Regards.
10-05-2010 03:51 AM
check the context value
10-05-2010 03:55 AM
Simon,
Thank you for your reply. I have checked the context value and it is 2 on both occasions. So that will not help me ![]()
10-05-2010 04:44 AM
Doesn'y anyone else have any suggestions ?
Regards
10-05-2010 04:46 AM - edited 10-05-2010 04:48 AM
I am trying to reproduce your problem but what i am getting is
for programatic change
context = =PROGRAMMATIC
for focus change
context == 0
for selection
context == 2
and i think its a expected behavior.
which simulator or device you are getting context ==2 for both?
10-05-2010 04:54 AM
I am using the BB plugin for eclipse, And the 9550 Device on the simulator.
10-05-2010 05:07 AM
Vivart,
I have changed my simulator device to a 9700. On this model the context does in fact change and give me the correct values 0 == Focus 2 == selected. Do you have any idea as to why this is not the case for the 9550 ? Is this potentially a bug or does this have something to do with the touchscreen ?
Regards
10-12-2010 11:06 AM
I have logged this issue in the Issue Tracker here: https://www.blackberry.com/jira/browse/JAVAAPI-151