PDA

View Full Version : Force pinned portlet as the first/top portlet



MickeyMiner
24 Nov 2009, 2:07 AM
Hi,

I force Portlet #1 to remain on the first position [portlet.setPinned(true)], but I can take the portlet #2 and drop it at the beginning of the list. I can I forbid this? I need first portlet to remain alway in the first position.

Regards,

MickeyMiner


package de.mike.client;

import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.custom.Portal;
import com.extjs.gxt.ui.client.widget.custom.Portlet;
import com.google.gwt.user.client.Element;

public class PortalExample extends LayoutContainer {

@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);

Portal portal = new Portal(1);
portal.setBorders(true);
portal.setStyleAttribute("backgroundColor", "white");

Portlet portlet;
for (int i=1; i<5; i++){
portlet = new Portlet();
portlet.setHeading("I am portlet #"+i);
portlet.addText("Hello world: " + i);
portlet.setPinned(i==1);
portlet.setWidth(200);
portal.add(portlet, 0);

}
add(portal);
}

}