Stripes

Allow input tags outside of form tags (and possibly nested form tags)

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: Release 1.5
  • Component/s: Tag Library
  • Labels:
    None

Description

There are a variety of circumstances that lead to wanting to reuse parts of forms in a web application (the using of fragments of JSP to render form fragment for inclusion using AJAX is the most common example). Stripes tags currently require that they be nested inside a stripes:form tag, but this is problematic when trying to render fragments.

Since putting an input tag outside of a form is also a common form of error (and the form tag /does/ provide services to the input tags) it is suggested that we have an option on the form tag along the lines of:
<s:form [partial|fragment]="true"/>
that would disable any output from the form tag. This would thereby allow the use of such a tag to wrap these fragments and provide any necessary services, without rendering the HTML form itself.

An addendum to this is that it is probably necessary for form tags to check and see if they are nested inside another form tag, and if they are (and the action matches or is missing altogether from the nested form) then to simply delegate to the parent form tag - or throw an exception in the case of a mismatch.

  1. partialForm.patch
    13/Apr/07 10:09 AM
    21 kB
    Nick Stuart
  2. partial-form.patch
    15/May/07 6:55 AM
    4 kB
    Nick Stuart

Activity

Hide
Nick Stuart added a comment - 13/Apr/07 10:09 AM

Thought I would throw a quick patch up here as this doesn't really need to be all that complicated. Let me know if I need to add anything else, but this seems to do the trick for me. Variable name might be renamed to just 'partial' but thats minor.

Show
Nick Stuart added a comment - 13/Apr/07 10:09 AM Thought I would throw a quick patch up here as this doesn't really need to be all that complicated. Let me know if I need to add anything else, but this seems to do the trick for me. Variable name might be renamed to just 'partial' but thats minor.
Hide
Nick Stuart added a comment - 15/May/07 6:55 AM

New patch attached that will work off the trunk release. (as of 5/15/07)

Show
Nick Stuart added a comment - 15/May/07 6:55 AM New patch attached that will work off the trunk release. (as of 5/15/07)
Hide
Nick Stuart added a comment - 15/May/07 6:56 AM

Tim, or some other admin, could you delete the old partialForm.patch file as it doesn't work off your source tree...

Show
Nick Stuart added a comment - 15/May/07 6:56 AM Tim, or some other admin, could you delete the old partialForm.patch file as it doesn't work off your source tree...
Hide
John Newman added a comment - 22/May/07 6:29 AM

just wanted to say that we are using this patch with great success. Thanks Nicholas, this seems to work very well and is a lot less complicated that I thought it would be.

Show
John Newman added a comment - 22/May/07 6:29 AM just wanted to say that we are using this patch with great success. Thanks Nicholas, this seems to work very well and is a lot less complicated that I thought it would be.
Hide
Kai Grabfelder added a comment - 24/May/07 12:40 PM

@any commiter: what about adding applying this to the trunk?

Show
Kai Grabfelder added a comment - 24/May/07 12:40 PM @any commiter: what about adding applying this to the trunk?
Hide
Ben Gunter added a comment - 25/May/07 2:51 PM

With apologies to those of you who are already using this patch, I renamed the partialForm property/attribute to just partial. Also changed the wording of the description in the TLD. Other than that, it's pretty much the same as Nicholas' patch.

Show
Ben Gunter added a comment - 25/May/07 2:51 PM With apologies to those of you who are already using this patch, I renamed the partialForm property/attribute to just partial. Also changed the wording of the description in the TLD. Other than that, it's pretty much the same as Nicholas' patch.

People

Vote (2)
Watch (3)

Dates

  • Created:
    23/Mar/07 4:58 AM
    Updated:
    04/Jan/11 3:09 PM
    Resolved:
    25/May/07 2:51 PM