How to change activeindex in tabMenu (morpheus component)?
Posted: 23 Feb 2017, 11:39
When load a page and open menu, it shows the last menuItem, how can I change this behavior? Thanks in advance.
Code: Select all
//menu.xhtml
<script type="text/javascript">
$(document).ready(function(){
var $this = PF('me');
if($this) {
$this.clearMenuState();
$this.clearActiveItems();
}
});
</script>
...
<pm:menu widgetVar="me" .../>
I tried this solution, but nothing happen...have anyway to make it in Managed Beans?aragorn wrote: ↑07 Mar 2017, 11:50When you click an item, we add its id to cookie whose name is "morpheus_expandeditems". Maybe, you can use clearMenuState and clearActiveItems methods or add id of an item to cookie with addMenuitem(id). Exp;Code: Select all
//menu.xhtml <script type="text/javascript"> $(document).ready(function(){ var $this = PF('me'); if($this) { $this.clearMenuState(); $this.clearActiveItems(); } }); </script> ... <pm:menu widgetVar="me" .../>
Code: Select all
//bean
RequestContext.getCurrentInstance().execute("clearState");
//xhtml
<script type="text/javascript">
function clearState() {
var $this = PF('me');
if($this) {
$this.clearMenuState();
$this.clearActiveItems();
}
};
</script>
<pm:menu widgetVar="me" .../>