You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by li...@hotmail.com on 2003/04/22 12:42:56 UTC

Help with "ognl:bindings.delegate.object.firstError"

Can someone please help me with these OGNL expressions found in the 
workbench sample, ShowError.html ?

a.  <span jwcid="@Conditional" 
condition="ognl:bindings.delegate.object.hasErrors">

b.  <span jwcid="@Delegator"    
delegate="ognl:bindings.delegate.object.firstError">
Error message goes here.
</span>

I see that delegate is a parameter, of type IValidationDelegate, for the 
ShowError component in ShowError.jwc.  bindings is a property of 
AbstractComponent.

But what does .object mean ?  hasErrors() is a method on 
IValidationDelegate.  firstError() doesn't seem to be found anywhere.

Thanks in advance.

LS

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


RE: Help with "ognl:bindings.delegate.object.firstError"

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
Break it apart and look at the JavaDoc.

bindings.delegate.object.firstError ==

getBindings().getDelegate().getObject().getFirstError()

getBindings() ==> a Map of the parameter bindings
getDelegate() ==> the IBinding for the delegate parameter
getObject() ==> the value of the IBinding, as an Object (but actual type is
IValidationDelegate)
getFirstError() ==> the first error recorded in the form, as an IRender (not
as a String!)

Delegator takes an IRender and invokes render() upon it.

Why IRender and not String?  Because a String can only be a string, but an
IRender can render text, links, images, whatever.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: lianseng@hotmail.com [mailto:lianseng@hotmail.com] 
> Sent: Tuesday, April 22, 2003 6:43 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Help with "ognl:bindings.delegate.object.firstError"
> 
> 
> Can someone please help me with these OGNL expressions found in the 
> workbench sample, ShowError.html ?
> 
> a.  <span jwcid="@Conditional" 
> condition="ognl:bindings.delegate.object.hasErrors">
> 
> b.  <span jwcid="@Delegator"    
> delegate="ognl:bindings.delegate.object.firstError">
> Error message goes here.
> </span>
> 
> I see that delegate is a parameter, of type 
> IValidationDelegate, for the 
> ShowError component in ShowError.jwc.  bindings is a property of 
> AbstractComponent.
> 
> But what does .object mean ?  hasErrors() is a method on 
> IValidationDelegate.  firstError() doesn't seem to be found anywhere.
> 
> Thanks in advance.
> 
> LS
> 
> _________________________________________________________________
> Tired of spam? Get advanced junk mail protection with MSN 8. 
> http://join.msn.com/?page=features/junkmail
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>