On Mar 7, 2004, at 6:58 PM, Tim Colson wrote:
Also curious about :
 + TypeConverter (converting between different types)

I really wish I could be there for Drew's presentation... I'm sure there are parts of OGNL that I'm clueless on but would come in quite handy. I've toyed with TypeConverter a fair bit... it is like the BeanUtils Converter capabilities, except more powerful. It sits in between an expression and the corresponding setter and morphs types if needed.


And this might be completely off topic... not sure... but how are OGNL
expressions used in a Tapestry template?

It's actually trivial. Since most folks are familiar with Struts, it is like the property path expressions you use on the <html:*> tags. Except on steroids. If your page exposes a Customer object named customer, you would use this to display the customers name:

<span jwcid="@Insert" value="ognl:customer.name"/>


You could use that exact same expression on a text field:

<input type="text" jwcid="@TextField" value="ognl:customer.name"/>

And it binds in both directions to pre-populate the text box for rendering, and to set the customer name property on form submission.

The "ognl:" prefix is only needed when doing the implicit syntax in the HTML templates. The @Insert and @TextField can be moved to the specification file and the expressions done separately also. I'm just showing the lazy (more fun) way - but being more rigorous with the separation has great merit too.

Erik


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to