I’m not sure if this is a bug.
I’m not sure if this is a bug. I have a panel on my LLX desktop, with id 65564. I wanted to get the current page within the panel, for which I need the current X position within the panel.
Script 1 errors out on line 3:
// Script 1
var panel = LL.getContainerById(65564);
alert(panel);
alert(panel.getPositionX()); // Wrapped java.lang.NullPointerException
But the following script works:
// Script 2
var panel = LL.getItemById(65564);
alert(panel.getContainer().getPositionX()); // gives me the expected values
In script 1, given that item 65564 is not itself a container, should the exception not occur in the call to getContainerById(65564)? Or perhaps getContainerById(65564) should return null instead of an object?
]]>« reddish (Previous Post)
< ![CDATA[
65564 is not the id of the container, but the id of the item (a panel) associated with some container (id unknown, but somewhere between 100 I guess).
If panel is not null in the first script, this is because containers are dynamically allocated when requested. The result is a container with 0 item and the default configuration. (such a container is not saved if not modified and does not consume resource).
]]>
< ![CDATA[
Ok Pierre Hébert, thanks for the clarification!
]]>