error in menu

Post Reply
queirozg96
Posts: 1
Joined: 10 Aug 2016, 15:35

11 Aug 2016, 17:13

I made the purchase layout + theme, includes all files as documentation... However, the time to access the "empty-page.xhtml" the following error appears

"org.primefaces.context.ApplicationContext.getConfig()Lorg/primefaces/config/PrimeConfiguration;"

Does anyone know how to solve it? :mrgreen: :mrgreen:

User avatar
aragorn
Posts: 3406
Joined: 29 Jun 2013, 12:38

16 Aug 2016, 11:53

I think it has been fixed for next release. https://github.com/primefaces/layouts/issues/106

For now, please change processEvent method with the following processEvent method in RioMenu.java

Code: Select all

....
@Override
    public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
        if(event instanceof PostAddToViewEvent) {
            FacesContext context = getFacesContext();
            UIViewRoot root = context.getViewRoot();
            
            boolean isPrimeConfig;
            try {
                isPrimeConfig = Class.forName("org.primefaces.config.PrimeConfiguration") != null;
            } catch (ClassNotFoundException e) {
                isPrimeConfig = false;
            }

            String[] resources = (isPrimeConfig) ? MODERN_RESOURCES : LEGACY_RESOURCES;

            for(String res : resources) {
                UIComponent component = context.getApplication().createComponent(UIOutput.COMPONENT_TYPE);
                if(res.endsWith("css"))
                    component.setRendererType("javax.faces.resource.Stylesheet");
                else if(res.endsWith("js"))
                    component.setRendererType("javax.faces.resource.Script");

                component.getAttributes().put("library", "primefaces");
                component.getAttributes().put("name", res);

                root.addComponentResource(context, component);
            }
        }
    }
....

Post Reply

Return to “Rio”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest