Reputation:
It it possible ? If so, does anyone have any example?
Thanks in advance.
Upvotes: 0
Views: 2411
Reputation: 963
In richfaces 3.3.1.SP3 was kind of boring, but I found a solution:
Maximizing rich:modalPanel:
var PAD = 30; //const
var idModalPanel = "#{idModalPanel}";
var modal = return #{rich:component(idModalPanel)};
modal.setLeft(PAD);
modal.setTop(PAD);
var width = Richfaces.getWindowSize().width - (2 * PAD);
var height = Richfaces.getWindowSize().height - (2 * PAD);
modal.getContentElement().style.width = width + "px";
modal.getContentElement().style.height = height + "px";
//Update the modal points. That's the trick!
var borders = modal.borders;
for (var i = 0; i < borders.length; i++) {
b = borders[i];
b.startDrag(b.sizer);
b.doDrag(b.id);
b.endDrag();
}
modal.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY);
Upvotes: 1
Reputation: 3748
There is Javascript API for resize popup panel in Richfaces 4.3.x.
function changePanelSize() {
var modalPanel = #{rich:component('PanelName')};
modalPanel.setLeft(200);
modalPanel.setTop(200);
modalPanel.resize(500,800);
};
Upvotes: 1
Reputation: 136
I don't think there is js API provided by richfaces for this. If you view page source you'll notice many nested div-s the modal panel consists of, and they have set size in pixels (doesn't matter the modal has autosized=true or no). May be you can adjust size of those divs, but, of course, its a bad way. (I'm using richfaces 3.3.3)
Upvotes: 0