• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Error while using <a4j:support>

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using richfaces Ajax4Jsf tag library and getting an exception with the following code.

<h:selectOneMenu id="payperiodDates"
value="#{manageShiftSessionData.selectedPayperiodDate}"
valueChangeListener="#{manageShiftDailyDurationBean.onPayperiodDateChanged}"
><f:selectItems value="#{manageShiftSessionData.payperiodDatesItemList}" />
<a4j:support event="onchange" reRender="shiftElementsPanel"/>
</h:selectOneMenu>

However, if I don't use <a4j:support>, I don't see any errors but I need the Ajax behavior, not the total page refresh. Can someone please help me?


SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
at org.ajax4jsf.org.w3c.tidy.Node.trimInitialSpace(Node.java:946)
at org.ajax4jsf.org.w3c.tidy.Node.trimSpaces(Node.java:1012)
at org.ajax4jsf.org.w3c.tidy.ParserImpl$ParseInline.parse(ParserImpl.java:1125)
at org.ajax4jsf.org.w3c.tidy.ParserImpl.parseTag(ParserImpl.java:203)
at org.ajax4jsf.org.w3c.tidy.ParserImpl$ParseRow.parse(ParserImpl.java:3012)
at org.ajax4jsf.org.w3c.tidy.ParserImpl.parseTag(ParserImpl.java:203)
at org.ajax4jsf.org.w3c.tidy.ParserImpl$ParseRowGroup.parse(ParserImpl.java:2885)
at org.ajax4jsf.org.w3c.tidy.ParserImpl.parseTag(ParserImpl.java:203)
at org.ajax4jsf.org.w3c.tidy.ParserImpl$ParseTableTag.parse(ParserImpl.java:2629)
at org.ajax4jsf.org.w3c.tidy.ParserImpl.parseTag(ParserImpl.java:203)
at org.ajax4jsf.org.w3c.tidy.ParserImpl$ParseInline.parse(ParserImpl.java:1587)
at org.ajax4jsf.org.w3c.tidy.ParserImpl.parseTag(ParserImpl.java:203)
at org.ajax4jsf.org.w3c.tidy.ParserImpl$ParseBody.parse(ParserImpl.java:978)
at org.ajax4jsf.org.w3c.tidy.ParserImpl.parseTag(ParserImpl.java:203)
at org.ajax4jsf.org.w3c.tidy.ParserImpl$ParseHTML.parse(ParserImpl.java:486)
at org.ajax4jsf.org.w3c.tidy.ParserImpl.parseDocument(ParserImpl.java:3409)
at org.ajax4jsf.org.w3c.tidy.Tidy.parse(Tidy.java:363)
at org.ajax4jsf.org.w3c.tidy.Tidy.parse(Tidy.java:261)
at org.ajax4jsf.org.w3c.tidy.Tidy.parseDOM(Tidy.java:604)
at org.ajax4jsf.webapp.tidy.TidyParser.parseHtmlByTidy(TidyParser.java:182)
at org.ajax4jsf.webapp.tidy.TidyParser.parseHtml(TidyParser.java:264)
at org.ajax4jsf.webapp.FilterServletResponseWrapper.parseContent(FilterServletResponseWrapper.java:594)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:367)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
 
Murali Pen
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did further research and found that the problem is with trying to rerender an <h:panelGroup> inside an <a4j:repeat>. The ajax4jsf developer recommended wrapping <h:panelGroup> with an <a4j:outputPanel>. When I did this, the nullpointer exception is gone. But the problem is still unresolved. The <a4j:outputPanel> that is wrapping the <h:panelGroup> simply won't render. This is because I can't refer to its id in the rerender value because it is inside an <a4j:repeat>. For each iteration of the repeat, this id will be different. Can someone please suggest a new approach? Please help me.

Here is the sample code for what I am trying to do.

<a4j:outputPanel id="topPanel">
<a4j:repeat value="#{activityTimeEntries}"
var="activityTimeEntry"
rowKeyVar="index">

<a4j:outputPanel id="outerPanel" ajaxRendered="true">
<h:panelGroup id="innerPanel" rendered="#{index == 0}">
<h:outputText value="#{activityTimeEntry.duration}" />
</h:panelGroup>
</a4j:outputPanel>

</a4j:repeat>
</a4j:outputPanel>

<a4j:commandButton reRender="topPanel" value="save" />
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sir i am also facing same issue in my jsf page.
Can you please help how to resolve this below error.


 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic