Hi,
i've got a problem by using a listField on a new screen.
I choose a menuItem from the mainScreen an a new Screen appears.
On this new screen is a new, empty listField.
Now I want to add some Items to this listField, i tried this method, but i still get some errors like "sourcecode is not availeble"
So here some peaces of my source:
Code:
// ----- MAINSCREEN ---
_menuItem= new MenuItem("MyItem", 100000, 10) {
public void run(){
_anforderung = new anforderung();
_anforderung.makeScreen();
}
};
// -------------- NEW CLASS -------------
package OrdnerApp;
import java.io.*;
import ....
public class anforderung {
public MainScreen myScreen;
public int makeScreen() {
myScreen = new MainScreen();
String fieldOne = new String("Zeile 1");
String fieldTwo = new String("Zeile 2");
ListField myList = new ListField();
ListCallback myCallback = new ListCallback();
myList.setCallback(myCallback);
myList.insert(0);
myList.insert(1);
myList.insert(2);
myCallback.insert(fieldOne,0);
myCallback.insert(fieldTwo,1);
myCallback.insert(fieldOne,2);
myScreen.add(myList);
myScreen.setTitle("Test");
UiApplication.getUiApplication().pushScreen(myScreen);
return 0;
}
}
So how can i simply add some Items to this listField? I looked in the manule for some examples but if i tried them out there were alwasy the same errors like now, so please help me !!
thanks hibbert