BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-09-2007, 11:05 AM   #1 (permalink)
New Member
 
Join Date: Mar 2007
Model: 8200
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Smile ChoiceGroup.POPUP don't Work!

Please Login to Remove!

Hello Guys!
Somebody can help me?
I have 2 ChoiceGroups (POPUP type) on my app
the first ChoiceGroup controller the second ChoiceGroup
that is, on change value in firt ChoiceGroup the values from second ChoiceGroup are reloadeds with new data.

In WTK emulator works fine!!!
But in BB emulator or BB Real Device don't work

I being crazy and i can't sleep with this problem!

What i do to solve this problem?
(Sorry to my poor english)

Best regards;
Offline  
Old 03-10-2007, 03:13 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

can you post short code sample, which works on WTK and doesn't work on BB ?
Offline  
Old 03-28-2007, 09:39 AM   #3 (permalink)
New Member
 
Join Date: Mar 2007
Model: 7100g
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Other Option for ChoiceGroup

Hi to all,

I did App on j2me . It accept the ChoiceGroup. But BlackBerry it shows the change option.But it Couldn't work.

Can any one face these problem.

Help Me...............

My code is:

import java.util.Calendar;
import java.util.Date;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.Connector;
public class Timesheet extends Form implements ItemStateListener,CommandListener
{

public Table table;
private Display display;
private Form mainform;
public Form innerform;
private Command cmExit;
private Command cmNext;
private Command cmProcess;

//Date Week
public ChoiceGroup view ;

// Fields
private ChoiceGroup formname;
private DateField dateview;
private ChoiceGroup projectview;
private ChoiceGroup status;
private int formdefaultindex;
private int formgenderindex;

private int viewdefaultindex;
private int viewgenderindex;

private int projectdefaultindex;
private int projectgenderindex;

private int statusdefaultindex;
private int statusgenderindex;

private TextField timeview1;
private TextField timeview2;
private TextField activityview;
private TextField hoursview;

public String formvalue;
java.util.Date now ;
public String projectvalue;
public String statusvalue;
public StringItem message;

//Buttons
public StringItem addbtn;

public Command cmd_add;


final Alert soundAlert = new Alert("sound Alert");

Canvas myCanvas;

//Timesheet tsht = new Timesheet();


public Timesheet(Display display )
{
super("TimeSheet");
intiForm();

}
public Timesheet()
{
super("TimeSheet");
intiForm();

}

public void intiForm()
{

mainform = new Form("Timeform");
System.out.println("Entering");
//display = Display.getDisplay(this);

view = new ChoiceGroup("View:",Choice.POPUP);
formname = new ChoiceGroup("Form Name:",Choice.POPUP );
dateview = new DateField("Date:", DateField.DATE);
projectview = new ChoiceGroup("Project :", Choice.POPUP);
status = new ChoiceGroup("Status:", Choice.POPUP);

timeview1 = new TextField("Time:", "", 70, TextField.ANY);
timeview2 = new TextField("", "", 70, TextField.ANY);
activityview = new TextField("Activity:", "", 70, TextField.ANY);
hoursview = new TextField("Hours:", "", 70, TextField.ANY);


cmExit = new Command("Exit", Command.EXIT, 1);
cmNext = new Command("Next", Command.SCREEN, 1);
cmProcess = new Command("Process", Command.SCREEN, 1);
setCommandListener(this);

System.out.println("Working");
//choice adding
view.append("Week",null);
viewdefaultindex=view.append("Day",null);
// viewgenderindex = append(view);
view.setSelectedIndex(viewdefaultindex,true);
setItemStateListener(this);

formname.append("Expense",null);
formdefaultindex = formname.append("Time",null);
formname.setSelectedIndex(formdefaultindex,true);
setItemStateListener(this);


projectview.append("Toucan",null);
projectview.append("Bluestar",null);
projectdefaultindex = projectview.append("ToucanBB",null);
projectview.setSelectedIndex(projectdefaultindex,t rue);
setItemStateListener(this);


status.append("Close",null);
statusdefaultindex = status.append("Open",null);
status.setSelectedIndex(statusdefaultindex,true);
setItemStateListener(this);


append(view);
append(formname);
append(dateview);
append(projectview);
append(status);

Calendar cal = Calendar.getInstance();
Date date = new Date();
cal.setTime(date);

addCommand(cmNext);
setCommandListener(this);
addCommand(cmExit);
setCommandListener(this);


System.out.println("finishing");
now = new java.util.Date();
dateview.setDate(now);

String[] text={"Start", "End", "Activites","Hours"};
Table table=new Table("",display,5,4, text);
table.setHeaderText(text);
this.append(table);

System.out.println("Ending");


}


public void itemStateChanged(Item item)
{

String check = view.getString(view.getSelectedIndex());
Alert al = new Alert("AletMsg",check,null,null);
ToucanMain.display.setCurrent(al);

System.out.println("view Entered="+view.getString(view.getSelectedIndex())) ;

if(((view.getString(view.getSelectedIndex()))=="We ek")&&(formname.getString(formname.getSelectedInde x())=="Time"))
{
String[] text1={"Date","Activites","Hours"};
Tableweek tableobj=new Tableweek("",display,8,3, text1);

this.delete(5);
this.append(tableobj);

}
if(((view.getString(view.getSelectedIndex()))=="Da y")&&(formname.getString(formname.getSelectedIndex ())=="Time"))
{
String[] text={"Start", "End", "Activites","Hours"};
Table table=new Table("",display,5,4, text);
table.setHeaderText(text);
this.delete(5);
this.append(table);

}
if(formname.getString(formname.getSelectedIndex()) =="Expense")
{
String formtest = formname.getString(formname.getSelectedIndex());
Alert fal = new Alert("FormAlet",formtest,null,null);
ToucanMain.display.setCurrent(fal);

System.out.println("expense sheet="+formname.getString(formname.getSelectedInd ex()));
ToucanManager.formchanged(view.getString(view.getS electedIndex()), formname.getString(formname.getSelectedIndex()));

}



if(item==view)
{
//get view info
StringItem viewmsg = new StringItem("Selected:", view.getString(view.getSelectedIndex()));
String viewname = viewmsg.getText();
System.out.println("view="+viewname);

//get form info
StringItem formmsg = new StringItem("Selected:", formname.getString(formname.getSelectedIndex()));
String formname = formmsg.getText();
System.out.println("view="+formname);

ToucanManager tm = new ToucanManager();
boolean variable = tm.formchanged(viewname,formname);
System.out.println("View Status="+variable);




}
else
{
if(item==formname)
{

StringItem formmsg1 = new StringItem("Selected:", formname.getString(formname.getSelectedIndex()));
String formname = formmsg1.getText();
System.out.println("Form="+formname);

StringItem viewmsg1 = new StringItem("Selected:", view.getString(view.getSelectedIndex()));
String viewname = viewmsg1.getText();
System.out.println("view="+viewname);

ToucanManager tm = new ToucanManager();
boolean variable = tm.formchanged(viewname,formname);
System.out.println("Form Status="+variable);


}
}

}
public void commandAction(Command command,Displayable display )
{

if(command==cmNext)
{

System.out.println("Next is clicked="+command.getLabel());
System.out.println("Form="+formname.getString(form name.getSelectedIndex()));
System.out.println("View="+view.getString(view.get SelectedIndex()));
ToucanManager.formchanged("Day", "Expense");
}
else if (command==cmExit)
{
System.out.println("cmdexit");
Alert altn = new Alert("Closing","CMD_EXIT",null,null);
ToucanMain.display.setCurrent(altn);


}
else if (command==cmProcess)
{

System.out.println("Process working in case");

}
else
System.out.println("Not in case");

}

public void commandAction(Command command,Item item)
{

if(item==addbtn)
{
System.out.println("button");
}

}

}
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.