You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dmitry Vasilenko <va...@soft-ukraine.com> on 2002/12/18 13:52:00 UTC

question

Dear,

Describe:
I have for example 10 form field (with validaton required). I see in the
jsp(<html:errors/>) 10 errors when I try to inut ntohing.

Question:
I  want to see in the jsp only for example 3 errors.


Best regards,
Dmitry.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: question

Posted by Andrew Hill <an...@gridnode.com>.
Thats a cool idea.
Good thinking :-)
Furthermore if there really is little space you could set the size to 1.
Then all the errors could be rendered as options and the user would just
need to click the select to drop down the list for reading.

-----Original Message-----
From: Kris Schneider [mailto:kris@dotech.com]
Sent: Wednesday, December 18, 2002 22:12
To: Struts Users Mailing List; andrew.david.hill@gridnode.com
Subject: RE: <html:errors/> question


How 'bout using a dummy form with a select element whose size attribute is
3?
Each error message would be rendered as an option element. Of course,
there's no
strict requirement for browsers to render a select element as a scrollable
list
box when the size attribute is present (and > 1), but IE 6.0, NS 4.79, and
Mozilla 1.2 seem to do so.

<form>
  <select size="3">
    <option>Error 1</option>
    <option>Error 2</option>
    <option>Error 3</option>
    <option>Error 4</option>
    <option>Error 5</option>
    <option>Error 6</option>
  </select>
</form>

Quoting Andrew Hill <an...@gridnode.com>:

> Hehe. Sorry. Couldnt resist making that joke  ;-)
>
> Afaik the errors tag only allows you to show all , or individually
> specified
> messages.
> However you still have some options. You could use a scriptlet to iterate
> over and output the first 3 messages only. If this space limit applies to
> lots of pages you might be best implementing your own tag to do that. You
> could use the source for the html:errors tag as a starting point. Shouldnt
> be too hard to give it another attribute that takes a maximum number of
> errors to display and have it halt its iterations if this number is
> reached.
>
> -----Original Message-----
> From: Dmitry Vasilenko [mailto:vasilenko@soft-ukraine.com]
> Sent: Wednesday, December 18, 2002 21:08
> To: Struts Users Mailing List; andrew.david.hill@gridnode.com
> Subject: Re: <html:errors/> question
>
>
> In my sample space for error information is limited. I want to outut only
> first 3 errors. :(
>
> ----- Original Message -----
> From: "Andrew Hill" <an...@gridnode.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, December 18, 2002 3:05 PM
> Subject: RE: <html:errors/> question
>
>
> > Get the user to enter data into 7 of the fields before they submit the
> form.
> > ;->
> >
> > -----Original Message-----
> > From: Dmitry Vasilenko [mailto:vasilenko@soft-ukraine.com]
> > Sent: Wednesday, December 18, 2002 20:52
> > To: Struts Users Mailing List
> > Subject: <html:errors/> question
> >
> >
> >
> > Dear,
> >
> > Describe:
> > I have for example 10 form field (with validaton required). I see in the
> > jsp(<html:errors/>) 10 errors when I try to inut ntohing.
> >
> > Question:
> > I  want to see in the jsp only for example 3 errors.
> >
> >
> > Best regards,
> > Dmitry.
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: question

Posted by Kris Schneider <kr...@dotech.com>.
How 'bout using a dummy form with a select element whose size attribute is 3?
Each error message would be rendered as an option element. Of course, there's no
strict requirement for browsers to render a select element as a scrollable list
box when the size attribute is present (and > 1), but IE 6.0, NS 4.79, and
Mozilla 1.2 seem to do so.

<form>
  <select size="3">
    <option>Error 1</option>
    <option>Error 2</option>
    <option>Error 3</option>
    <option>Error 4</option>
    <option>Error 5</option>
    <option>Error 6</option>
  </select>
</form>

Quoting Andrew Hill <an...@gridnode.com>:

> Hehe. Sorry. Couldnt resist making that joke  ;-)
> 
> Afaik the errors tag only allows you to show all , or individually
> specified
> messages.
> However you still have some options. You could use a scriptlet to iterate
> over and output the first 3 messages only. If this space limit applies to
> lots of pages you might be best implementing your own tag to do that. You
> could use the source for the html:errors tag as a starting point. Shouldnt
> be too hard to give it another attribute that takes a maximum number of
> errors to display and have it halt its iterations if this number is
> reached.
> 
> -----Original Message-----
> From: Dmitry Vasilenko [mailto:vasilenko@soft-ukraine.com]
> Sent: Wednesday, December 18, 2002 21:08
> To: Struts Users Mailing List; andrew.david.hill@gridnode.com
> Subject: Re: <html:errors/> question
> 
> 
> In my sample space for error information is limited. I want to outut only
> first 3 errors. :(
> 
> ----- Original Message -----
> From: "Andrew Hill" <an...@gridnode.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, December 18, 2002 3:05 PM
> Subject: RE: <html:errors/> question
> 
> 
> > Get the user to enter data into 7 of the fields before they submit the
> form.
> > ;->
> >
> > -----Original Message-----
> > From: Dmitry Vasilenko [mailto:vasilenko@soft-ukraine.com]
> > Sent: Wednesday, December 18, 2002 20:52
> > To: Struts Users Mailing List
> > Subject: <html:errors/> question
> >
> >
> >
> > Dear,
> >
> > Describe:
> > I have for example 10 form field (with validaton required). I see in the
> > jsp(<html:errors/>) 10 errors when I try to inut ntohing.
> >
> > Question:
> > I  want to see in the jsp only for example 3 errors.
> >
> >
> > Best regards,
> > Dmitry.
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: question

Posted by Andrew Hill <an...@gridnode.com>.
Hehe. Sorry. Couldnt resist making that joke  ;-)

Afaik the errors tag only allows you to show all , or individually specified
messages.
However you still have some options. You could use a scriptlet to iterate
over and output the first 3 messages only. If this space limit applies to
lots of pages you might be best implementing your own tag to do that. You
could use the source for the html:errors tag as a starting point. Shouldnt
be too hard to give it another attribute that takes a maximum number of
errors to display and have it halt its iterations if this number is reached.

-----Original Message-----
From: Dmitry Vasilenko [mailto:vasilenko@soft-ukraine.com]
Sent: Wednesday, December 18, 2002 21:08
To: Struts Users Mailing List; andrew.david.hill@gridnode.com
Subject: Re: <html:errors/> question


In my sample space for error information is limited. I want to outut only
first 3 errors. :(

----- Original Message -----
From: "Andrew Hill" <an...@gridnode.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, December 18, 2002 3:05 PM
Subject: RE: <html:errors/> question


> Get the user to enter data into 7 of the fields before they submit the
form.
> ;->
>
> -----Original Message-----
> From: Dmitry Vasilenko [mailto:vasilenko@soft-ukraine.com]
> Sent: Wednesday, December 18, 2002 20:52
> To: Struts Users Mailing List
> Subject: <html:errors/> question
>
>
>
> Dear,
>
> Describe:
> I have for example 10 form field (with validaton required). I see in the
> jsp(<html:errors/>) 10 errors when I try to inut ntohing.
>
> Question:
> I  want to see in the jsp only for example 3 errors.
>
>
> Best regards,
> Dmitry.
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: question

Posted by Dmitry Vasilenko <va...@soft-ukraine.com>.
In my sample space for error information is limited. I want to outut only
first 3 errors. :(

----- Original Message -----
From: "Andrew Hill" <an...@gridnode.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, December 18, 2002 3:05 PM
Subject: RE: <html:errors/> question


> Get the user to enter data into 7 of the fields before they submit the
form.
> ;->
>
> -----Original Message-----
> From: Dmitry Vasilenko [mailto:vasilenko@soft-ukraine.com]
> Sent: Wednesday, December 18, 2002 20:52
> To: Struts Users Mailing List
> Subject: <html:errors/> question
>
>
>
> Dear,
>
> Describe:
> I have for example 10 form field (with validaton required). I see in the
> jsp(<html:errors/>) 10 errors when I try to inut ntohing.
>
> Question:
> I  want to see in the jsp only for example 3 errors.
>
>
> Best regards,
> Dmitry.
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: question

Posted by Andrew Hill <an...@gridnode.com>.
Get the user to enter data into 7 of the fields before they submit the form.
;->

-----Original Message-----
From: Dmitry Vasilenko [mailto:vasilenko@soft-ukraine.com]
Sent: Wednesday, December 18, 2002 20:52
To: Struts Users Mailing List
Subject: <html:errors/> question



Dear,

Describe:
I have for example 10 form field (with validaton required). I see in the
jsp(<html:errors/>) 10 errors when I try to inut ntohing.

Question:
I  want to see in the jsp only for example 3 errors.


Best regards,
Dmitry.


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>