• Rk094
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi all.  I'm looking for general guidance on the best way to handle the following situation:  I have a high level structure like this:

Code:
<apex:page>
  <apex:form>
    <c:myComponent />
  <apex:form>
</apex:page>

where 'myComponent' is a component that ends up outputting another apex:form tag.

I gather that VF does not like the nested forms - it complains with something like

'c:myComponent' component cannot be nested within form tags

I believe this kind of thing is pretty unavoidable in our design - typically those components are outputting a commandLink or some other thing that requires an enclosing form.

We've considered a couple of alternatives for structuring our pages to avoid this.  The current frontrunner is to do the following:

- Declare a single apex:form at the page level
- Cordon off the various areas of responsibility using actionRegions instead of form tags

Does that seem like a reasonable solution, or should we consider another approach?

Thanks very much in advance.


Message Edited by pcal on 08-13-2008 06:18 PM
  • August 14, 2008
  • Like
  • 0