×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    53

    Problem mixing lowlevel & highlevel UI APIs

    I'm currently working on a midlet in which the main application screen is implemented as a subclass of Canvas. It's basically a Model/View/Controller architecture and there is a big switch statement within the canvas subclass which inspects the current controller state within the paint() method and the correct screen within the application flow is rendered.

    I've a new requirement which is to place an edit control on one of the screens. I want the user to be able to enter their UK postcode. Since subclassing Canvas requires that you write your own controls I took the easy way out by having the application put up a regular MIDP high-level Form control with a data entry TextField on it and a submit button (handled by the Form's commandlistener). The trouble is.. when the Form is dismissed and application control returns to the low level canvas the key handling seems to have become messed up.

    The keyPressed(int keyCode) method for low level key events doesn't seem to be absorbing key press events and in fact the app quits when the left key is pressed (when run in the WTK emulator.. I'm using the Sun DefaultColorPhone emulator skin). I've tried to use form.setCommandListener(null) within the commandAction callback so as to disable the high level command handling once the Form has been dismissed but to no avail. Has anyone tried this approach of mixing low and high level APIs. Failing that has anyone coded
    a data entry field for the low level Canvas API?

    --Ian

  2. #2
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: Problem mixing lowlevel & highlevel UI APIs

    Hi,
    U can use the default phone textfield for entering the text u want and then show the canvas after that.

    Thanks
    Soku

  3. #3
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    53

    Re: Problem mixing lowlevel & highlevel UI APIs

    Quote Originally Posted by soku123
    Hi,
    U can use the default phone textfield for entering the text u want and then show the canvas after that.

    Thanks
    Soku
    Hi Soku,

    This is more or less what I am doing except that I am reusing the same
    canvas instance (because it is stateful) before and after I display the
    regular MIDP TextField on a Form. I have a feeling that I need to
    create a fresh instance of Canvas after I'm finished taking input from
    the Form containing the TextField otherwise I am getting into deep
    water with event handling (at least when running the app from within the emulator.

    --Ian

  4. #4
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: Problem mixing lowlevel & highlevel UI APIs

    Hi
    i had no problems in doing so...Please post ur code so that i can understand further what your problem is.

    Thanks
    Soku

Similar Threads

  1. Java I-modeb APIs
    By irfan.khan in forum Mobile Java General
    Replies: 1
    Last Post: 2006-03-10, 13:51
  2. What is the real problem to receive data calls with Nokia TDMA cel modems?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-12-09, 09:02
  3. What is the real problem to receive data calls with Nokia TDMA cell modem?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-12-04, 16:05
  4. Replies: 0
    Last Post: 2002-12-04, 15:46
  5. PJava runtime problem within Nokia 9210, Hrlp~!
    By Nokia_Archive in forum PersonalJava
    Replies: 1
    Last Post: 2002-05-28, 13:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×