faces icon indicating copy to clipboard operation
faces copied to clipboard

Allow parents of forms as render targets of ajax requests

Open eclipse-faces-bot opened this issue 13 years ago • 8 comments

Currently it is not possible to use parents of forms as render targets in <f:ajax/> or jsf.ajax.request. If an element containing one or more forms is specified in the render attribute, these forms' ViewState is not updated during the Ajax request. In my opinion it is not clear from the JSDocs, if parents of forms are allowed as render targets or not. Mojarra currently does not create an error in that case, however the jsf.ajax.request method does not create a ViewState field for descendant forms either.

Judging from the JSDoc the request method's execute parameter is not limited to forms and children of forms, it just takes a list of arbitrary client ids. It's also possible to specify '@all' for the whole view thus most likely a parent of multiple forms, which works as expected.

However the JSDoc for jsf.ajax.response states the following for ViewState updates:

If an update element is found in the response with the identifier javax.faces.ViewState:

locate and update the submitting form's javax.faces.ViewState value with the CDATA contents from the response. Locate and update the javax.faces.ViewState value for all forms specified in the render target list.

This will clearly not work if only forms that are contained in the render target list directly are considered, because the list could also contain parents of forms.

For more information see the corresponding Mojarra bug report:

http://java.net/jira/browse/JAVASERVERFACES-1718

Affected Versions

[2.1]

eclipse-faces-bot avatar Jul 11 '11 16:07 eclipse-faces-bot

  • Issue Imported From: https://github.com/javaee/javaserverfaces-spec/issues/1024
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: Unassigned

eclipse-faces-bot avatar Aug 06 '19 08:08 eclipse-faces-bot

@glassfishrobot Commented Reported by frederickkaempfer

eclipse-faces-bot avatar Jul 11 '11 16:07 eclipse-faces-bot

@glassfishrobot Commented frederickkaempfer said: "Judging from the JSDoc the request method's execute parameter "

This was meant to be the render parameter.

eclipse-faces-bot avatar Jul 12 '11 07:07 eclipse-faces-bot

@glassfishrobot Commented frederickkaempfer said: This issue is related to (or even included in) http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790. Since this is obviously a spec bug and a fix is quite simple (updating all forms instead of only a subset defined by the render attribute on an ajax request, see Ed Burns' comment on 790) it would definitely be worth considering for 2.2.

eclipse-faces-bot avatar Sep 12 '11 13:09 eclipse-faces-bot

@glassfishrobot Commented @arjantijms said: Simple test case from duplicate issue JAVASERVERFACES-1788:

<h:panelGroup layout="block" id="group">
    <h:form>
        <h:commandLink value="Link A">
            <f:ajax />
        </h:commandLink>
    </h:form>
</h:panelGroup>

<h:form>
    <h:commandLink value="Link B">
        <f:ajax render=":group" />
    </h:commandLink>
</h:form>
  1. Press Link A - view state is submitted
  2. Press Link B, then Link A - view state is not submitted anymore

eclipse-faces-bot avatar Jan 08 '12 13:01 eclipse-faces-bot

@glassfishrobot Commented swathireddy12 said: I am making use of JSF 1.2 version of jars (myfaces-api-1.2.9.jar ,myfaces-impl-1.2.9.jar,trinidad-api-1.2.13.jar,trinidad-impl-1.2.13.jar). I am trying to retrieve the javax.faces.ViewState using the id attribute in a Javascript which works.

But i still don't see the id attribute in the loaded page

Could you please tell me if this is an issue with JSF 1.2 version as well? Or once the page is rendered the id attribute associated with "javax.faces.ViewState" is not seen anymore.

eclipse-faces-bot avatar Aug 22 '13 11:08 eclipse-faces-bot

@glassfishrobot Commented @edburns said: Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

eclipse-faces-bot avatar Aug 01 '14 14:08 eclipse-faces-bot

@glassfishrobot Commented This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-1024

eclipse-faces-bot avatar May 05 '17 05:05 eclipse-faces-bot