Hi,
SmartClient_v130p_2023-08-12_Pro
Portlet members resized() function is not getting called if the height of the member is set via the setHeight() function or if the member was resized at least once by the user.
The isolated test case is given below.
Steps to reproduce:
1. There, by default everything works correctly. If you resize the portlet, then both portletsResized() and DrawPane resized() functions are called.
2. Resize the DrawPane by dragging its border (not the portlet's border). The DrawPane resized() is called.
3. Then, resize the portlet containing the DrawPane. Notice that only the portletsResized() is getting called now.
Alternatively:
3. Uncomment this line : // member.setHeight(portlet.getHeight()-35); //this kills resizing call
Or uncomment any of the lines that call setHeight() on the DrawPane.
Notice that when resizing the portlet the DrawPane resized() function is never called.
Additionally, on the initial draw there is 50% of blank space appears below the DrawPane if its setHeight() call is not invoked.
thank you.
SmartClient_v130p_2023-08-12_Pro
Portlet members resized() function is not getting called if the height of the member is set via the setHeight() function or if the member was resized at least once by the user.
The isolated test case is given below.
Steps to reproduce:
1. There, by default everything works correctly. If you resize the portlet, then both portletsResized() and DrawPane resized() functions are called.
2. Resize the DrawPane by dragging its border (not the portlet's border). The DrawPane resized() is called.
3. Then, resize the portlet containing the DrawPane. Notice that only the portletsResized() is getting called now.
Alternatively:
3. Uncomment this line : // member.setHeight(portlet.getHeight()-35); //this kills resizing call
Or uncomment any of the lines that call setHeight() on the DrawPane.
Notice that when resizing the portlet the DrawPane resized() function is never called.
Additionally, on the initial draw there is 50% of blank space appears below the DrawPane if its setHeight() call is not invoked.
Code:
isc.defineClass("MyPortlet", "DrawPane"); isc.MyPortlet.addMethods({ redrawOnResize : true, // defaultWidth:830, defaultHeight:830, // defaultWidth:"100%", defaultHeight:"100%", canDragResize:true, //minWidth:150, minHeight:100, headerMargin:2, headerHeight:23, showEdges:true, mytext : "original", //width:"99%", height:"99%", //width:"400", height:"400", backgroundColor:"#F3FCA0", initWidget:function(){ this.Super("initWidget", arguments); this.paneProps = { drawPane: this, canDrag: true, //paneSize: this.resetSize() }; } ,resized:function(){ this.Super('resized', arguments); console.log("DrawPane resized "+this.mytext); this.paneProps.paneSize = this.resetSize(); // this.redraw(); //markForRedraw(); } ,resetSize:function(){ var offset=4,size,w = this.getInnerWidth(), h=this.getInnerHeight(); size = w; if(w>h) size=h; size -=offset; return size; } }); function createPortletToolStrip(actId){ return isc.ToolStrip.create({ height:15, members:[ isc.Label.create({ contents:"label I am: toolbar for Id"+actId }) ] }); } function addPortlets2Layout(portal, portletsArr){ for(let p=0; p<portletsArr.length; p++){ let portProps=portletsArr[p]; let portlet = isc.Portlet.create({ title: portProps.rsltId, autoDraw:false ,height: portProps.height }); portlet.addMember(createPortletToolStrip(portlet, portProps.rsltId)); if(portProps.rsltId===1){ portlet.addMember( isc.MyPortlet.create({ ID:"myPortletID", autoDraw:false, mytext : "Portlet Resized Directly!" // ,height:2*portlet.getHeight()-35 //this kills resizing call }) ); //member.setHeight(portlet.getHeight()-35); let member=portlet.getMembers()[1]; // member.setHeight(portlet.getHeight()-35); //this kills resizing call } portal.addPortlet(portlet, portProps.colNum, portProps.rowInCol); // let pr=portal.getPortlets()[p]; // let member=pr.getMembers()[1]; // if(member) member.setHeight(pr.getHeight()-55); //this kills resizing call } } var portal = isc.PortalLayout.create({ ID: "portal", width: "80%", height: "90%", preventColumnUnderflow: true, canResizePortlets: true, showColumnMenus : false, autoDraw:false, portletsResized : function () { var message = "portlets resized from Layout\n"; let portlets = this.getPortlets(); for(let p=0; p<portlets.lentgh; p++){ let member=portlets[p].getMembers()[2]; member.setHeight(portlets[p].getHeight()-35); } console.log("PortletLayout: "+message); } }); var portletsArr=[]; portletsArr[0] = {rsltId:3, height:"100%", colNum:0,rowInCol:0}; portletsArr[1] = {rsltId:1, height:400, colNum:1,rowInCol:0}; portletsArr[2] = {rsltId:2, height:400, colNum:1,rowInCol:1}; portletsArr[3] = {rsltId:4, height:400, colNum:1,rowInCol:2}; addPortlets2Layout(portal, portletsArr); portal.show(); //portal.resize();
thank you.
Comment