I am using primefaces PrimeFaces-3.4 on Mojarra-2.1.10, my full page layout is something like this. How I can make a button in the top, that will collapse west layoutUnit?
Thanks for help.
PS, early assumed that can write something like this:
<layoutUnit position="west" widgetVar='westlayout'> ... </layoutUnit>
//button in the top
<button onlick="westlayout.collapse()"></button>
But unfortunately, widgetVar attribute not existing for layoutUnit.
UPDATE 1: Found similar question, tried. Didn't worked for me, problem was that button with update attribute cannot find text with such identifier, i tried in one layoutUnit, found identifier,but didn't work too.
According to the Layout Client Side API, you can toggle your layoutUnit through layout widgetWar:
EDITED
Starting in PrimeFaces 4, id mapping is still supported but deprecated in favor of PF('XXX')
For PrimeFaces 5.0 and above, you will need to use PF widgetVar to call client side API. So instead of using layoutWdgt.toggle('west') to toggle west layout unit, you need to use PF('layoutWdgt').toggle('west')
Working with Primefaces 6.1: