Hi Friend's i want to show details when i click on this list field with image(location)means u take any lat long and show with it a image map.so please help me to solve this problem.
How is it possible please help me.
Thanks
on this link show the list field i am also create like this listfiled and when i click and show details with image map
How is it possible please help me.
Thanks
Here I am giving some example try this (assign index to each field in the list view). You can display your details in NewsScreen().
protected boolean navigationClick(int status, int time) {
int index;
System.out.println("CLICKED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
index = this.getFieldWithFocusIndex();
UiApplication.getUiApplication().invokeLater(new Runnable(){
public void run() {
UiApplication.getUiApplication().pushScreen(new NewsScreen());
}
});
System.out.println("OUTPUTTTTTTTTTTTTTTT"+this.getFieldWithFocusIndex());
return true;
}
you could pass the image map String URI or bitmap byte to the other screen and show it
UiApplication.getUiApplication().invokeLater(new Runnable(){
public void run() {
UiApplication.getUiApplication().pushScreen(new NewsScreen(IMAGE MAP STRING));
}
});
Related
How can I handle event in EditText Field?.
Example: when I enter some text in EditText then what I have to do generate custom layout?
below is my screen.Does any one have idea please tell me.
try this
EditField text=new EditField()
{
protected boolean keyChar(char key, int status, int time)
{
if((int)key==10)//10 is ASCII code of "Enter" key
{
add(new LabelField("New Field"));
}
return super.keyChar(key, status, time);
}
};
add(text);
after enter all data just click on enter then new label will appear on screen
In my application there is one ObjectChoiceField in MainScreen
i want to get change Listner of ObjectChoiceField after click on index 0.
i had already get click event of ObjectChoiceField after click on index grater than 1 and so on ..
so how can i get instance click event after click on ObjectChoiceField ?
I am not really sure what you are asking for.
In your FieldChangeListener.fieldChanged() method, calling ObjectChoiceField.getSelectedIndex() tells you which index is currently selected. You can look for index 0 from that.
If that is not what you need, then you need to clarify your question better.
ObjectChoiceField choiceField = new ObjectChoiceField();
public void fieldChanged(Field field, int context) {
if(field.equals(choiceField))
{
if(choiceField.getSelectedIndex==0)
{your Code}
}
If you want the value which the user have selected you can do by this way too
ObjectChoiceField choiceField = new ObjectChoiceField();
public void fieldChanged(Field field, int context) {
if(field.equals(choiceField))
{
if(choiceField.getSelectedIndex==0)
{
int index = choiceField.getSelectedIndex();
String s = (String) objectWeather.getChoice(index);
Dialog.inform("selected value is"+s);
}
}
}
How to get selected row from blackberry objectlistfield, when user clicks on list item?
getSelectedIndex()
You will also have to set the setChangeListener() and implement the corresponding methods like fieldChanged() and keyDown()
have you read the documentation before asking ? Do you have a more specific question ?
public boolean navigationClick(int status, int time) {
Field focus = list.getLeafFieldWithFocus();
Dialog.alert("Focus String :: " + focus.getIndex());
if (focus instanceof ListField) {
ListField listField = (ListField)focus;
Dialog.alert("Selected Index"+listField.getSelectedIndex());
Dialog.alert("Selected List Value"+listField.getCallback().get(listField,
listField.getSelectedIndex()).toString());
}
return true;
}
I need to develop the blackberry application using jave (eclips), can you please help me what are the events for dropdown and how to read the value of dropdown list , i tried using getText() method but its given error, can u please give small example on dropdown list in blackberry
final String[] data = {"A", "B","C","D"};
ObjectChoiceField ocf = new ObjectChoiceField("Set your status", data);
ocf.setChangeListener(new FieldChangeListener(){
public void fieldChanged(Field field, int context) {
if(context != PROGRAMMATIC)
Dialog.alert(data[ocf.getSelectedIndex()]);
}
});
I want my BlackBerry app to open a website when I focus on its name.
Can anybody tell me how to do that?
final LabelField label = new LabelField(url,LabelField.FOCUSABLE);
label.setFocusListener(new FocusChangeListener(){
public void focusChanged(Field field, int eventType) {
if(eventType == FOCUS_GAINED){
BrowserSession bSession = Browser.getDefaultSession();
bSession.displayPage(label.getText());
}
}
});
add(label);