ICEfaces
  1. ICEfaces
  2. ICE-5482

Sparkle: Formless submit issue

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      sparkle

      Description

      The tabset component uses ice.submit and ice.singleSubmit based on the singleSubmit attribute.

      I tried to test form less tabset, on page load I get the following javascript error on line 1332 in bridge.js saying 'javax.faces.ViewState' is not defined on the page:

       onLoad(window, function() {
      1329 singleSubmitForm = document.createElement('form');
      1330 singleSubmitForm.action = window.location.pathname;
      1331 singleSubmitForm.id = 'void';
      1332 viewState = document.getElementById('javax.faces.ViewState').value;
      1333 });

      So I had to put an empty form in the page. For testing purpose I have also added a required field inside that form(e.g.)
      <h:form>
          <h:inputText required="true"/>
      </h:form>
      <ice:tabset>
         ......
      </ice:tabset>

      When I changed the tab without using singleSubmit, I could see that above form was executed and input field was validated.
      When I used the singleSubmit, and changed the tab the form was not submitted and validated.


        Activity

        Hide
        Ken Fyten added a comment -

        I think we either have to make it so individual components can work without being included inside a form in the page by auto-generating a form around the component prior to submitting that form (as an ICEfaces feature), or that all components must be in forms in the page, like standard JSF. Having formless comps. join an arbitrary existing form is not going to work well.

        If we are going to auto-generate a form for a component that isn't inside a form already, it should work whether your are using singleSubmit or full submit. Ideally, it would also work for any JSF component, not just ICEfaces ones.

        Show
        Ken Fyten added a comment - I think we either have to make it so individual components can work without being included inside a form in the page by auto-generating a form around the component prior to submitting that form (as an ICEfaces feature), or that all components must be in forms in the page, like standard JSF. Having formless comps. join an arbitrary existing form is not going to work well. If we are going to auto-generate a form for a component that isn't inside a form already, it should work whether your are using singleSubmit or full submit. Ideally, it would also work for any JSF component, not just ICEfaces ones.
        Hide
        Mircea Toma added a comment -

        We just need to store the view state in the page (maybe attached to UIViewRoot's rendered element) so that ice.singleSubmit can pick it up before constructing the request query.

        Show
        Mircea Toma added a comment - We just need to store the view state in the page (maybe attached to UIViewRoot's rendered element) so that ice.singleSubmit can pick it up before constructing the request query.
        Hide
        Mircea Toma added a comment - - edited

        Insert view state value in the HTML fragment corresponding to the view so that ice.singleSubmit can pick it up by traversing the parents of the submitted element until it finds the value. This way ice.singleSubmit does not rely anymore on the form component to put the view state in the page.

        Show
        Mircea Toma added a comment - - edited Insert view state value in the HTML fragment corresponding to the view so that ice.singleSubmit can pick it up by traversing the parents of the submitted element until it finds the value. This way ice.singleSubmit does not rely anymore on the form component to put the view state in the page.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Adnan Durrani
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: