tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim McCollom" <...@evercare.dk>
Subject RE: Foreach and errorRenderers problem
Date Fri, 02 Sep 2005 14:21:10 GMT
Thanks a ton Alexandr 

-----Original Message-----
From: Alexandr Kundirenko [mailto:akundirenko@gmail.com] 
Sent: 2. september 2005 16:19
To: Tapestry users
Subject: Re: Foreach and errorRenderers problem

Hello Jim,

Your page has not "err" property. Just add it.


JM> Hi, I am trying to hack together an error componenet to display all 
JM> the errors as opposed to just the first one. I have a jwc that looks
like:

JM> <span jwcid="@Conditional" condition="ognl:delegate.hasErrors">
JM> <div class="error">
JM> <span jwcid="@Insert"
JM> value="ognl:delegate.errorRenderers.size">Error
JM> Count</span>
JM> <table>
JM>   <tr
JM>     jwcid="@Foreach"
JM>     source="ognl:delegate.errorRenderers"
JM>     value="ognl:err"
JM>     element="tr">
JM>     <td>
JM>       <span class="error"> 
JM>       <span jwcid="@Insert" value="ognl:err">Error Message</span>
JM>       </span>
JM>      </td>
JM>   </tr>
JM> </table>
JM> </div>
JM> </span>

JM> This worked fine when I was just displaying the first error, so I 
JM> know the delegate is getting set properly. But now that I have put 
JM> in the Foreach statement I get this  Exception every time. Does anyone
know why??:

JM> org.apache.tapestry.BindingException
JM> Unable to update OGNL expression '<parsed OGNL expression>' of 
JM> $ShowError_2@69695f[RegisterMember/$ShowError] to You must enter a 
JM> value for First Name.: $ShowError_2.err
JM> binding: 	ExpressionBinding[RegisterMember/$ShowError err]
JM> location: 	context:/WEB-INF/ShowError.html, line 8
JM> 3	jwcid="@Conditional"
JM> 4	condition="ognl:delegate.hasErrors">
JM> 5	<div class="error">
JM> 6	<span jwcid="@Insert"
JM> value="ognl:delegate.errorRenderers.size">Error Message</span>
JM> 7	<table>
JM> 8	<tr
JM> 9	jwcid="@Foreach"
JM> 10	source="ognl:delegate.errorRenderers"
JM> 11	value="ognl:err"
12	element="tr">>
JM> 13	<td>
 
JM> org.apache.hivemind.ApplicationRuntimeException
JM> Unable to update OGNL expression '<parsed OGNL expression>' of 
JM> $ShowError_2@69695f[RegisterMember/$ShowError] to You must enter a 
JM> value for First Name.: $ShowError_2.err
JM> component: 	$ShowError_2@69695f[RegisterMember/$ShowError]
JM> location: 	context:/RegisterMember.html, line 4
JM> 1	<html>
JM> 2	<h3>Register New Member</h3>
JM> 3	<form jwcid="form@Form" listener="listener:formSubmit"
JM> delegate="bean:delegate">
JM> 4	<span jwcid="@ShowError" delegate="bean:delegate" />
JM> 5	<table>
JM> 6	<tr>
JM> 7	<th><label jwcid="@FieldLabel" field="component:inputFirstName"
/>></th>
JM> 8	<td><input jwcid="inputFirstName" /></td>
JM> 9	</tr>
 
JM> ognl.NoSuchPropertyException
JM> $ShowError_2.err
JM> name: 	err
JM> target: 	$ShowError_2@69695f[RegisterMember/$ShowError]
JM> Stack Trace:

JM>     *
JM> ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:133)
JM>     * ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1629)
JM>     * ognl.ASTProperty.setValueBody(ASTProperty.java:105)
JM>     * ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
JM>     * ognl.SimpleNode.setValue(SimpleNode.java:246)
JM>     * ognl.Ognl.setValue(Ognl.java:476)
JM>     *
JM> org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.writeCompi
JM> led(Expr
JM> essionEvaluatorImpl.java:121)
JM>     *
JM> $ExpressionEvaluator_10617211d36.writeCompiled($ExpressionEvaluator_
JM> 10617211
JM> d36.java)
JM>     *
JM> org.apache.tapestry.binding.ExpressionBinding.setObject(ExpressionBi
JM> nding.ja
JM> va:172)
JM>     * $Foreach_5.setValueParameter($Foreach_5.java)
JM>     *
JM> org.apache.tapestry.components.Foreach.renderComponent(Foreach.java:101)
JM>     *
JM> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:612)
JM>     *
JM>
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:429)
JM>     *
JM>
org.apache.tapestry.components.Conditional.renderComponent(Conditional.java:
JM> 51)
JM>     *
JM> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:612)
JM>     *
JM> org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
JM>     *
JM> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:612)
JM>     *
JM>
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:429)
JM>     *
JM>
org.apache.tapestry.form.FormSupportImpl.render(FormSupportImpl.java:464)
JM>     * org.apache.tapestry.form.Form.renderComponent(Form.java:250)
JM>     *
JM> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:612)
JM>     *
JM> org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
JM>     *
JM> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:612)
JM>     *
JM> org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:275)
JM>     *
JM>
org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:368)
JM>     *
JM> org.apache.tapestry.services.impl.ResponseRendererImpl.renderRespons
JM> e(Respon
JM> seRendererImpl.java:71)
JM>     *
JM> $ResponseRenderer_10617211c54.renderResponse($ResponseRenderer_10617
JM> 211c54.j
JM> ava)
JM>     *
JM> $ResponseRenderer_10617211c53.renderResponse($ResponseRenderer_10617
JM> 211c53.j
JM> ava)
JM>     *
JM> org.apache.tapestry.engine.DirectService.service(DirectService.java:135)
JM>     *
JM> $IEngineService_10617211cb7.service($IEngineService_10617211cb7.java)
JM>     *
JM> org.apache.tapestry.services.impl.EngineServiceInnerProxy.service(En
JM> gineServ
JM> iceInnerProxy.java:74)
JM>     *
JM> org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(En
JM> gineServ
JM> iceOuterProxy.java:65)
JM>     *
JM>
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:248)
JM>     *
JM> org.apache.tapestry.services.impl.InvokeEngineTerminator.service(Inv
JM> okeEngin
JM> eTerminator.java:60)
JM>     *
JM> $WebRequestServicer_10617211c98.service($WebRequestServicer_10617211
JM> c98.java
JM> )
JM>     *
JM> $WebRequestServicer_10617211c97.service($WebRequestServicer_10617211
JM> c97.java
JM> )
JM>     *
JM> $WebRequestServicer_10617211c94.service($WebRequestServicer_10617211
JM> c94.java
JM> )
JM>     *
JM> $WebRequestServicer_10617211c93.service($WebRequestServicer_10617211
JM> c93.java
JM> )
JM>     *
JM> org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.s
JM> ervice(W
JM> ebRequestServicerPipelineBridge.java:56)
JM>     *
JM> $ServletRequestServicer_10617211c78.service($ServletRequestServicer_
JM> 10617211
JM> c78.java)
JM>     *
JM> $ServletRequestServicer_10617211c77.service($ServletRequestServicer_
JM> 10617211
JM> c77.java)
JM>     *
JM> org.apache.tapestry.request.DecodedRequestInjector.service(DecodedRe
JM> questInj
JM> ector.java:55)
JM>     *
JM> $ServletRequestServicerFilter_10617211c74.service($ServletRequestSer
JM> vicerFil
JM> ter_10617211c74.java)
JM>     *
JM> $ServletRequestServicerFilter_10617211c73.service($ServletRequestSer
JM> vicerFil
JM> ter_10617211c73.java)
JM>     *
JM> $ServletRequestServicer_10617211c79.service($ServletRequestServicer_
JM> 10617211
JM> c79.java)
JM>     *
JM> org.apache.tapestry.multipart.MultipartDecoderFilter.service(Multipa
JM> rtDecode
JM> rFilter.java:52)
JM>     *
JM> $ServletRequestServicerFilter_10617211c72.service($ServletRequestSer
JM> vicerFil
JM> ter_10617211c72.java)
JM>     *
JM> $ServletRequestServicerFilter_10617211c71.service($ServletRequestSer
JM> vicerFil
JM> ter_10617211c71.java)
JM>     *
JM> $ServletRequestServicer_10617211c79.service($ServletRequestServicer_
JM> 10617211
JM> c79.java)
JM>     *
JM> org.apache.tapestry.services.impl.SetupRequestEncoding.service(Setup
JM> RequestE
JM> ncoding.java:53)
JM>     *
JM> $ServletRequestServicerFilter_10617211c76.service($ServletRequestSer
JM> vicerFil
JM> ter_10617211c76.java)
JM>     *
JM> $ServletRequestServicerFilter_10617211c75.service($ServletRequestSer
JM> vicerFil
JM> ter_10617211c75.java)
JM>     *
JM> $ServletRequestServicer_10617211c79.service($ServletRequestServicer_
JM> 10617211
JM> c79.java)
JM>     *
JM> $ServletRequestServicer_10617211c6c.service($ServletRequestServicer_
JM> 10617211
JM> c6c.java)
JM>     *
JM> $ServletRequestServicer_10617211c6b.service($ServletRequestServicer_
JM> 10617211
JM> c6b.java)
JM>     *
JM> org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.
JM> java:141
JM> )
JM>     *
JM>
org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:186)
JM>     * javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
JM>     * javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
JM>     *
JM> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
JM>     *
JM> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicat
JM> ionHandl
JM> er.java:475)
JM>     *
JM> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
JM>     * org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
JM>     *
JM> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicatio
JM> nContext
JM> .java:635)
JM>     * org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
JM>     * org.mortbay.http.HttpServer.service(HttpServer.java:954)
JM>     *
JM> org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
JM>     *
JM> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
JM>     *
JM> org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
JM>     *
JM>
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
JM>     *
JM> org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
JM>     *
JM> org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)


JM> --------------------------------------------------------------------
JM> -
JM> To unsubscribe, e-mail:
JM> tapestry-user-unsubscribe@jakarta.apache.org
JM> For additional commands, e-mail:
JM> tapestry-user-help@jakarta.apache.org



--
aku


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Mime
View raw message