MyFaces Core
  1. MyFaces Core
  2. MYFACES-2417

h:commandButton and h:commandLink now can be rendered outside a form

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-beta
    • Component/s: JSR-314
    • Labels:
      None

      Description

      In jsf 1.2 this is not possible, but now it is.

      1. myfaces-2417.patch
        17 kB
        Jakob Korherr

        Activity

        Hide
        Jakob Korherr added a comment -

        Where did you find this information? Testing mojarra, h:commandButton can be rendered outside a form, but h:commandLink cannot.

        Some details would be great (for example how h:commandLink should behave outside a form).

        Show
        Jakob Korherr added a comment - Where did you find this information? Testing mojarra, h:commandButton can be rendered outside a form, but h:commandLink cannot. Some details would be great (for example how h:commandLink should behave outside a form).
        Hide
        Jakob Korherr added a comment -

        OK, sorry - you got it from the TCK. I just took a closer look at the result.

        But do you know, how h:commandLink should behave outside a form? just not render any javascript for submitting in onclick? mojarra prints a warning to the ResponseWriter that the related h:commandLink is not embedded in a form..

        Show
        Jakob Korherr added a comment - OK, sorry - you got it from the TCK. I just took a closer look at the result. But do you know, how h:commandLink should behave outside a form? just not render any javascript for submitting in onclick? mojarra prints a warning to the ResponseWriter that the related h:commandLink is not embedded in a form..
        Hide
        Leonardo Uribe added a comment -

        It seems h:commandButton now can be rendered outside a form because type="button" is now valid, but there is no reason besides TCK for allow h:commandLink to be rendered outside a form. Please ignore the fix for h:commandLink.

        Show
        Leonardo Uribe added a comment - It seems h:commandButton now can be rendered outside a form because type="button" is now valid, but there is no reason besides TCK for allow h:commandLink to be rendered outside a form. Please ignore the fix for h:commandLink.
        Hide
        Leonardo Uribe added a comment -

        Thinking about it, we should do the same, just add a warn message and do not render any javascript for submitting in onclick.

        Show
        Leonardo Uribe added a comment - Thinking about it, we should do the same, just add a warn message and do not render any javascript for submitting in onclick.
        Hide
        Jakob Korherr added a comment -

        Here is my patch for this issue. With this patch h:commandButton and h:commandLink can be rendered outside a h:form, however h:commandLink is only rendered as SPAN and with a warning message (like in mojarra).

        The patch changes some method signatures in HtmlButtonRendererBase and HtmlLinkRendererBase to reduce the calls to findNestingForm(). Unfortunately I don't know if this is a problem for tomahawk. Please let me know and I'll change the patch.

        Show
        Jakob Korherr added a comment - Here is my patch for this issue. With this patch h:commandButton and h:commandLink can be rendered outside a h:form, however h:commandLink is only rendered as SPAN and with a warning message (like in mojarra). The patch changes some method signatures in HtmlButtonRendererBase and HtmlLinkRendererBase to reduce the calls to findNestingForm(). Unfortunately I don't know if this is a problem for tomahawk. Please let me know and I'll change the patch.
        Hide
        Leonardo Uribe added a comment -

        Thanks to Jakob Korherr for this patch

        Show
        Leonardo Uribe added a comment - Thanks to Jakob Korherr for this patch

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Leonardo Uribe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development