Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
New Developer
Posts: 2
Registered: ‎11-11-2009
My Device: Not Specified

Multiline custom EditField

Hi.

 

I am using JDE 4.2.1 with BB 8800 simulator.

 

The documentation for EditField says: "If the contents occupy more than one line the text will flow around the label".

I am creating a custom field extending the EditField and i want to provide the above mentioned feature. When entering text, after reaching the end of line i want to increase the height of my field, thus providing a new line to display the text. This would obviously move any other field placed below my custom field one line down.

 

This is what i have tried:

When the text being typed in reachs the end of the screen i tried to call my over-ridden layout method which in turn calls the setExtent method to increase the height of my custom field but this does not increase the height.

 

protected void layout(int width, int height)
{
        
        if(height>500)//layout called during initialization sets the height to 50, ie 2 lines.
            setExtent(screenWidth,50);
        else
        {
           //the below setExtent method does not cause any change to my custom field during runtime.
            setExtent(screenWidth,height);
        }

}

 

Any tips or advices will be greatly appreciated.

Regards,

hellcry.

New Developer
Posts: 2
Registered: ‎11-11-2009
My Device: Not Specified

Re: Multiline custom EditField

bump

Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: Multiline custom EditField

Hi,

 

Have a look at this thread this should help you in solving the issue

 

 

http://na.blackberry.com/eng/devjournals/resources/journals/jul_2005/creating_textbox_field.jsp

 

If you still find any problem then let me know.

 

Regards,

Rajat Gupta.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish