Integrating Shale with Ajax4JSF

2007-11-04 Thread Dominik Böhm

Hello,

I tried vainly to use Shale 1.0.4 with Ajax4JSF. When I put some ajax 
component onto my page and try to open it, I receive a NullPointerException:


javax.servlet.ServletException
   javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
   
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)

   org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
   org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
   
de.uni_muenster.easy.web.filters.SecurityFilter.doFilter(SecurityFilter.java:48)
   
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:267)
   
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


java.lang.NullPointerException
   
org.ajax4jsf.renderkit.AjaxRendererUtils.buildAjaxFunction(AjaxRendererUtils.java:390)
   
org.ajax4jsf.renderkit.html.AjaxFormRenderer.doEncodeBegin(AjaxFormRenderer.java:131)

   org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:101)
   
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)

   javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
   javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
   
com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
   
org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
   
org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:243)
   
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)

   com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
   com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
   javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
   
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)

   org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
   org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
   
de.uni_muenster.easy.web.filters.SecurityFilter.doFilter(SecurityFilter.java:48)
   
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:267)
   
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)



The reason is that Ajax4JSF relies on the fact that either 
facesContext.getViewRoot() is an AjaxViewRoot container or that the 
ajaxForm's parent (or grand parent and so on) is an AjaxViewRoot. But 
using Shale the facesContext.getViewRoot() is an instance of 
ShaleViewRoot (the form's parent is that same ShaleViewRoot object).


As this issue is not resolved with the latest 1.1.0 SNAPSHOT I would 
like to ask you kindly to give full Ajax4JSF support.


Thank you very much
Dominik


Re: Integrating Shale with Ajax4JSF

2007-11-04 Thread Dominik Böhm

Hi Lionel,

thank you, that did the trick!

Best regards
Dominik

Lionel Port schrieb:

Try wrapping your ajax code in a a4j:region tag.

On Nov 5, 2007 3:53 AM, Dominik Böhm [EMAIL PROTECTED] wrote:

  

Hello,

I tried vainly to use Shale 1.0.4 with Ajax4JSF. When I put some ajax
component onto my page and try to open it, I receive a
NullPointerException:

javax.servlet.ServletException
   javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)

org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
ExtensionsFilter.java:147)
   org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
   org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)

de.uni_muenster.easy.web.filters.SecurityFilter.doFilter(
SecurityFilter.java:48)

org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(
ShaleApplicationFilter.java:267)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
ReplyHeaderFilter.java:96)

java.lang.NullPointerException

org.ajax4jsf.renderkit.AjaxRendererUtils.buildAjaxFunction(
AjaxRendererUtils.java:390)

org.ajax4jsf.renderkit.html.AjaxFormRenderer.doEncodeBegin(
AjaxFormRenderer.java:131)
   org.ajax4jsf.renderkit.RendererBase.encodeBegin(RendererBase.java:101)

javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java
:788)
   javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
   javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)

com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java
:592)

org.ajax4jsf.application.ViewHandlerWrapper.renderView(
ViewHandlerWrapper.java:108)

org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java
:243)

com.sun.faces.lifecycle.RenderResponsePhase.execute(
RenderResponsePhase.java:106)
   com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
   com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
   javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)

org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
ExtensionsFilter.java:147)
   org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
   org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)

de.uni_muenster.easy.web.filters.SecurityFilter.doFilter(
SecurityFilter.java:48)

org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(
ShaleApplicationFilter.java:267)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
ReplyHeaderFilter.java:96)


The reason is that Ajax4JSF relies on the fact that either
facesContext.getViewRoot() is an AjaxViewRoot container or that the
ajaxForm's parent (or grand parent and so on) is an AjaxViewRoot. But
using Shale the facesContext.getViewRoot() is an instance of
ShaleViewRoot (the form's parent is that same ShaleViewRoot object).

As this issue is not resolved with the latest 1.1.0 SNAPSHOT I would
like to ask you kindly to give full Ajax4JSF support.

Thank you very much
Dominik




  



--
Dominik Böhm
Wilhelmstr. 17
48149 Münster

Mobile +49 160 7572316
Phone +49 251 6253968
Fax +49 251 6253969
ICQ 89501619 



Using nullValue-properties with Shale Tiger

2007-10-28 Thread Dominik Böhm

Hello,

I am doing my first steps with Shale and ran into some problems with 
Shale Tiger. I think the @Property-annotation has the same semantics as 
the managed-property thing in the faces-config.xml. Main difference 
seems to be that @Property only supports non-null values whereas 
managed-property also has a subproperty null-value. I had a look at 
the ManagedPropertyConfig.class in the Tiger source code and found out 
that there actually is also a nullValue-property for Tiger-Managed 
properties. But how can I tell with a @Property annotation that I want 
that property to start with a null value? I tried the following:


1.@Property(name=newUser, value=null)
   private User newUser;

That doesn't work as java tells me that value must be a constant 
expression.


2. @Property(name=newUser, value=)
   private User newUser;

That doesn't work as shale searches for a converter from String to User 
but cannot find one. That results in a null pointer exception.


Maybe I am missing something but it seems that shale tiger is not able 
to work wih nullValue-properties if I'd like to define them using 
annotations.


I hope someone can help me find out how to use tiger here.

Thanks a lot in advance and best regards
Dominik