Second text field not showing up in horizontal field manager

559 Views Asked by At

The following doesn't show the second text field:

HorizontalFieldManager innerHfmComment = 
    new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH);

ActiveRichTextField commentField = 
    new ActiveRichTextField("Comment", Field.FOCUSABLE){};
ActiveRichTextField likeField = 
    new ActiveRichTextField("Like", Field.FOCUSABLE){};

innerHfmComment.add(commentField);
innerHfmComment.add(likeField);

I'm completely lost as to why this is the case - a similar HorizontalFieldManager can display a list of buttons just fine. Is there something special about Active Rich Text Field?

1

There are 1 best solutions below

0
On BEST ANSWER

commentField is consuming all horizontal space, which leaves none for the likeField. The HorizontalFieldManager defers to the fields to determine their size. You can try subclassing ActiveRichTextField to override the layout method, constraining it to a specific size. Or you can use a different manager that will not allow a field to consume all the space.