RE: [FreeMarker-user] FW: crud screens and null.
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
|
From: Joe H. <jh...@my...> - 2006-05-09 14:55:14
|
> -----Original Message-----
> From: fre...@li... [mailto:freemarker-user-
> ad...@li...] On Behalf Of Daniel Dekany
> Sent: Tuesday, May 09, 2006 10:43 AM
> To: Joe Hudson
> Subject: Re: [FreeMarker-user] FW: crud screens and null.
>
> Tuesday, May 9, 2006, 4:11:39 PM, Joe Hudson wrote:
>
>
> >> -----Original Message-----
> >> From: fre...@li... [mailto:freemarker-
> user-
> >> ad...@li...] On Behalf Of Daniel Dekany
> >> Sent: Tuesday, May 09, 2006 9:58 AM
> >> To: Payne, Matthew
> >> Cc: fre...@li...
> >> Subject: Re: [FreeMarker-user] FW: crud screens and null.
> >>
> >> Tuesday, May 9, 2006, 3:16:12 PM, Payne, Matthew wrote:
> >>
> >> > +1
> >> >
> >> > Support the !.
> >>
> >> I disagree. The ! of Velocity doesn't let you specify the default
> >> value, so what should the template language do with the "suppressed"
> >> null then?
> >
> > I disagre. I think that if you evaluated all the FreeMarker templates
> out
> > there you would see a lot of ${something?if_exists} or
> > ${something?default("")}. The easy syntax isn't meant to address
> > ${something?default("something else")}.
>
> If you are that sure about it, then I don't know... Give me some
> concrete examples! I have seen "" as the default value seldom... where
> is that useful, other than for some primitive Web form handling?
As far as examples, I'll tell you when this is used most often for me.
Whenever I am displaying values in a label, value kind of presentation
(label on the left and value on the right) and the value is a string and may
be null, I use ?if_exists. I can't speak for anyone else but this is not an
uncommon situation in the work that I have done.
>
> Also, unless you use ?if_exists logic *extremely* often, isn't it
> foo!'' and foo![] or foo!{} better than foo! is? At least it's clearly
> visible what the default value is. I mean, you spare two keystrokes by
> allowing just !, but is that worth the price that your template will
> be less explicit?
I would say that, for me, it does happen relatively often. Is so often that
saving a keystroke would matter... who knows. I am certainly pre-disposed
to wanting the $!{} syntax because I did come from Velocity.
>
> > I like Daniel's idea of shorter syntax for
> ${something?default("something
> > else")} but I certainly think that it doesn't mean that $!{something}
> isn't
> > useful.
> >
> > Joe
>
> --
> Best regards,
> Daniel Dekany
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> FreeMarker-user mailing list
> Fre...@li...
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
|