-----Oorspronkelijk bericht----- Van: Rick Reumann [mailto:[EMAIL PROTECTED] Verzonden: donderdag 7 april 2005 22:50 Aan: Struts Users Mailing List Onderwerp: Re: LazyLists and dynamic forms
The code posted was an attempt to help Stephane fix his problems. Your comments are still very much appreciated though, I'd hate to miss out on an opportunity to learn something new. My own question was for an alternative way to set the dimension of the criteria List. An alternative for the 2 actions method that is. For example, I've been playing with the thought of doing it from the reset() method, but that would result in setting it on every invocation, not just the first. > I'd use the Session for this, but I'm not going to fight that battle > again. If you don't want to use the Session, show the form back into > request scope before leaving you action. You'll have to make sure you > give it the correct name or else do some tricks to get the name from the > config file. A big pain if you ask me. When I want form values to > persist across multiple requesta I use the Session and find it perfectly > valid to do so. I'm pretty new on struts programming and I've read to avoid using session. The only real reason I see not to use session is that if I stick 2 instances of my search tile in the same page (and I will do so), they will share the same property names in the session. Or do you think they will not overwrite each others values? > Also, I didn't look at all your code you posted (heck, it was a lot:), > but I'm guessing you also don't need to use those indexed properties. You could be right here, I introduced the indexed properties because the searchForm may contain from 1 to any number of properties to select on depending on the table being searched. Each line in the form contains one property for which the end user may select an operator to build a selection criterium and enter values. But how else will I be able to determine which operator to apply to a property and it's value(s)? or in other words, how do I keep the property name, operator and values of each line grouped together? > I also don't see what you are trying to do here... > > <html:text name="criterium" property="values" indexed="true" /> You are absolutely right here, there should have been a big TODO with that code. The idea is that depending on the operator chosen the amount of value fields can differ. in fact the operator field still needs to be changed into a select too. For example, for the is-empty operator there is no value needed, for the equal operator one value is needed, for between we need 2 and for the in operator any number of values would be allowed. > -- > Rick Thanks a lot for your input, Richard --------------------------------------------------------------------- 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]