hey in my screen there is a an edit field and 2 custom button fields as "OK" and "CANCEL" Below buttonfield there are some more focussable label fields
when i write a name in edit field and press enter then focus comes to "OK" button but how to set focus on "CANCEL" button.
Moreover while scrolling the focus does not automatically move ahead???
what to do may be i m confused with touch events and their handling!!!
Kindly help!!!!!!!!!!!!
Code:
txt_Name = new EditField(TextField.NO_NEWLINE)
{
public void paint(net.rim.device.api.ui.Graphics g)
{
g.setColor(Color.MAROON);
super.paint(g);
}
};
txt_Name.setFont(font);
v1 = new VerticalFieldManager();
v1.add(txt_Name );
ButtonField btn1 = new ButtonField("OK",ButtonField.CONSUME_CLICK);
ButtonField btn2 = new ButtonField("CANCEL",ButtonField.CONSUME_CLICK);
v2 = new VerticalFieldManager();
v2.add(btn1);
v2.add(btn2);
LabelField l1 = new LabelField("Hello Moon ",Field.Focussable);
LabelField l2 = new LabelField("Hello Citizen",Field.Focussable);
LabelField l3 = new LabelField("Hello People",Field.Focussable);
LabelField l4 = new LabelField("Hello world",Field.Focussable);
v3 = new VerticalFieldManager();
v3.add(l1);
v3.add(l2);
v3.add(l3);
v3.add(l4);
add(v1);
add(v2);
add(v3);
}
protected boolean navigationClick(int status, int time)
{
if(OK.isFocus())
{
//execute some code
return true;
}
if(CANCEL.isFocus())
{
//execute some code
return true;
}
}