Dynamic Editfield - blackberry

I have EditField and use background image..i want to create dynamic EditField
so i want to dynamic height EditFieldbut fix width

Take a look at http://us.blackberry.com/devjournals/resources/journals/jul_2005/creating_textbox_field.jsp, it provides details on creating one.

Related

Adjusting Vaadin grid height

I am trying to add multiple Vaadin grids of different sizes inside a VerticalLayout container.
public class Overview extends VerticalLayout {
Grid<DataTable1> grid1 = new Grid<>();
Grid<DataTable12> grid2 = new Grid<>();
Grid<DataTable13> grid3 = new Grid<>();
}
So far, each grid is taking up an equal amount of vertical space, as shown in the image below.
grids taking equal vertical space
However, I would like to show the grid as shown in the image below where the height gets dynamically adjusted as per the number of rows and cloumns:
desired grids
Is there any way I can adjust the individual grid height?
So far I have found a way to adjust the row height not the height of the whole grid itself.
Thank you!
Sounds like you might be looking to achieve dynamic height based on the number of rows, which can be done using setAllRowsVisible(true): https://vaadin.com/docs/latest/components/grid/#dynamic-height
The Grid, like all components that implement HasSize, has a method setHeight()

Adjust BitmapFields Width in HorizontalFieldManager according device width

I am new in BB development,
Please suggest me how i can adjust BitmapFields Width which are in HorizontalFieldManager
to adjust it in Device width.
I am overriding Sublayout method to get this
Now it look like this....I am getting expected o/p for Simulator 9550
Thanks
Create a customBitmapField class which extends BitmapField. Override getPreferredWidth() method and return (Display.getWidth()/3) so the bitmapfield takes up a third of the device display. you will have to handle how it looks in smaller devices as well as the text might not fit.
you can use the PillButtonSet component, you can find it in the advanced UI package.
see here: Advanced UI

How to increase horizontalfieldmanager height dynamically in Blackberry?

I have added RichTextField to HorizontalFieldManager, and I also set Background bitmap to HorizontalFieldmanager. If the richtextfield text increases the horizontalfield manager height, how can I increase height dynamically?
A HorizontalFieldManager by default will increase its size to show whatever fields you have placed inside of it.
If this is not the case then it sounds like you have overridden this behavior. Without seeing code I can only guess, E.g. by using a static height or width in the sublayout.

Layout fields with no margin between them on BlackBerry

How do I prevent extra space between two fields:
VerticalFieldManager _fieldManagerMiddle =
new VerticalFieldManager(Manager.VERTICAL_SCROLL);
LabelField field = new LabelField("Title");
CustomFieldList list = new CustomFieldList ();
_fieldManagerMiddle.add(field);
_fieldManagerMiddle.add(list);
To manage the space between two managers you can try negative VerticalFieldManager and HorizontalFieldManager.
Have you tried setting the margin to zero? Margin is just a property on the field, but managers use it to decide the minimum space between two fields during layout.
field.setMargin(0,0,0,0);
list.setMargin(0,0,0,0);
You can create custom manager .
inside the sublayout method you can position the contents as per your requirement and choice

Multiple buttons with same width equal to widest button

I have multiple ButtonFields in a VerticalFieldManager. By default the width of each button depends on the text it contains.
I would like all the buttons to be of the same width - equal to the width of the widest button.
Take a look at the BlackBerry Developers Knowledge Base:
How to - Implement advanced buttons, fields, and managers
Last Updated: 12 February 2010
Article Number: DB-00796
You are probably looking for the VerticalButtonFieldSet!
Step 1 - Extend the VerticalFieldManager class, and make the constructor take in a bunch of Strings that you want to put end each button.
Step 2 - Find the longest of String out of the Strings passed into the manager.
Step 3 - create the button for the longest string
Step 4 - create all other buttons, and set their width to the same as the 1st (see setExtent)
Step 5 - add the buttons to the manager in the order you want them to appear
FIN
Have you tried using the Field.USE_ALL_WIDTH style flag?
Try ButtonField buttonField = new ButtonField("ButtonText", Field.USE_ALL_WIDTH);
and that should use the full width.
If that doesn't work, try extending ButtonField, overriding layout and calling setExtent(width, height) with the width and height that you want.

Resources