Index: stripes/src/net/sourceforge/stripes/tag/FormTag.java =================================================================== --- stripes/src/net/sourceforge/stripes/tag/FormTag.java (revision 542) +++ stripes/src/net/sourceforge/stripes/tag/FormTag.java (working copy) @@ -52,6 +52,8 @@ /** Stores the field name (or magic values ''/'first') to set focus on. */ private String focus; private boolean focusSet = false; + + private boolean partialForm; /** Stores the value of the action attribute before the context gets appended. */ private String actionWithoutContext; @@ -123,6 +125,8 @@ /** Gets the name of the field that should receive focus when the form is rendered. */ public String getFocus() { return focus; } + public void setPartialForm(boolean partialForm){ this.partialForm = partialForm; } + public boolean isPartialForm(){ return partialForm; } //////////////////////////////////////////////////////////// // Additional attributes specific to the form tag @@ -198,28 +202,33 @@ } JspWriter out = getPageContext().getOut(); - writeOpenTag(out, "form"); + if(!partialForm){ + writeOpenTag(out, "form"); + } + getBodyContent().writeOut( getPageContext().getOut() ); - // Write out a hidden field with the name of the page in it.... - // The div is necessary in order to be XHTML compliant, where a form can contain - // only block level elements (which seems stupid, but whatever). - out.write("
"); - out.write(""); + if(!partialForm){ + // Write out a hidden field with the name of the page in it.... + // The div is necessary in order to be XHTML compliant, where a form can contain + // only block level elements (which seems stupid, but whatever). + out.write("
"); + out.write(""); - if (isWizard()) { - writeWizardFields(); - } + if (isWizard()) { + writeWizardFields(); + } - writeFieldsPresentHiddenField(out); - out.write("
"); + writeFieldsPresentHiddenField(out); + out.write("
"); - writeCloseTag(getPageContext().getOut(), "form"); + writeCloseTag(getPageContext().getOut(), "form"); + } // Write out a warning if focus didn't find a field if (this.focus != null && !this.focusSet) { Index: stripes/resources/stripes.tld =================================================================== --- stripes/resources/stripes.tld (revision 542) +++ stripes/resources/stripes.tld (working copy) @@ -458,6 +458,14 @@ Scripting code run prior to the form being submitted to the server, (HTML Pass-through) onsubmitfalsetrue + + + Tells the form whether or not actually render the >form< tag and the hidden + sourcePage tags as well. This is useful for partial forms when you are using ajax + to render the segements and you don't want the additional form elements. + + partialFormfalsetrue + @class@classfalsetrue