03-04-2010 04:54 AM
Dear Guys,
I wanted some assistence.
i have a scenario.
I want to display a popscreen where in i want to add ObjectChoice field and a button and then i want to add some events to the button.
I am developing using eclipse using 4.5.0 components
Can anyone point me right direction with some links or examples.
any help is higly appreciated
Many thanks
Nadir Firfire
Solved! Go to Solution.
03-04-2010 05:23 AM
well, sounds fairly straight forward. where exactly do you need assistance? post your code and mark your problems.
03-04-2010 05:56 AM
This is the PopUp class
package zeo; import net.rim.device.api.ui.Field; import net.rim.device.api.ui.component.Dialog; import net.rim.device.api.ui.component.LabelField; import net.rim.device.api.ui.component.PasswordEditField; import net.rim.device.api.ui.component.SeparatorField; import net.rim.device.api.ui.container.PopupScreen; import net.rim.device.api.ui.container.VerticalFieldManager; public class PopUp extends PopupScreen { PasswordEditField answer; PopUp(){ super(new VerticalFieldManager(),Field.FOCUSABLE); LabelField question = new LabelField("Please enter password"); answer = new PasswordEditField(" ",""); add(question); add(new SeparatorField()); add(answer); Dialog.alert("TEST"); } }
this is the code which is calling the popup class
but it seems its not calling since nothing is being displayed
FieldChangeListener listenerbtn = new FieldChangeListener()
{
public void fieldChanged(Field field, int context) {
String fullText;
if (field instanceof CustomButtonField) {
fullText = ((CustomButtonField)field).getText();
Dialog.alert(fullText);
//DialogFieldManager dfm = new DialogFieldManager();
//dfm.add(Options);
UiApplication.getUiApplication().popScreen(new PopUp());
Dialog.alert("YA ALLAH SHOW ME THE WAY");
//UiApplication.getUiApplication().
}
}
};
03-04-2010 06:51 AM
well, you call super with a new vfm. there is nothing to display, then...
03-04-2010 07:26 AM
i got it
this is the code mistake
UiApplication.getUiApplication().pushScreen(new PasswordPopupScreen());//correct instead of UiApplication.getUiApplication().popscreen(new PasswordPopupScreen());//wrong
thanks simon