adminfaces / admin-template Goto Github PK
View Code? Open in Web Editor NEWJSF responsive admin template based on Bootstrap and AdminLTE
Home Page: https://adminfaces.github.io/docs/latest/#admin_template
License: MIT License
JSF responsive admin template based on Bootstrap and AdminLTE
Home Page: https://adminfaces.github.io/docs/latest/#admin_template
License: MIT License
Admin Boot does not work with mojarra 2.3.4.
Please look discussion here about how to solve it.
Submitting button does not work. Ajax fails.
Ajax does not work.
java -jar target/admin-boot-3.1.2-SNAPSHOT.jar
Since the PrimeFaces Update to Version 6.2 the autoUpdate
attributes of components are deprecated. The new tag <p:autoUpdate>
should be used.
Annoying warnings in the logs on each partial update:
INFO [org.primefaces.component.messages.MessagesRenderer] (default task-50) autoUpdate attribute is deprecated and will be removed in a future version, use p:autoUpdate component instead.
Correct usage of <p:autoUpdate>
tag without info message.
Fire any kind of partial update to the page, resulting in the <p:messages>
tag inside admin.xhtml
or admin-top.xhtml
being executed.
A sample project or code may help. Can it be reproduced in admin-starter?
When going to access denied page using ajax, e.g:
<p:commandButton value="Ajax Submit" id="ajax" update="growl" ignoreAutoUpdate="true"
actionListener="#{buttonMB.buttonAction}" styleClass="btn-default btn-block"/>
Bean call:
public void buttonAction(ActionEvent actionEvent) {
if(1==1) {
throw new AccessDeniedException("access denied");
}
addMessage("Welcome to AdminFaces!!");
}
Then page footer is bigger than usual:
Currently the template skin is fixed as blue and changing it involves setting a property in a bean on application startup.
Default skin should be confugured via properties files.
I need customize header and sidebar or remove that in same pages.
Today admin-template let insert code before and after but not replace all code of menu and sidebar.
I expected remove thats parts and insert any other code to customize.
Use JUL to simplify classpath
Currently when no extension is passed to breadCrumb component, e.g: <adm:breadcrumb title="Car list" link="car-form"/>
, it is using .xhml as sufix, see here.
Use adminConfig indexPage attribute to find out what the suffix is.
I am trying the template. It seems to be a promising thing. I am stuck on how to make it work with shiro filter which is already configured. I want authorisation with roles. If it can work without shiro its okay as long as I can allow designated pages according to roles without configuring anything on the sever
Currently the left menu is not showing on hover when colapsed, see gif:
The expected behavior is to show menu itens on hover:
The below css rule works as a workaround:
body ul.sidebar-menu>li {
overflow:visible;
}
It was changed to overflow hidden in newer versions because of ripple/waves effect integration.
In some cases a user don't need to be logged in to access a page, e.g a registration page.
Currently to achieve such behavior we need to detect which pages user is accessing and then tell AdminSession that user is logged in, example:
@Named
@SessionScoped
@Specializes
public class LogonMB extends AdminSession implements Serializable {
@Override
public boolean isLoggedIn() {
return currentUser != null || Faces.getViewId().endsWith("registration.xhtml");
}
Note that when isLoggedIn is true adminfaces will NOT redirect user to logon page.
When a pages is under APP-CONTEXT/public/ directory AdminFilter will NOT try to redirect user to logon page.
Currently we have a LogoutMB but a servlet would be easier to call, for example admin-starter-shiro uses this logout servlet, as it is generic we could put it in admin-template.
Use /admin-logout
as pattern to avoid conflict issues.
When browser saves values on forms and user visits a page with pre filled values labels should float, see image:
Note that for input type password there is a bug on chrome, see this stackoverflow answer and chrome issue
Users may specify loading image in admin-config.properties
:
admin.loadingImage=ajaxloadingbar.gif
Using extensionless URLs results in the suffix .xhtml
being appended to links generated by the breadcrumb navigation when the link
attribute is not used. This is due to the usage of the viewId
from JSFs view root.
When using extensionless URLs (using OmniFaces or OCPSoft Rewrite) the Breadcrumb navigation will use the viewId
(before it has been rewritten) including the configured extension (such as .xhtml
). For example, if the URL /dashboard
was accessed, and after that the url /otherDashboard
the breadcrumb navigation will contain a link to dashboard.xhtml
.
The suffix .xhtml
is not automatically appended when using the Breadcrumb navigation and no link
attribute is given (for example using a new config property automatically removing the .xhtml
extension).
Configure extensionless URLs using OmniFaces or OCPSoft Rewrite rules, so that the JSF pages are reachable without .jsf
or .xhtml
extensions.
A sample project or code may help. Can it be reproduced in admin-starter?
Provide explicit links using the link
attribute.
Use slideout.js to make it possible to open left menu via touch events on mobile devices
It must be backyard compatible with PF 5 and greater.
A seta do combo não fica legal quando uso "p:selectCheckboxMenu"
<h:form prependId="false" id="formTarefas">
<div class="ui-g ui-fluid">
<div class="ui-g-3">
<h:outputLabel for="usuarioFiltro" value="Usuários:" />
<p:selectCheckboxMenu id="usuarioFiltro"
value="#{tarefaPortalBean.userSelecionado}" label="Usuários"
multiple="true" filter="true" filterMatchMode="startsWith"
panelStyle="width:250px"
converter="omnifaces.SelectItemsConverter">
<f:selectItems value="#{tarefaPortalBean.usuarios}" var="u"
itemLabel="#{u.name}" itemValue="#{u}" />
</p:selectCheckboxMenu>
</div>
</div>
</form>
Outra coisa que acontece é quando marco alguns itens e depois desmarco todos
No bean, nos valores seleionados fica vazio, mas visualmente não limpa a seleção
When on mobile device/small screen and side menu is open and user clicks on page body the menu is collapsed. After that menu slideout stop working.
It would be great to minimize the effort for creating breadcrumbs if the title of the page equals the title of the breadcrumb and the title is not a complex mixture of HTML elements.
Specify the title of the page using <ui:define name="title">My title</ui:define>
and specify the title of the breadcrumb via <adm:breadcrumb title="My title" />
.
Specify the title of the page using a generic param <ui:param name="title" value="My title" />
that is both used for the page title and the breadcrumb title.
This should be configurable using an admin configuration.
Currently we can only disable slideout integration for the whole application, make it possible to disable via ui:param, example:
<ui:define name="head-end">
<ui:param name="enableSlideMenu" value="false"/>
</ui:define>
Rename property theme to skin in SkinMB as it represent a skin and not a theme.
I have configured a realm and a security constraint in web.xml, in conjunction with AdminSession specialization bean. But the template saves the 403.xhml page as redirect url after login.
after login, redirects to 403.xhtml if the requested url is protected under a security-constraint
after login, must redirect to the correct requested url.
A sample xhtml code may help, ex:
web.xml
<security-constraint>
<display-name>all</display-name>
<web-resource-collection>
<web-resource-name>Config</web-resource-name>
<url-pattern>/config/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
LoginManager
@Named("loginManager")
@SessionScoped
@Specializes
public class AdminSessionImpl extends AdminSession implements Serializable {
private String username;
private String password;
private boolean loggedIn = false;
@Override
public boolean isLoggedIn() {
return loggedIn;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public void login() throws IOException {
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
try {
request.login(username, password);
loggedIn = true;
Faces.redirect("index.xhtml");
}
catch (ServletException e) {
loggedIn = false;
String loginErrorMessage = e.getLocalizedMessage();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(loginErrorMessage));
}
finally {
password = null;
}
}
public void logout() throws IOException {
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
externalContext.invalidateSession();
Faces.redirect("login.xhtml");
}
}
Users can set date format in admin-config which sets the format for error page, by default it uses US format:
admin.dateFormat=MM/dd/yyyy HH:mm:ss
change default to blank:
admin.dateFormat=
and when no format is provided then use JVM defaults.
RC12
Moved issue from starter project:
Hello, first of all, nice job! It's really useful!
Side menu items simply disappears when browser is resized to minimum width:
You can test it resizing browser until menu gets in hiden state.
When using theme to avoid caching issues there is no way to know in before hand where ajaxloading gif is because its being loaded from images dir in theme library:
<p:graphicImage library="primefaces-admin" name="images/ajaxloadingbar.gif"/>
To align with admin-top (#11) sections change logo-lg
to logo
.
It must be in a backward compatible way.
Enable auto show navbar when user scrolls to top so it is easier to access menu on mobile devices. See example here.
Tell us briefly what the problem is about.
Less padding
https://github.com/adminfaces/admin-starter/blob/master/src/main/webapp/car-form.xhtml#L25
<p:commandButton value="Save" action="#{carFormMB.save}" update="@form"
icon="fa fa-check" styleClass="btn-primary"/>
<p:spacer width="5" rendered="#{carFormMB.isNew()}"/>
<p:commandButton value="Clear" action="#{carFormMB.clear}" process="@this"
icon="fa fa-refresh" styleClass="btn-success"
update="@form" rendered="#{carFormMB.isNew()}" resetValues="true"/>```
Mouse hover over oneMenu items not visually shown.
When hover with your mouse over an oneMenu the entry is not highlighted.
When hover with your mouse over an oneMenu the entry should be highlighted.
reference https://www.primefaces.org/showcase/ui/input/oneMenu.xhtml
https://adminfaces-rpestano.rhcloud.com/showcase/pages/form/forms.xhtml
see https://webmshare.com/1MoqV
Print admin theme version on application startup
With the addition of title
ui:param to automatically render breadCrumb and page title (see #50) now the title is being rendered on error page
No title in error page.
Create a page with title param:
<ui:define name="body-begin">
<ui:param name="title" value="Car listing"/> <!-- Automatic create breadCrumb and page title when param 'title' is provided. -->
</ui:define>
And throw an unexpected exception (a non catched exception) on this page.
Currently only pages under /public folder are ignored in AdminFilter. Make it configurable via admin-config.properties.
Hi!
I have opened the following page.
https://localhost:8443/gebaeude/pages/gebaeude_list. xhtml
If the session dropped, I will be redirected to the login page. The last current page is saved to be redirected after login. Unfortunately, the URL is stored incorrectly if there is a subfolder
I will be redirected to the following URL.
URL at login.
https://localhost:8443/gebaeude/login.xhtml?page=%2Fpages_list. xhtml
URL after login.
https://localhost:8443/gebaeude/pages_list. xhtml
Redirect to the correct page after a login.
https://localhost:8443/gebaeude/pages/gebaeude_list.xhtml
Add support for AdminLTE top nav layout: https://almsaeedstudio.com/themes/AdminLTE/pages/layout/top-nav.html
I have tried running the project from a Spring boot application using JoinFaces and I am getting:
java.lang.ExceptionInInitializerError: null
at org.omnifaces.application.OmniApplication.(OmniApplication.java:69) ~[omnifaces-2.1.jar:2.1]
at org.omnifaces.application.OmniApplicationFactory.createOmniApplication(OmniApplicationFactory.java:89) ~[omnifaces-2.1.jar:2.1]
at org.omnifaces.application.OmniApplicationFactory.getApplication(OmniApplicationFactory.java:54) ~[omnifaces-2.1.jar:2.1]
at com.sun.faces.application.InjectionApplicationFactory.getApplication(InjectionApplicationFactory.java:93) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:142) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.lifecycle.ClientWindowFactoryImpl.(ClientWindowFactoryImpl.java:62) ~[javax.faces-2.2.14.jar:2.2.14]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_112]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_112]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_112]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_112]
at java.lang.Class.newInstance(Class.java:442) ~[na:1.8.0_112]
at javax.faces.FactoryFinderInstance.getImplGivenPreviousImpl(FactoryFinderInstance.java:405) ~[javax.faces-2.2.14.jar:2.2.14]
at javax.faces.FactoryFinderInstance.getImplementationInstance(FactoryFinderInstance.java:251) ~[javax.faces-2.2.14.jar:2.2.14]
at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:543) ~[javax.faces-2.2.14.jar:2.2.14]
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:283) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:328) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:236) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:439) ~[javax.faces-2.2.14.jar:2.2.14]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227) ~[javax.faces-2.2.14.jar:2.2.14]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4743) [tomcat-embed-core-8.5.14.jar:8.5.14]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207) [tomcat-embed-core-8.5.14.jar:8.5.14]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.14.jar:8.5.14]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) [tomcat-embed-core-8.5.14.jar:8.5.14]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [tomcat-embed-core-8.5.14.jar:8.5.14]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_112]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]
Caused by: java.lang.IllegalStateException: CDI BeanManager instance is not available in JNDI.
at org.omnifaces.config.BeanManager.(BeanManager.java:99) ~[omnifaces-2.1.jar:2.1]
at org.omnifaces.config.BeanManager.(BeanManager.java:49) ~[omnifaces-2.1.jar:2.1]
... 28 common frames omitted
Caused by: java.lang.IllegalStateException: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at org.omnifaces.util.JNDI.lookup(JNDI.java:92) ~[omnifaces-2.1.jar:2.1]
at org.omnifaces.config.BeanManager.(BeanManager.java:92) ~[omnifaces-2.1.jar:2.1]
... 29 common frames omitted
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662) ~[na:1.8.0_112]
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313) ~[na:1.8.0_112]
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:350) ~[na:1.8.0_112]
at javax.naming.InitialContext.lookup(InitialContext.java:417) ~[na:1.8.0_112]
at org.omnifaces.util.JNDI.lookup(JNDI.java:88) ~[omnifaces-2.1.jar:2.1]
... 30 common frames omitted
#####
Issue Overview
The expanded menus in the left side keep auto closing after using an ajax call from Primefaces.
Everytime I call an Ajax from PrimeFaces the Menus in the left side start to close everytime I try to open then. (The command p:ajax and p:poll are causing the problem.)
Version: RC9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.