Yes, thanks, I can definitely get it to work with a plain input tag.  I was
just very frustrated that the stripes hidden input tag wouldn't work.  It
seems that the stripes hidden input tag is getting the value from the
previous form submit?

I've got it now where offset goes from 0 to 20 to 40 then gets stuck at 40.

In my jsp I have

<p>
${actionBean.offset}
</p>

    <stripes:form
beanclass="com.objecteffects.template.web.action.PostsActionBean">
        <stripes:hidden
            name="newOffset"
            value="${actionBean.offset}"
        />

When it gets to 40 then I do a view source on the web page and it shows
this:

<p>
40
</p>

    <form action="/template/Posts.action" method="post">
        <input name="newOffset" value="20" type="hidden" />

I changed my action bean so that it bumps offset by 20 in its handler,
rather than doing it in the jsp, hoping that that might fix it, but no joy.

The documentation for the stripes hidden tag says:

Generates one or more <input type="hidden" ... /> HTML tags based on the
value supplied. The hidden tag assigns the value attribute by scanning in
the following order:

    * for one or more values with the same name in the HttpServletRequest
    * for a field on the ActionBean with the same name (if a bean instance
is present)
    * by collapsing the body content to a String, if a body is present
    * referring to the result of the EL expression contained in the value
attribute of the tag.

I'm guessing that it's the first bullet that's causing my problem, but I
don't understand what's going on.  And I have to say that I don't
understand why the last bullet is given the lowest precedence.


On Wed, Oct 1, 2014 at 6:48 AM, Mike McNally <emmecin...@gmail.com> wrote:

> The value on the field is probably being overridden by the value on the
> bean. Try it as a plain input tag like in your comment.
> On Oct 1, 2014 3:08 AM, "Rusty Wright" <rusty.wri...@gmail.com> wrote:
>
>> I'm sure this has been asked before, but why isn't my "paging through the
>> results" code working using a stripes:hidden field?  In my action bean I
>> have a setter for newOffset and a getter for offset.  In the jsp I add 20
>> to offset and set newOffset to that.  My jsp has this:
>>
>>
>> ${actionBean.offset}
>>     <stripes:form
>> beanclass="com.objecteffects.template.web.action.PostsActionBean">
>> <%--
>>         <input
>>             name="newOffset"
>>             value="${actionBean.offset + 20}"
>>             type="hidden"
>>         />
>> --%>
>>
>>         <stripes:hidden
>>             name="newOffset"
>>             value="${actionBean.offset + 20}"
>>         />
>>
>> In my action bean its handler forwards to this jsp and has the setter and
>> getter:
>>
>>
>>         return new ForwardResolution(PostsActionBean.VIEW);
>>     }
>>
>>     public void setNewOffset(final long newOffset) {
>>         this.offset = newOffset;
>>     }
>>
>>     public long getOffset() {
>>         return this.offset;
>>     }
>>
>> There's no getter for newOffset and no setter for offset.
>>
>> The first time on the page offset is 0 as it should be and when I submit
>> the form the action bean gets 20 for newOffset and then the jsp gets 20,
>> but then it stays at 20 each time I submit the page.
>>
>> If I use the plain regular input (commented out in the above) then it
>> works fine.
>>
>> Here are the full files:
>>
>>
>> https://code.google.com/p/oauth2-test/source/browse/trunk/template/template-web/src/main/java/com/objecteffects/template/web/action/PostsActionBean.java
>>
>>
>> https://code.google.com/p/oauth2-test/source/browse/trunk/template/template-web/src/main/webapp/WEB-INF/jsp/posts.jsp
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Stripes-users mailing list
>> Stripes-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>
>>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to