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 16:01:56
|
> -----Original Message-----
> From: fre...@li... [mailto:freemarker-user-
> ad...@li...] On Behalf Of Daniel Dekany
> Sent: Tuesday, May 09, 2006 11:46 AM
> To: Joe Hudson
> Subject: Re: [FreeMarker-user] FW: crud screens and null.
>
> Tuesday, May 9, 2006, 4:55:00 PM, Joe Hudson wrote:
>
> [snip]
> >> 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.
>
> But should not you strike out the value then? Like:
>
> Name: -
>
> or something? In <input name="..." value="${value}"> you shouldn't...
> but that's the only case that I can tell out of my mind, and I don't
> think Web form refilling should be done like that. I have written a
> web form refiller for a framework, and I have to tell that refilling
> forms is far more complicated than some value="${value}"-s, and thus
> should not be the duty of the template authors. (In that framework,
> which used FreeMarker templates, you could write plain static HTML
> forms, and the template author had only to specify where the form
> starts, and where it ends along with the id of the form (because the
> same HTML page can contain multiple forms), and the form was just
> magically filled with the values (using a transparent template
> preprocessor in the background).)
>
> >> 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.
>
> How did you specify default values like "-", "N/A", "unknown", 0 (0 as
> number) or [] (empty list) in Velocity templates? Is it possible that
> you didn't used "-" and like, but instead rather generated lower
> quality output that uses "", only because it was too complicated to
> specify a default value other than ""?
This is why I specifically mentioned that this was related to string values
because I did not use the technique with numeric/currency values. The
organization I used to work at preferred thing being done that way. They
thought it was cleaner to not show anything (because it was obvious to them
that if nothing was shown, that represented a null value). I understand
that you don't feel that way but at my previous company, that is the way
thing needed to be done. I, personally, liked it that way as well.
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
|