PDA

View Full Version : how set a new height for a portlet



fother
16 Jul 2009, 5:44 AM
how I can set a new height for a portlet..
the code below work.. but isnt the better solution.. any ideia?



final Portal portal = new Portal(5);
portal.setAjustForScroll(false);
portal.setSpacing(5);
portal.setStyleAttribute("backgroundColor", "white");
portal.setColumnWidth(0, .28);
portal.setColumnWidth(1, .18);
portal.setColumnWidth(2, .18);
portal.setColumnWidth(3, .18);
portal.setColumnWidth(4, .18);
portal.setStyleAttribute("padding", "0px 0px 0px 10px");

Image a = new Image();
a.setUrl("http://www.google.com.br/images/nav_logo6.png");

final Portlet x = new Portlet();
x.setHeading("1");
x.add(a);
x.setAutoHeight(true);
portal.add(x, 1);

Portlet x1 = new Portlet();
x1.setHeading("2");
x1.setAutoHeight(true);
portal.add(x1, 1);

Portlet x11 = new Portlet();
x11.setHeading("3");
x11.setAutoHeight(true);
portal.add(x11, 1);

Button btn = new Button("set new height", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
x.el().setHeight(700);
}
});

RootPanel.get().add(btn);
RootPanel.get().add(portal);

fother
16 Jul 2009, 5:48 AM
using the code below work better, but........



Button btn = new Button("set new height", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
x.getItem(0).setHeight("700px");
}
});