×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    26

    expand a textfield to fill form

    i have 2 textfields on my form, one for entering a phone number and the other for text.

    i would like to make the textfield for text fill the form and not suspended up and grow as text grows.

    i have tried my best(tried Texfield.VEXPAND) but i see no change.

    please help.

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: expand a textfield to fill form

    Hello kemmal,

    how about using TextBoxes? -> fills the screen (but you cannot have two of them visible at the same time as TextBox is a Displayable).

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: expand a textfield to fill form

    Switch to LWUIT (Light weight UI Toolkit from SUN), and its TextArea is the solution to your problem, or go with your own Custom Item for a this type of textArea... see LWUIT demo and LWUIT API on internet.

    thanks,
    ~Amitabh

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: expand a textfield to fill form

    Quote Originally Posted by kemmal View Post
    i would like to make the textfield for text fill the form and not suspended up and grow as text grows.
    please help.
    Well why don't you scroll the text if the text length is getting more than the length of the texfield.Just start shifting the text in the opposite direction of the entered one.

    How this solution sounds to you?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Registered User
    Join Date
    Oct 2009
    Posts
    26

    Re: expand a textfield to fill form

    the textfield is unlocked by default, i.e fills the whole width but not length, as the text gets longer, the textfield's hieght justifies too and handles wrap and scrolling beautifuly...

    but i wanted its hieght locked to the screen hieght... i havent used LWUIT before, as i just need this feature, can i just extract the classes from LWUIT that provide this property? my project is already big and i thought importing libraries would make it bigger and slow to load.

    Raj, i thought of your idea when i wanted to implement this whole this on a canvas, but i couldnt get the caret navigate freely and delete any character in the textbox, my wrap implementation was poor too

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: expand a textfield to fill form

    Quote Originally Posted by kemmal View Post
    Raj, i thought of your idea when i wanted to implement this whole this on a canvas, but i couldnt get the caret navigate freely and delete any character in the textbox, my wrap implementation was poor too
    Probably we can help you if you come with much more details..Please give some more light on the need and issue you are facing..
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Oct 2009
    Posts
    26

    Re: expand a textfield to fill form

    Quote Originally Posted by raj_J2ME View Post
    Probably we can help you if you come with much more details..Please give some more light on the need and issue you are facing..
    i wanted to have a custom compose message form with a textfield and a textbox on canvas. i went along and used the code snippet here for custom text input on a canvas but couldnt get the text to scroll correctly.

    my text wraps but does not scroll and caret navigation gave me headaches. so i resorted to using the high profile. but this time i cant get to have a textfield for phone number and a textbox for composing the message on the same form, the textbox just fills the whole screen.

    then i changed to having 2 textfields, one for the phone number and the other for message, i wanted to have the texfield for the message expand, i.e fill the rest of the forms hieght, but then again am failing.

    please help.

  8. #8
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: expand a textfield to fill form

    did the canvas only suites to you for this..and not the High Level?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  9. #9
    Registered User
    Join Date
    Oct 2009
    Posts
    26

    Re: expand a textfield to fill form

    yes since i developed my whole application using the canvas, this form will only be the one using a high profile.

  10. #10
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: expand a textfield to fill form

    I do know that if you create a class deriving from CustomItem you have to actually ovverride some basic methods that all Display-ables inherit, some of those specifiy the minimum height and with of the graphic Item...
    This MIGHT mean, I'm not sure though, that you could override those specific methods of the TextField class when inheriting from it...

  11. #11
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: expand a textfield to fill form

    Quote Originally Posted by kemmal View Post
    yes since i developed my whole application using the canvas, this form will only be the one using a high profile.
    Alright..
    Just take the Canvas and draw the rectangle/image for the purposes of the Texfiled. Later you can have one more rectangle/image for the shape of the texbox and draw the same below the first one.Now in order to move up and down take the int variable called as the currentSelection and increase/decrease this on the up/down keypressed.

    Now if the currentSelection is zero then you can draw some sort of selection rect/image and then user can enter the value in this rectangle shape textfield. As soon as you press the down key then you just draw the selection rectangle/image for this too and let the user enter the text in this. you keep the track of the text to break the line and if the number of the lines are going to more then the rectangle height then keep start the scrolling the lines upward and set the clip in that area only.

    I have done this thing a lots of time and worked well.Please check this if this can help you.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  12. #12
    Registered User
    Join Date
    Oct 2009
    Posts
    26

    Re: expand a textfield to fill form

    ok thanks alot Raj, i will give it a try.... wil be back if i have problems.

    I havent tried extending the Textfield but i wil give it a try if i fail implementing Raj's idea. thanks alot Tiger.

Similar Threads

  1. How to show fulltext in a label of textfield in a Form
    By kumar.modi in forum Mobile Java Tools & SDKs
    Replies: 7
    Last Post: 2010-03-05, 22:00
  2. Problem with TextField and CustomItem on the same Form
    By manmli in forum Mobile Java General
    Replies: 8
    Last Post: 2008-12-23, 13:10
  3. Form troubles
    By matdodgson in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-12-06, 10:49
  4. How to create a form, which does not fill the whole app rect?
    By madsum in forum Symbian User Interface
    Replies: 5
    Last Post: 2006-10-05, 08:00
  5. Cannot use textField after delete and insert in Form
    By andretr in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2004-08-03, 13:33

Posting Permissions

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