I'm most certainly a stripes neophyte.  From a little googling it seems
like using BeanFirstPopulationStrategy is preferred in general. (And will
be the default in the next version of stripes?)

Let me turn that on and see what breaks ...


On Wed, Oct 1, 2014 at 1:32 PM, Rick Grashel <rgras...@gmail.com> wrote:

> I presumed (possibly incorrectly) that OP was using a
> BeanFirstPopulationStrategy since he was trying use the action bean to
> maintain state between calls and then depending on it having correct values
> for each subsequent paging call.
>
> Rusty, if that isn't the case, then disregard my response.  Apologies.
>
> -- Rick
>
>
> On Wed, Oct 1, 2014 at 3:10 PM, Marcus Kraßmann <m...@syn-online.de> wrote:
>
>>  Correct me if I'm wrong, but that will only work together with the
>> BeanFirstPopulationStrategy, right? With the default population strategy,
>> the old value from the request will be reused within the JSP, so the
>> incrementation won't have any effect.
>>
>>
>> Am 01.10.2014 21:58, schrieb Rick Grashel:
>>
>> Rusty,
>>
>>  I'd do this differently if I were you.  You really should have a single
>> "startingOffset".  Then, have the nextPage() and previousPage() event
>> methods increment or decrement the startingOffset variable by 20.
>> Something like this:
>>
>>  public void nextPage()
>> {
>>     this.startingOffset += 20;
>> }
>>
>>  public void previousPage()
>> {
>>     this.startingOffset -= 20;
>>     if ( this.startingOffset < 0 ) this.startingOffset = 0;
>> }
>>
>>  That should work perfectly fine.  Then, you can have a single hidden
>> input which looks like this:
>>
>>  <stripes:input name="startingOffset"/>
>>
>>  -- Rick
>>
>> On Wed, Oct 1, 2014 at 2:47 PM, Rusty Wright <rusty.wri...@gmail.com>
>> wrote:
>>
>>>    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
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> 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 
>> Analyzerhttp://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>>
>>
>>
>> _______________________________________________
>> Stripes-users mailing 
>> listStripes-users@lists.sourceforge.nethttps://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
>
>
------------------------------------------------------------------------------
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