You can find the complete solution here
http://www.reumann.net/struts/articles/request_lists.jsp

On 4/13/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Mallik,
> 
> The way I have always made this work in the past is to call the validate 
> method on the form bean myself in the action rather than leaving it the 
> validator to call for me.
> 
> Set validate="false" in the action mapping in struts-config.xml. Then in the 
> action call the validate method on the form bean.
> 
> ActionMessages valErrors = ((DynaValidatorForm)form).validate(mapping, 
> request);
> 
> Then
> 
> if (!valErrors.isEmpty())
> {
>         .. repopulate the drop down lists and form fields
>         .forward back to the page
> }
> 
> Hope this helps.
> 
> --
> Kurt Williams
> Marex Services
> 9704 Big Sage NW
> Albuquerque, NM 87114
> [EMAIL PROTECTED] 
> 505-897-1012 (office)
> 505-450-7105 (cell)
> 
> -------------- Original message --------------
> 
> > kurt,
> > I am putting the list of values for the drop
> > down in the form bean as dynaform.set("userList",
> > list) in theaction class. (userList is a form property
> > here) but still not able to get the drop down
> > re-populated back when validation errors occur.
> > What am I doing wrong here?
> >
> > Thanks in advance.
> >
> >
> > Thanks,
> > Mallik
> >
> > --- [EMAIL PROTECTED] wrote:
> > > Once the user does a submit you have a new request.
> > > So the old request where your list is is no longer
> > > in scope and therefore no longer valid.
> > >
> > > One solution would be to set validate="false" in the
> > > action mapping for the action and then call the
> > > form's validate method yourself in the aciton. If
> > > there are errors you can forward back to the jsp and
> > > reset the drop down list.
> > >
> > > You can also put the list of values for the drop
> > > down in the form bean as well.
> > >
> > > Thanks,
> > > Kurt
> > >
> > > --
> > > Kurt Williams
> > > Marex Services
> > > 9704 Big Sage NW
> > > Albuquerque, NM 87114
> > > [EMAIL PROTECTED] 
> > > 505-897-1012 (office)
> > > 505-450-7105 (cell)
> > >
> > >
> > > > Hi,
> > > > I am new to struts frame work.I have a question
> > > > regarding repopulating dropdown menu when
> > > validation
> > > > error occurs in the form containing dropdowns.
> > > >
> > > > In my application when user clicks on a link it
> > > goes
> > > > to the action class and I get the list to from
> > > > database and I put it in request scope to display
> > > in
> > > > dropdown .
> > > > but when ever any validation errors occurs on that
> > > > page, instead of showing the same page I get an
> > > error
> > > > saying "Cannot find bean under name (userList-this
> > > is
> > > > my list to populate dropdown)".
> > > >
> > > > What should I do to fix this problem.
> > > >
> > > > any help is appreciated.
> > > >
> > > > Thanks
> > > > Mallik.
> > > >
> > > >
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Small Business - Try our new resources
> > > site!
> > > > http://smallbusiness.yahoo.com/resources/ 
> > > >
> > > >
> > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED] 
> > > > For additional commands, e-mail:
> > > [EMAIL PROTECTED] 
> > > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED] 
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED] 
> > >
> > >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Small Business - Try our new resources site!
> > http://smallbusiness.yahoo.com/resources/ 
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED] 
> > For additional commands, e-mail: [EMAIL PROTECTED] 
> >
>

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

Reply via email to