×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    188

    Red face Problem in creating a command with empty level.

    I have tried with level as " ", but in the screen it's displaying as the default name of the command type. The code I have written is:
    new Command(" ", Command.OK, 0);
    In the screen it's displaying as 'OK' but I want an empty name like " ".

    Can I create a command with level as blank?If it is possible Please help me.

  2. #2
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: Problem in creating a command with empty level.

    use
    PHP Code:
    new Command(" "Command.ITEM0); 
    instead of

    PHP Code:
    new Command(" "Command.OK0); 
    Regards,
    Saurabh

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    188

    Smile Re: Problem in creating a command with empty level.

    Quote Originally Posted by ingsaurabh View Post
    use
    PHP Code:
    new Command(" "Command.ITEM0); 
    instead of

    PHP Code:
    new Command(" "Command.OK0); 
    I have wrote the same code in J2ME i.e.
    new Command(" ", Command.OK, 0);
    In emulator it is displaying as command with empty level, but in the mobile it is displaying as OK. But I want command as empty level.If and body knows about it in J2ME please help me.

  4. #4
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Problem in creating a command with empty level.

    The code you quote says tat you should use new Command(" ", Command.ITEM, 0); instead of new Command(" ", Command.OK, 0); If that does not work you should say so.

    And lease don't report posts unless you have a reason to do so, otherwise one might not pay much attention and actually delete your post.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  5. #5
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: Problem in creating a command with empty level.

    use Command.ITEM instead of Command.OK
    Regards,
    Saurabh

  6. #6
    Registered User
    Join Date
    Nov 2009
    Posts
    188

    Re: Problem in creating a command with empty level.

    But after using the Command.Item still in the device it's displaying as SELECT.

  7. #7
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: Problem in creating a command with empty level.

    Quote Originally Posted by ajitkumar26 View Post
    But after using the Command.Item still in the device it's displaying as SELECT.
    Although I never used such things so can't say whether it work or not last resort is to use
    Command.SCREEN

    Or let some more experienced members of forum comment on this
    Regards,
    Saurabh

  8. #8
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Problem in creating a command with empty level.

    SCREEN is the only option where devices are not supposed to change the label.

    Try:

    Code:
    new Command("\u00a0", Command.SCREEN, 0);
    However, I'd say that a Command with a blank label is an extremely bad idea, since you will have no idea where the device will place it, and the user won't know either. You will have an extremely non-portable UI.

    If you're using a Canvas, and you want to draw your own softkey labels, then use keyPressed() events instead of Commands. In particular, I recommend that you don't mix full-screen mode with Commands.

    Graham.

  9. #9
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Problem in creating a command with empty level.

    ajitkumar26: please don't use the pink "report abuse" button to reply to a post! If you want to reply, press the "reply" button. The "report abuse" button is only for reporting spam or offensive messages.

    You wrote:

    Iniatially I have tried with the keypressed event but the middle key is not working for the nokia devices. If any body have some idea/code please guide me
    Using Commands, you can never force a Command to map to the centre key. In normal, non-full-screen mode, Canvas softkeys do not send keyPressed() events on newer Series 60 devices. They also may not send events when a Command or CommandListener is attached (in full-screen mode).

    You can enable keyPressed() events for the centre key by adding to your JAD or JAR's MANIFEST:

    Code:
    Nokia-MIDlet-S60-Selection-Key-Compatibility: true
    This will prevent Commands from mapping to the centre key, and enable keyPressed() events.

    Graham.

  10. #10
    Registered User
    Join Date
    Nov 2009
    Posts
    188

    Re: Problem in creating a command with empty level.

    Hey grahamhughes I am so sorry. Actually I am new to this site. Thanks for your advice.
    Nokia-MIDlet-S60-Selection-Key-Compatibility: true
    Do this code work for Nokia 40 Series devices.
    Last edited by ajitkumar26; 2010-02-09 at 07:23.

  11. #11
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Problem in creating a command with empty level.

    No, it works on Series 60. I'm not sure whether 40s send a keyPressed() or not, but whatever they do, there is no way to change it.

  12. #12
    Registered User
    Join Date
    Nov 2009
    Posts
    188

    Re: Problem in creating a command with empty level.

    Actually my requirement is to pop up a high level text box from a custom defined textbox. When the control is on the custom defined textbox, If I press the middle key then I want to pop up the high level textbox. But in the device by pressing the middle key it is not working. I have tried on the Nokia Series 40 devices.If any body have any idea on this please guide me.

  13. #13
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Problem in creating a command with empty level.

    If you're using Commands, you cannot control which key will have which function. Even if you managed to find a way to do what you want on one phone, there would be no guarantee it would work on another phone.

    If you want full control, use a Canvas and keyPressed() events. However, as I said earlier, I recommend you don't mix this with Commands. The use of Commands or a CommandListener may prevent keyPressed() events.

    Graham.

  14. #14
    Registered User
    Join Date
    Nov 2009
    Posts
    188

    Re: Problem in creating a command with empty level.

    Yes, I am using the Canvas and the key pressed event also but in nokia devices the middle key is not working.

  15. #15
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Problem in creating a command with empty level.

    OK... do you have a Command or CommandListener attached to this Canvas?

Similar Threads

  1. Replies: 0
    Last Post: 2008-01-29, 12:53
  2. Problem in creating the sis using a dll file
    By amitnema in forum General Development Questions
    Replies: 3
    Last Post: 2007-12-28, 12:35
  3. Problem in build with S60 1FP
    By Manuelito_ in forum Symbian Tools & SDKs
    Replies: 14
    Last Post: 2007-09-18, 12:08
  4. Problem with an empty list
    By limaolinghu in forum Symbian User Interface
    Replies: 8
    Last Post: 2007-05-31, 08:34
  5. Problem during creating .jar file in JBuilder
    By sachinwarang in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-04-17, 15:06

Posting Permissions

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