List Info

Thread: Extending XMLMenuModel




Extending XMLMenuModel
user name
2007-10-08 09:54:01
Hi.

Is there an example of subject ?

I'm currently trying to make an extended implementation that
dynamically 
generates the configuration needed for navigation according
to the 
documentation on the web-site  
http://myfaces.apache.org/trinidad/devguide/xmlMenu
Model.html

When looking at the XMLMenuModel implementation it seems
that all that are 
needed is to override the getStream() method, correct ?

But the method is never called - e.g.

 public class MyImpl extends XMLMenuModel

    public InputStream getStream() {
        System.out.println("This is never
shown");
        return myIS;
    }

resulting in a NPE:
java.lang.NullPointerException
	at 
org.apache.myfaces.trinidad.model.BaseMenuModel.setRowKey(Ba
seMenuModel.java:120)
	at 
org.apache.myfaces.trinidad.component.UIXNavigationHierarchy
.createCollectionModel(UIXNavigationHierarchy.java:53)
	at 
org.apache.myfaces.trinidad.component.UIXCollection._flushCa
chedModel(UIXCollection.java:1148)
	at 
org.apache.myfaces.trinidad.component.UIXCollection.encodeBe
gin(UIXCollection.java:513)
	at 
org.apache.myfaces.trinidad.component.UIXComponentBase.__enc
odeRecursive(UIXComponentBase.java:1271)
	at 
org.apache.myfaces.trinidad.component.UIXComponentBase.encod
eAll(UIXComponentBase.java:769)
	at
javax.faces.component.UIComponent.encodeAll(UIComponent.java
:943)
	at
javax.faces.component.UIComponent.encodeAll(UIComponent.java
:943)
	at
javax.faces.component.UIComponent.encodeAll(UIComponent.java
:943)
	at 
com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHa
ndler.java:592)
	at 
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderRe
sponsePhase.java:110)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
	at
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.j
ava:139)
	at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:26
6)


I'm using Trinidad-1.2.2 btw - and only have one instance of
the bean on my 
page.

Also is there an official XSD for the configuration ?

Any pointers would be great.

TIA
 Jesper

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )