Set panel size from PANEL_REF

Find and share HowTos to various installations / configurations!
4 posts • Page 1 of 1
andrea.bertorelli
Posts:33
Joined: Wed May 31, 2017 3:58 pm

Set panel size from PANEL_REF

Post by andrea.bertorelli »

Hi everyone!

I can't set the size of a panel from a PANEL_REF contained in this.
On page initialization I am normally allowed to set the page size as:

this.size(100,200);
or
setValue(this.name(),"size",100,200);

But the same thing from another object is not possible, I also tried creating functions in the panel scopelib, but also with invockemethod I was not able.


Some code examples used to try to change the panel size from a panel ref:

Code: Select all

setValue($DP_ModuleName+"."+$DP_PanelName+":paginaListTitle","size", 450, yPosition + 50);

Code: Select all

setValue("paginaListTitle","size",450, yPosition + 50);

Code: Select all

self.setSize(450, yPosition + 50);

Code: Select all

//Scopelib in main panel
public setSize(int x,int y)
{
  this.size(x,y);
}
//Code on button click in panel ref inside panel
invokeMethod("paginaListTitle","setSize", 450, yPosition + 50);
Its essential that the click on the button trigger the function that changes the panel size, and i don't want use DPEs with some dpConnect on the panel ...
Anyone have any ideas?

dbindernagel
Posts:161
Joined: Mon Feb 23, 2015 1:34 pm

Re: Set panel size from PANEL_REF

Post by dbindernagel »

Have a look at the control function "setPanelSize".

From the help:

Code: Select all

main() 
{ 
   string module = myModuleName(); 
   string panel = "Testsize"; 
   bool   fitToBounding = FALSE; 
   int    width = 100, height = 100; 
   setPanelSize(module, panel, fitToBounding, width, height); 
}

andrea.bertorelli
Posts:33
Joined: Wed May 31, 2017 3:58 pm

Re: Set panel size from PANEL_REF

Post by andrea.bertorelli »

Hello,
It works perfectly, thanks for this function, i dunno why I never got to use it!

See you soon! :D

RJM1987
Posts:11
Joined: Mon Feb 24, 2020 5:06 am

Re: Set panel size from PANEL_REF

Post by RJM1987 »

Many thanks dbinderangel, I was having the exact same problem and this has solved it! :D

It does beg the question though, why the size attribute isn't available for a panel but others (like position) are. These kind of inconsistencies make developing in OA very frustrating :?

4 posts • Page 1 of 1