|
From: <tho...@tr...> - 2006-07-25 19:33:11
|
Brendan,
Thanks for your help - I think I figured it out.
If you look at my original example I had
<spring:bind path="command.step">
<input type="hidden" name="_step" value="STEP1"/>
</spring:bind>
The name="_step" did not match the property name so it did not get bound
even though the path explicitly names the property. It seemed to me that
the path should rule here, but maybe that's not how it's supposed to work.
Once I changed it to
<spring:bind path="command.step">
<input type="hidden" name="step" value="STEP1"/>
</spring:bind>
it works fine and so does
<input type="hidden" name="step" value="STEP1" />
They both get bound properly.
Thanks,
Thomas
> Thomas,
>
> Can you please try this and let us know what the result is:
>
> <input type="hidden" name="step" value="STEP1" />
>
> We do this sort of thing all over the place and it works fine. I'm
> assuming
> here that step is a property on your command object of course.
>
> Also, you did import the spring tags right? (Just asking as that's the
> sort
> of thing I forget to do all the time ;-)
>
> Thanks
> Brendan
>
> On 7/25/06, Matt Sgarlata <mat...@sp...> wrote:
>>
>> I think you can also do
>>
>> <input type="hidden" name="command.step" value="<c:out
>> value='${command.step}'/>"/>
>>
>> tho...@tr... wrote:
>> > Brendan,
>> >
>> > That's what I thought too, but the command.step property ends up being
>> > null when accessed from the validation code.
>> >
>> > Thomas
>> >
>> >> Hi Thomas,
>> >>
>> >> I don't see why:
>> >>
>> >> <spring:bind path="command.step">
>> >> <input type="hidden" name="${status.expression}" value="STEP1"/>
>> >> </spring:bind>
>> >>
>> >> wouldn't work or am I misunderstanding your question?
>> >>
>> >> Brendan
>> >>
>> >> On 7/25/06, tho...@tr... <tho...@tr...>
>> wrote:
>> >>> Is there a convenient way to assign a fixed value from a hidden form
>> >>> element and have it bound to the command object? I'm using the new
>> >>> <form>
>> >>> tags.
>> >>>
>> >>> the <form:hidden> tag does not have a value attribute.
>> >>>
>> >>> Tried to mix in a <spring:bind> tag but this resulted in the
>> preperty
>> >>> being set to null on the command object even though it originally
>> had
>> a
>> >>> value pre-assigned when the command object was created.
>> >>>
>> >>> Can we mix and match <form:> and <spring:bind> tags?
>> >>>
>> >>> Here is a simplified version of what I'm using:
>> >>>
>> >>> <h4>New Login Account</h4>
>> >>>
>> >>> <form:form commandName="command" action="new_user.htm">
>> >>> <table>
>> >>> <tr>
>> >>> <td class="prompt">Login ID:</td><td class="value">
>> >>> <form:input path="user.userName"/>
>> >>> </td>
>> >>> </tr>
>> >>> <tr class="even">
>> >>> <td class="prompt">Password:</td><td class="value">
>> >>> <form:password path="user.password"/>
>> >>> </td>
>> >>> <td>Retype Password:</td><td class="value">
>> >>> <form:password path="user.retypePassword"/>
>> >>> </td>
>> >>> </tr>
>> >>> </table>
>> >>>
>> >>> <table>
>> >>> <tr>
>> >>> <td class="submit"><input name="_eventId_submit"
>> type="submit"
>> >>> value="NEXT"/></td>
>> >>> </tr>
>> >>> </table>
>> >>>
>> >>> <spring:bind path="command.step">
>> >>> <input type="hidden" name="_step" value="STEP1"/>
>> >>> </spring:bind>
>> >>> <input type="hidden" name="_flowExecutionKey"
>> >>> value="${flowExecutionKey}"/>
>> >>>
>> >>> </form:form>
>> >>>
>> >>> The "command.step" is the property that I want to be able to set to
>> a
>> >>> fixed value from the form, like STEP1 in the example.
>> >>>
>> >>> Thomas
>> >>>
>> >>>
>> >>>
>> -------------------------------------------------------------------------
>> >>> Take Surveys. Earn Cash. Influence the Future of IT
>> >>> Join SourceForge.net's Techsay panel and you'll get the chance to
>> share
>> >>> your
>> >>> opinions on IT & business topics through brief surveys -- and earn
>> cash
>> >>>
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> >>> _______________________________________________
>> >>> Springframework-developer mailing list
>> >>> Spr...@li...
>> >>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>> >>>
>> >>
>> -------------------------------------------------------------------------
>> >> Take Surveys. Earn Cash. Influence the Future of IT
>> >> Join SourceForge.net's Techsay panel and you'll get the chance to
>> share
>> >> your
>> >> opinions on IT & business topics through brief surveys -- and earn
>> cash
>> >>
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
>> >> Springframework-developer mailing list
>> >> Spr...@li...
>> >> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>> >>
>> >
>> >
>> >
>> -------------------------------------------------------------------------
>> > Take Surveys. Earn Cash. Influence the Future of IT
>> > Join SourceForge.net's Techsay panel and you'll get the chance to
>> share
>> your
>> > opinions on IT & business topics through brief surveys -- and earn
>> cash
>> >
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>> your
>> opinions on IT & business topics through brief surveys -- and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|