You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Jason Pyeron <jp...@pdinc.us> on 2011/04/19 18:54:31 UTC

Fielderrors tag and the simple theme

I have been lementing how the fielderror tag forces a list around even when it
is called as <s:fielderror fieldName="foo" />

Does anyone have some comments about why this is good or if not how it should
perform?

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Fielderrors tag and the simple theme

Posted by Dave Newton <da...@gmail.com>.
I wouldn't have even thought of using the tags for non-HTML-related
work; they're form tags.

I'd use the collection directly; much cleaner and easier to
understand, or I'd expose it as serialized JSON.

Everything looks like a thumb when tags are your hammer.

Dave

On Tue, Apr 19, 2011 at 1:49 PM, Jason Pyeron <jp...@pdinc.us> wrote:
>
>> -----Original Message-----
>> From: Dave Newton [mailto:davelnewton@gmail.com]
>> Sent: Tuesday, April 19, 2011 13:02
>> To: Struts Developers List
>> Subject: Re: Fielderrors tag and the simple theme
>>
>> Fields can have multiple errors; I'm assuming the list-always
>> thing is to handle both single and multiple errors in the
>> same way. That said, with reasonable CSS, shouldn't be an issue, no?
>
> Yes and no. I always try to take the path of least surprise and extra html tags
> in the simple theme could be a surprise. My opinion would be to expose
> attributes startHtml, endHtml, startItemHtml, endItemHtml. Yes using them would
> loose the handling of many of the default atributes, like cssClass. I just do
> not think that a developer/designer should have to create a new tempate/theme to
> output bare results. I also think manual inspection of the error values in the
> stack would be ugly code too.
>
> Ex:
> <s:fielderror fieldName="foo" startHtml="" endHtml="" startItemHtml=""
> endItemHtml="<br>" />
>
> Imagine trying to use this in javascript...
>
> ...=<s:fielderror fieldName="foo" startHtml="{" endHtml="}" startItemHtml='"'
> endItemHtml='",' />;
>
>
>
>
>>
>> Dave
>>
>> On Tue, Apr 19, 2011 at 12:54 PM, Jason Pyeron
>> <jp...@pdinc.us> wrote:
>> > I have been lementing how the fielderror tag forces a list
>> around even
>> > when it is called as <s:fielderror fieldName="foo" />
>> >
>> > Does anyone have some comments about why this is good or if
>> not how it
>> > should perform?
>> >
>
>
> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> -                                                               -
> - Jason Pyeron                      PD Inc. http://www.pdinc.us -
> - Principal Consultant              10 West 24th Street #100    -
> - +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
> -                                                               -
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> This message is copyright PD Inc, subject to license 20080407P00.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


RE: Fielderrors tag and the simple theme

Posted by Jason Pyeron <jp...@pdinc.us>.
> -----Original Message-----
> From: Dave Newton [mailto:davelnewton@gmail.com] 
> Sent: Tuesday, April 19, 2011 13:02
> To: Struts Developers List
> Subject: Re: Fielderrors tag and the simple theme
> 
> Fields can have multiple errors; I'm assuming the list-always 
> thing is to handle both single and multiple errors in the 
> same way. That said, with reasonable CSS, shouldn't be an issue, no?

Yes and no. I always try to take the path of least surprise and extra html tags
in the simple theme could be a surprise. My opinion would be to expose
attributes startHtml, endHtml, startItemHtml, endItemHtml. Yes using them would
loose the handling of many of the default atributes, like cssClass. I just do
not think that a developer/designer should have to create a new tempate/theme to
output bare results. I also think manual inspection of the error values in the
stack would be ugly code too.

Ex:
<s:fielderror fieldName="foo" startHtml="" endHtml="" startItemHtml=""
endItemHtml="<br>" />

Imagine trying to use this in javascript...

...=<s:fielderror fieldName="foo" startHtml="{" endHtml="}" startItemHtml='"'
endItemHtml='",' />;




> 
> Dave
> 
> On Tue, Apr 19, 2011 at 12:54 PM, Jason Pyeron 
> <jp...@pdinc.us> wrote:
> > I have been lementing how the fielderror tag forces a list 
> around even 
> > when it is called as <s:fielderror fieldName="foo" />
> >
> > Does anyone have some comments about why this is good or if 
> not how it 
> > should perform?
> >


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.

 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Fielderrors tag and the simple theme

Posted by Dave Newton <da...@gmail.com>.
Fields can have multiple errors; I'm assuming the list-always thing is
to handle both single and multiple errors in the same way. That said,
with reasonable CSS, shouldn't be an issue, no?

Dave

On Tue, Apr 19, 2011 at 12:54 PM, Jason Pyeron <jp...@pdinc.us> wrote:
> I have been lementing how the fielderror tag forces a list around even when it
> is called as <s:fielderror fieldName="foo" />
>
> Does anyone have some comments about why this is good or if not how it should
> perform?
>
> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> -                                                               -
> - Jason Pyeron                      PD Inc. http://www.pdinc.us -
> - Principal Consultant              10 West 24th Street #100    -
> - +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
> -                                                               -
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> This message is copyright PD Inc, subject to license 20080407P00.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Fielderrors tag and the simple theme

Posted by Chris Pratt <th...@gmail.com>.
Since there's nothing stopping you from setting more than one error on a
field, it kind of needs to support that use case.
  (*Chris*)
On Apr 19, 2011 9:55 AM, "Jason Pyeron" <jp...@pdinc.us> wrote:
> I have been lementing how the fielderror tag forces a list around even
when it
> is called as <s:fielderror fieldName="foo" />
>
> Does anyone have some comments about why this is good or if not how it
should
> perform?
>
> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> - -
> - Jason Pyeron PD Inc. http://www.pdinc.us -
> - Principal Consultant 10 West 24th Street #100 -
> - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
> - -
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> This message is copyright PD Inc, subject to license 20080407P00.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>