thanks - i am coming round to the idea of dropping lookupdispatchaction, there really isnt enough to be gained.
On Tue, 25 Jan 2005 14:03:44 -0000, Niall Pemberton <[EMAIL PROTECTED]> wrote: > Firstly client side validation isn't dependant on the "validate" attribute > in the struts-config - so you won't miss client validation with the approach > you've taken. > > One possible alternative approach would be to create your own custom > DynaValidatorForm class and put the logic whether to validate or not in the > form's validate method. > > public class CustomDynaForm extends DynaValidatorForm { > > public ActionErrors validate(ActionMapping mapping, > HttpServletRequest request) { > > if (---- doing the update -----) { > return super.validate(mapping, request); > } else { > return null; > } > > } > } > > However you're using LookupDispatchAction and that would mean duplicating > the logic in that class which determines which method is being called - i.e. > either the refresh or the update. I don't use any of the flavours of > DispatchAction and LookupDispatchAction IMO is horribly complicated and you > probably won't want to do this. > > Niall > > ----- Original Message ----- > From: "Simon Pett" <[EMAIL PROTECTED]> > To: "Stuts User" <user@struts.apache.org> > Sent: Tuesday, January 25, 2005 1:30 PM > Subject: updating lists on the server > > > Hi > > > > I have some doubts about my implementation and am wondering if anyone > > has better solutions. I have done a bit of googling and thought about > > it without finding any great answers which probably means im missing > > something obvious. > > > > I am using a series of drop down lists at the top of my form. When the > > user makes a selection in the first list the dependant subsequent > > lists need to be updated. > > > > pretty standard i guess. However i do not wish to load all > > combinations of the lists into the request and use javascript to make > > the updates. I want the update or refresh to be done as a server > > request, probably in the tiles controller as its still presenation > > logic. > > > > I am using dynaValidatorForms to take advantage of struts validation - dah > > > > When the list is changed I use javascript in the html:select to submit the > form > > > > I figured i can use a lookupDispatchAction with at least two methods > > One, an update method which is invoked from the html:submit > > Two a refreshPresentation method that is executed when the list is > > changed via the javascript. > > > > The refreshPresentation method actually does nothing but forward back > > to the input, which eventually triggers the tile controller. The > > controller then looks at the current form and loads the appropriate > > lists. > > > > The update method populates the model class(es) from the actionForm > > with beanutils etc and then hands on to appropriate command classes > > then finally moves on. > > > > This all works ok, except as the refreshPresentation method does not > > require a validated actionForm in the case where the user has not > > completed later fields, i have to set that action to validate="false". > > > > Then in the update method i have to enact the validation myself. This > > is dumb as i have to duplicate the sturts code at least in a common > > super class and i think i will miss client validation. > > > > So what am i missing > > > > any help appreciated > > Simon > > > > --------------------------------------------------------------------- > > 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]