You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ronald Haring <Ha...@furore.com> on 2002/02/13 17:41:59 UTC

(NEWBIE question) problem with forms submitting with iterate tag

Hi all,

I have 2 forms, form 1 is search, form 2 is order.

Search has a searchAction. In this action the searh will be performed, and
the order bean will be populated and added to the order. The order page has
a logic:iterate tag which will loop over the list with results found, and
some input fields. This works fine.

If I find an error on the order field, I like to redisplay this page, but I
get the no collection found. My guess is that
the iterate tries to iterate over an empty bean, and thus creates the error.

Here's my code

SearchAction perform(...)
...
...
SearchForm searchForm = (SearchForm) form;
searchForm.performSearch();
OrderForm orderForm = new OrderForm();
orderForm.setSearchResults( searchForm.getSearchResults() );
request.setAttribute("orderForm", orderForm);
return mapping.findForward("order");

OrderForm validate() {
	// something is empty
	return errors
}

OrderAction perform(...)
...
...
...
}

How can I save the found searchResults?

Gr
Ronald 


Furore B.V.
Rijswijkstraat 175-8
Postbus 9204
1006 AE Amsterdam
tel. (020) 346 71 71
fax. (020) 346 71 77

----------------------------------------------------------------------------
---------------
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential
and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other
than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material
from any computer
----------------------------------------------------------------------------
---------------