Hi,
On our left sidebar menu, we would like to add an icon that does not have a fly-out of subitems. Rather, when the user clicks on the main icon, they are taken directly to an URL within the application.
I've tried various options, but not getting anywhere.
Is this possible?
Thanks!
Dave
Left Sidebar Icon with Direct URL
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.
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
I'll check and get back to you.
Regards,
Regards,
Github Profile: https://github.com/mertsincan
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
This structure isn't supported by pa:tab component. But, you can make the following changes in your project;
Code: Select all
//TabMenuRenderer.java
for(UIComponent child : children ){
if(child.isRendered() && child instanceof Tab) {
Tab tab = (Tab) child;
writer.startElement("li", tab);
writer.startElement("a", tab);
/************* Please make the following changes (line 35) ********/
if(tab.getUrl() != null) {
writer.writeAttribute("href", tab.getUrl(), null);
}
else {
writer.writeAttribute("href", "#", null);
}
/*****************************************************************/
writer.writeAttribute("class", "ripplelink tabmenuitem-link", null);
....
//primefaces-barcelona.taglib.xml
<attribute> /* Line 96 */
<description></description>
<name>url</name>
<required>false</required>
<type>java.lang.String</type>
</attribute>
//Tab.java
public enum PropertyKeys {
icon,
url, /* Added this line */
title;
...
}
public java.lang.String getUrl() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.url, null);
}
public void setUrl(java.lang.String _url) {
getStateHelper().put(PropertyKeys.url, _url);
}
...
// layout.js
this.tabMenuNavLinks.on('click', function(e) {
$this.sidebar.css('overflow','hidden');
var link = $(this);
link.parent().addClass('active-item').siblings('.active-item').removeClass('active-item');
/***************** line 60 ***********/
var href = link.attr('href');
if(href && href !== '#') {
window.location.href = href;
return;
}
/**********************************/
$this.wrapper.addClass('layout-wrapper-menu-active');
...
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests