Board index JavaServer Faces General toggle <p:layoutUnit>

toggle <p:layoutUnit>

Components, Ajax Framework, Utilities and More.

Post 05 Jun 2010, 20:39

Posts: 3
How can I control toggleing on <p:layoutUnit> ?

Is there any way to collapse, expand, a <p:layoutUnit> with something like <rich:componentcontrol for="myLayoutUnit" operation="collapse" >

I need to collapse and expand some layoutUnits on onload page. Without clicking anythinig, no links, no buttons....

Post 05 Jun 2010, 22:12

Posts: 768
If you always want the p:layout collapsed when the page is loaded, the p:layout tags collapsed attribute can simply be set to true.

Post 07 Jun 2010, 12:14

Posts: 15114
Location: Cybertron

You can use the client side api, almost every PrimeFaces components has a full blown client side api you can access with widgetVar.

http://developer.yahoo.com/yui/docs/YAH ... ayout.html
http://developer.yahoo.com/yui/docs/YAH ... tUnit.html

As you see there are methods like toggle(), collapse(), resize() and more. You just need to get the layoutunit by id and call these methods from wherever you want.
PrimeFaces Lead

Post 28 Sep 2010, 05:31

Posts: 7
Hello,

Is there an example that demonstrate how to properly call a client side API on a prime faces component?
Mojarra 2.2.2 , PrimeFaces-4.0 on vFabric tc Server v2.9


Return to General