05-16-2012 09:24 AM
Hello,
I have a question about the ListStyleButtonField. How can I make each field in the list go to a spicific screen class?
ListStyleButtonField firstField =
new ListStyleButtonField( button1left, "Customer", buttonRight, 0);
firstField.setChangeListener(
this);
add( firstField );
ListStyleButtonField secondField =
new ListStyleButtonField( button2left, " Contract", buttonRight,0);
add( secondField );
Solved! Go to Solution.
05-16-2012 09:33 AM
05-16-2012 09:54 AM
05-16-2012 10:03 AM
05-16-2012 10:03 AM
that's the screen i'm working with
// this is my constructor
public
LoginSuccessScreen(String username, String domain){
.....
Bitmap buttonRight = Bitmap.getBitmapResource(
"right.png" );
ListStyleButtonField firstField =
new ListStyleButtonField( button1left, "Customer ", buttonRight, 1 );
add( firstField );
//that is the field changed method
public
void fieldChanged(Field field, int context) {
// TODO Auto-generated method stubif (context != FieldChangeListener.PROGRAMMATIC) {
if (field == ??) {
UiApplication.getUiApplication().pushScreen(
newAlbum());
}
}
}
05-16-2012 10:06 AM
so I should declare the firstField and the secondField in the Class so I can use it in the methods, right?
05-16-2012 10:09 AM
I did it like that but it still not working ![]()
publicvoid fieldChanged(Field field, intcontext) {
// TODO Auto-generated method stubif (context != FieldChangeListener.PROGRAMMATIC) {
if (field ==firstField) {
UiApplication.getUiApplication().pushScreen(
newAlbum());
}
}
}
05-16-2012 10:15 AM
Hi,
I dont know if I am right...but
Is ur class implementing FieldChangeListner and have u add this listner to ur buttons.
Class implements FieldChangeListner
firstField.setChnageListner(this);
secondField.setChnageListner(this);
Thx
Rabi
05-16-2012 10:15 AM
05-16-2012 10:25 AM