Within a control object the portlet object is stored in a member variable called this.portlet.
The portlet object contains some information about the current application.
The following events are managed by the portlet object:
To add an event you have to call this.portlet.AddLocalEvent(ident, callbackfunction). this of the callback function is the portlet object.
Example:
var id = this.id;
this.portlet.AddLocalEvent(FSCEVT.LOAD, function() {
var elem =
window.document.getElementById("MyControlContainer"+id+this.GetId());
elem.style.backgroundColor = "blue";
});
If your control is the only one in the portlet and you want it to use all available space and resize automatically you can do this by calling the following code in the render function.
if (this.portlet.IsSingleControl()) {
this.portlet.SetResizeArea(“MyControlContainer”+this.id);
}
this.portlet.SetResizeArea expects the ID (excluding the portlet ID) of the HTML element which should be resized as parameter.
<div id="MyControlContainer0_01234" class="FscMyControl">
<!-- control html -->
</div>
The CSS class of the resize container could look like this:
DIV.FscMyControl
{
height:100%;
overflow:auto;
}