struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeromy Evans <>
Subject Re: ajax validation issue
Date Wed, 10 Sep 2008 12:00:25 GMT
Gawain Hammond wrote:
> A really nice solution so far has been to an action tag to populate
> forms, which has worked nicely the rest of the time. I've really liked
> using this approach to fill drop-downs, like so:
> <s:action namespace="/admin" name="crud.Group.listAll"
> id="groupAction"/>
> ...
> <s:select label="Group" name="" value="%{}" 
>   list="%{#groupAction.list}" listKey="id" listValue="name"/>

That's a novel approach.  I like it.

> Using %{#groupAcation.list} to populate the drop down works great, but
> the only work around I've seen to fill the select box after validation
> returns to the form is rather messy:
> alidation-fails.html

I don't see why the above approach wouldn't be working after a 
validation failure.  When the INPUT result is returned it presumably 
renders the same JSP (and doesn't do a redirect).  The problem occurs 
when the context/valuestack doesn't contain something you're expecting 
(such as the list for the select). 
Can you confirm whether "crud.Group.listAll" is invoked after a 
validation failure?

> Knowing ajax validation will only work with xhtml/css_html theme is
> helpful, I've been using ajax all along which may explain some issues.
That should read client-side validation.

> You said to use the default interceptor stack for 2.1.2, and the
> documentation I read says to use 'jsonValidationWorkflowStack' do I need
> both of them or will just the default stack work?

jsonValidationWorkflowStack is correct one.

The autocompleter works because it performs a separate request to 
populate the permitted values.  Your case is just that the list for the 
selects is empty or null.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message