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
New Developer
Posts: 84
Registered: ‎01-28-2009
My Device: Not Specified
Accepted Solution

Regarding UI Manager

I am not able to use the proper manager for displaying the fields like below:

 

Labelname1 : EditField1

Labelname2 : Editfield2

 

Below is my coding, if any modificaton or suggestion do reply:

 

final class ManagerScreen extends MainScreen
{
    public ManagerScreen()
    {
    
     LabelField lf1 = new LabelField("Search",EditField.FIELD_HCENTER);
     add(lf1);
    
     LabelField lf2 = new LabelField(" City : ",EditField.FIELD_RIGHT);
     EditField ef2 = new EditField("","",6,EditField.NO_NEWLINE);
    
     LabelField lf3 = new LabelField(" Name : ",EditField.FIELD_RIGHT);
     EditField ef3 = new EditField("","",6,EditField.NO_NEWLINE);
 
    
     //HorizontalFieldManager ffm = new HorizontalFieldManager();
     FlowFieldManager ffm = new FlowFieldManager();
     ffm.add(lf2);
     ffm.add(ef2);
     ffm.add(lf3);
     ffm.add(ef3);
    
     add(ffm);
       
    }

 

 

Thanks

Nimesh

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Regarding UI Manager

Add EditFields with lable added to the constructor.

 

BasicEditField eField1 = new BasicEditField("Label1: ","");
BasicEditField eField2 = new BasicEditField("Label2: ","");
add(eField1);
add(eField2);


Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 84
Registered: ‎01-28-2009
My Device: Not Specified

Re: Regarding UI Manager

Thanks for your suggestion. There is one more addition to my question, " what if I need an image in same row i.e icon, label, edit field and button."

 

Regards.

Nimesh.

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Regarding UI Manager

usually a horizontalfieldmanager does exactly what you want. the only thing you have to pay attention to is that there are some fields, like editfield and similar, that use the whole width. labelfield does not show this behaviour, adding a labelfield and an editfield to a hfm should work, the other way around (with the editfield first) would need some tampering.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Regarding UI Manager

You can try using setting the subLayout of Manager and set the position of the Childs using setPositionChild.

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 84
Registered: ‎01-28-2009
My Device: Not Specified

Re: Regarding UI Manager

 

Thanks for you suggestion.

I have tried it by hfm, but it does not show me in proper way. It shows me labelfield and then in the next line Editfield. 

When I use FlowFieldManager the same problem repeats. Is there any other way or I have to make custombutton.

 

There is one more addition to my question, " what if I need an image in same row i.e icon, label, edit field and button."

 

Regards.

Nimesh

New Developer
Posts: 84
Registered: ‎01-28-2009
My Device: Not Specified

Re: Regarding UI Manager

Thanks for your reply.

But the problem that occurs with the setPositionChild() is that it changes with the different screen's height and width so we can't assign fields to particular fixed position, because  I am workng on BB 9000 & 8220 simulator. So plz provide me solution regarding FlowFieldManager.

 

Regards,

Nimesh

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Regarding UI Manager

Check the accepted solution, modifying a bit in that you can put your LableField, EditField and Button Field.

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=14219&query.id=27...

 

 


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 57
Registered: ‎01-29-2009
My Device: Not Specified

Re: Regarding UI Manager

If you don't want to use setPosition() then you can use FlowLayoutmanager with the needed length.

U can override the paint() function to field.

New Developer
Posts: 84
Registered: ‎01-28-2009
My Device: Not Specified

Re: Regarding UI Manager

Thanks for your feedback.

But if I want to use Manager only then is there any way to give the position of the Fields in a raw.

 

Thank You.

Nimesh