I am trying to add the a button to title of the form when sidemenu is enabled.
public void postShow(Form f) {
Button btn = new Button(null, fetchResourceFile().getImage("add_40.png"));
btn.setUIID("TitleButton");
btn.setTextPosition(Button.TOP);
f.getTitleArea().addComponent(BorderLayout.EAST,btn);
f.getTitleArea().revalidate();
}
When code is run , you can see the form transitioning and with it the button but as soon as transition is finished the button disappears.
I have tried adding it to beforeShow as well but same thing happens.
Not sure if I am doing it correctly or if there is some other way.
Thanks