I was wondering if anyone has found any slick, no javascript dependent solution to the following situation. My question in short is, is there a way of having an indexed dispatch action, or have i been on the crack again?

I have a form of nested beans which are ordered according to a position stored in the model. I don't do any sorting in the web tier nor do i want to, other than rejigging the indices of some indexed properties until such a time as the user is ready to save his/her changes to the model.

<form name="foosForm" action="/myapp/save.do">
        <input type="text" name="foo[0].name">
        <input type="text" name="foo[1].name">
        <input type="text" name="foo[2].name">
</form>

Now when i save I'll save the index as a field called position, thus all that's fine and dandy.

So lets say I want the use to define the position by having a move up and move down, but rather than using an indexed link i want to use a button.

I've a lookup dispatch action with a moveup method and all that jazz.

<html:form action="/save.do">
<logic:iterate id="foo" name="foosForm" property="foos">
        <html:text name="foo" property="name" indexed="true" />
        <html:submit property="method" indexed="true">
                <bean:message key="button.moveup" />
        </html:submit>
</logic:iterate>
</html:form>

So the rendered html would like like this

<form name="foosForm" action="/myapp/save.do">
<input type="text" name="foo[0].name"><input type="submit" name="method[0]" value="Move Up">
//and so on
</form>


Of course if i submit this to a lookupdispatch action, its gonna call me a crazy fool. So i need to have some means of having an indexed map key in my key method map, or something to cross the same bridge i'm trying to cross.

Any ideas? I know i can do this in javascript which i will once i get things running without it, please no javascript suggestions.


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



Reply via email to