PDA

View Full Version : Dyanamically rendering Panels



urwitharup@yahoo.com
12 May 2009, 11:53 PM
Hello,

I need to render dynamically a horizantal panel. It gets rendered properly, but does not get displayed initially. If I maximize/minimize the screen, then it gets displayed.


public static void setUrherePanel() {
String currentPage = Registry.get(ApplicationInstanceConstants.CURRENT_PAGE);
GWT.log("Called", null);
String userName = Registry.get(ApplicationInstanceConstants.USERNAME);
HorizontalPanel urherePanel = Registry.get(ApplicationInstanceConstants.URHERE_PANEL);

urherePanel.removeAll();
String urhereTxt = "";
String path = "";

Text startTxt = new Text();
Text mktSegPage = new Text(LabelMapper.getInstance().getMnemonic("BROWSEPRODUCT_BROWSESEGMENT"));
Text proCatPage = new Text(LabelMapper.getInstance().getMnemonic("BROWSEPRODUCT_BROWSECATEGORY"));
/*
Text proPage = new Text(LabelMapper.getInstance().getMnemonic(""));
Text myAccPage = new Text(LabelMapper.getInstance().getMnemonic(""));
Text updateAccPage = new Text(LabelMapper.getInstance().getMnemonic(""));
Text myCartPage = new Text(LabelMapper.getInstance().getMnemonic(""));
*/

if (userName != null)
urhereTxt = LabelMapper.getInstance().getMnemonic("WELCOMETEXT")
+ " " + userName + " , " + LabelMapper.getInstance().getMnemonic("YOU_ARE_HERE") + " ";
else
urhereTxt = LabelMapper.getInstance().getMnemonic("YOU_ARE_HERE") + " ";

startTxt.setText(urhereTxt);
urherePanel.add(startTxt);




if (currentPage
.equalsIgnoreCase(ApplicationInstanceConstants.MKT_SEG_PAGE)) {
urherePanel.add(mktSegPage);
GWT.log("mktseg", null);

} else if (currentPage
.equalsIgnoreCase(ApplicationInstanceConstants.PRO_CAT_PAGE)) {
GWT.log("procat", null);
urherePanel.add(mktSegPage);
urherePanel.add(proCatPage);

} else if (currentPage
.equalsIgnoreCase(ApplicationInstanceConstants.MYACC_PAGE)) {

}


}

Regards
Arup

sven
13 May 2009, 3:31 AM
You need to call layout after adding the panel.