[ 
http://www.stripesframework.org/jira/browse/STS-839?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Gunter updated STS-839:
---------------------------

    Comment: was deleted

(was: There's actually an easy workaround for this. What you can do is set 
partial="true" on your <s:form> tag and put it inside a regular HTML <form> 
tag. One effect of partial="true" is to disable output of special hidden 
fields, because it is assumed that the outer tag (within which a partial form 
typically would be embedded) will do that.

{code|title=sample.jsp}
<s:url var="url" beanclass="test.stripes.action.PartialFormActionBean" />
<form action="${url}">
        <s:form partial="true" 
beanclass="test.stripes.action.PartialFormActionBean" method="GET">
                <label><s:checkbox name="test" /> A checkbox!</label>
                <s:submit name="go" value="Go" />
        </s:form>
</form>
{code})

> Make hidden fields (_sourcePage, __fb) optional for GET-forms
> -------------------------------------------------------------
>
>                 Key: STS-839
>                 URL: http://www.stripesframework.org/jira/browse/STS-839
>             Project: Stripes
>          Issue Type: Improvement
>          Components: Tag Library
>    Affects Versions: Release 1.5.6
>            Reporter: Carl Krig
>            Priority: Minor
>              Labels: CleanURLs, form
>
> Use case; trivial page browsing form as part of a bigger screen
> ...
> Page
> <stripes:form action="/browser" method="get" style="display: inline;">
>   <stripes:param name="some" />
>   <stripes:param name="other" />
>   <stripes:text name="pageNumber" onkeypress="javascript:if 
> (window.event.keycode == 13 || event.which) this.parent.submit();">
> </stripes:form>
> of ${actionBean.pageCount}
> ...
> Problems;
> * GET puts the two hidden fields _sourcePage, __fb in the face of the user 
> for no practical purpose
> * POST has the known refresh-side-effect (pressing F5 gives the user the 
> popup asking permission to re-post)
> * The url is baked (has a @UrlBinding) so the stripes:param tags are really 
> valuable to avoid hard-coding the recipe in multiple places, so substituting 
> with a plain <form> tag is out of the question.
> Wish;
> It would be nice to have something like partial="true" that omits the hidden 
> fields but still outputs the form tag.
> Suggestion 1: Add plain="true" with suggested functionality (Drawback: 
> stacking yet another attribute on there)
> Suggestion 2: Make method="get" omit the hidden fields. (Drawback: might 
> break existing code out there)
> Suggestion 3: Make method="get-funky" omit the hidden fields and output 
> method="get". (Drawback: non-standard)
> Workaround is to go with the default method POST and add to the action code;
>       if ("POST".equals(getContext().getRequest().getMethod())) {
>               return new RedirectResolution(getClass()).addParameter("some", 
> some).addParameter("other", other).addParameter("pageNumber", pageNumber);
>       }
> Drawback with this workaround is of course the extra roundtrip just to hide 
> nonsense query parameters.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to