How to change activeindex in tabMenu (morpheus component)?
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
When load a page and open menu, it shows the last menuItem, how can I change this behavior? Thanks in advance.
Senior software engineer at http://mes-view.com
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
When 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" .../>
Github Profile: https://github.com/mertsincan
-
- Posts: 2
- Joined: 02 Mar 2014, 06:18
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" .../>
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
You can use RequestContext.execute('your_JS_method') in a method of bean.
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" .../>
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest