• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

OK button in a Form

 
Ranch Hand
Posts: 79
Android Java ME Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have a form with a textfield in it. I have added 2 buttons "Get Value" & "Back". In emulator I press only once Get Value and I get the expected next screen.

But in actual phone, things are shown differently. Initially I see "Get Value" & "Back" btns. When I start typing on textfield, the btns turn to "OK" & "More" (Copy All & Paste). I press "OK" and again the "Get Value' & "Back btns appears. I press "Get Value" & then I get the results. I want to cut down this "OK" btn click or once Ok is clicked, it should fire Get Value event. My basic point is cutting down 2 clicks to 1 and getting the results.

Any idea how can I achieve the expectations. Client is getting bugged by clicking 2 times for the same. Any help is appreciated.

Thanks
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this is not possible directly with Form components as API states

The application can request that the implementation use a particular input mode when the user initiates editing of a TextField or TextBox. The input mode is a concept that exists within the user interface for text entry on a particular device. The application does not request an input mode directly, since the user interface for text entry is not standardized across devices.


You would be able to do it with Canvas if you do all the hard coding. Question is, if this is worth the effort?

If there is possibility to manipulate this behaviour I would like to know this too.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The basic J2ME GUI (lcdui) understands that many phones have some sort of "OK" and "Cancel" buttons as part of the primary keypad. Actually, I think my phone has 3 buttons that can be used that way. The left button is the primary, there's a button actually labelled "OK", and the right button normally brings up menus. I think some cheap phones have "OK" and "Cancel" or something like that overlaid on the "#" and "*" keys - check your keyboard.

I'm not quite sure what keyclick sequences you're using, but it doesn't sound like you're taking advantages of the J2ME button functions. I think that if you do that, it will not only save some work - and the user some keystrokes - it will also make your app more portable to other phone models.
 
Peter Miklosko
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim I'm sorry but I'm not sure how your reply fit in. What we are asking is about software issue not hardware.
Take it that form has just one TextField that is showed together with two "buttons"/Commands. As soon as I start typing in the text filed commands declared by me are replaced by default values associated with phone GUI. When I finish typing I have to press OK option and only after that I can see my 2 commands again.

Question is, if there is a way to get rid of commands provided by GUI once I start typing. I hope this explanation is better then previous one.
 
Tim Holloway
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Think of it in terms of a traditional window GUI dialog box. That's what they're imitating. Most GUIs have an option for a default (OK) button and a cancel button. However, there's also support for those of us who have frozen shoulders from too much mousing: The default/OK button is attached to the "Enter" key and the Cancel button is attached to the ESCape key.

LIke I said, most phones that have the ability run apps have something equivalent to those 2 keys, so it's not really what I'd call hardware specific.

So if you can frame your need in the same sort of terms that a dialog box works in, there's built-in support available.
 
reply
    Bookmark Topic Watch Topic
  • New Topic