ICEfaces
  1. ICEfaces
  2. ICE-1343

An <ice:commandButton> with immediate="true" does not set the UIInput.setSubmittedValue(null) like the ProcessValidations phase does

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.5.3
    • Fix Version/s: None
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Windows XP / Tomcat 5.5.17
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      The workaround is a hack. It involves putting an action listener on the Cancel button:

                <ice:commandButton actionListener="#{PortalUserList.rowPanelGroupCancelButtonListener}" immediate="true" styleClass="portlet-form-button" value="#{DataTableMsgs.keyValues['Cancel']}"/>

      Here is the listener:

          public void rowPanelGroupCancelButtonListener(ActionEvent actionEvent)
          {
              this.rowPanelGroupVisible = false;
              JSFUtils.clearSubmittedFormValues(JSFUtils.getForm(actionEvent.getComponent()));
          }

      And here is the clearSubmittedFormValues() static methods from my JSFUtils class:

          /**
           * This method (along with its private, recursive counterpart) is more or less a hack to try and fix a problem that
           * manifests itself with ICEfaces and <ice:commandButton> components with immediate="true". The folks at ICEsoft
           * need to make this be part of their partial-submit aspect of the JSF lifecycle.
           */
          public static void clearSubmittedFormValues(UIForm uiForm)
          {
              clearSubittedFormValuesRecurse(uiForm);
          }


          private static void clearSubittedFormValuesRecurse(UIComponent uiComponent)
          {
              if (uiComponent instanceof UIInput)
              {
                  UIInput uiInput = (UIInput) uiComponent;
                  uiInput.setSubmittedValue(null);
              }
              List childList = uiComponent.getChildren();
              if (childList != null)
              {
                  Iterator iterator = childList.iterator();
                  while (iterator.hasNext())
                  {
                      clearSubittedFormValuesRecurse((UIComponent) iterator.next());
                  }
              }
          }
      Show
      The workaround is a hack. It involves putting an action listener on the Cancel button:           <ice:commandButton actionListener="#{PortalUserList.rowPanelGroupCancelButtonListener}" immediate="true" styleClass="portlet-form-button" value="#{DataTableMsgs.keyValues['Cancel']}"/> Here is the listener:     public void rowPanelGroupCancelButtonListener(ActionEvent actionEvent)     {         this.rowPanelGroupVisible = false;         JSFUtils.clearSubmittedFormValues(JSFUtils.getForm(actionEvent.getComponent()));     } And here is the clearSubmittedFormValues() static methods from my JSFUtils class:     /**      * This method (along with its private, recursive counterpart) is more or less a hack to try and fix a problem that      * manifests itself with ICEfaces and <ice:commandButton> components with immediate="true". The folks at ICEsoft      * need to make this be part of their partial-submit aspect of the JSF lifecycle.      */     public static void clearSubmittedFormValues(UIForm uiForm)     {         clearSubittedFormValuesRecurse(uiForm);     }     private static void clearSubittedFormValuesRecurse(UIComponent uiComponent)     {         if (uiComponent instanceof UIInput)         {             UIInput uiInput = (UIInput) uiComponent;             uiInput.setSubmittedValue(null);         }         List childList = uiComponent.getChildren();         if (childList != null)         {             Iterator iterator = childList.iterator();             while (iterator.hasNext())             {                 clearSubittedFormValuesRecurse((UIComponent) iterator.next());             }         }     }

      Description

      An <ice:commandButton> with immediate="true" does not set the UIInput.setSubmittedValue(null) like the ProcessValidations phase does. This causes problems when you have two panelgroups (only one rendered at a time) with <ice:panelGroup rendered="#{Bean.isRendered}"> and <ice:panelGroup rendered="#{!Bean.isRendered}"> like we have in PortalUserList.jspx.

        Issue Links

          Activity

          Neil Griffin created issue -
          Ken Fyten made changes -
          Field Original Value New Value
          Fix Version/s 1.7DR#1 [ 10100 ]
          Assignee Priority P2
          Assignee Mark Collette [ mark.collette ]
          Ken Fyten made changes -
          Fix Version/s 1.7 [ 10080 ]
          Fix Version/s 1.7DR#1 [ 10100 ]
          Ken Fyten made changes -
          Fix Version/s 1.6.2 [ 10111 ]
          Fix Version/s 1.7 [ 10080 ]
          Assignee Priority P2 P3
          Mark Collette made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Ken Fyten made changes -
          Fix Version/s 1.6.2 [ 10111 ]
          Assignee Priority P3
          Assignee Mark Collette [ mark.collette ]
          Philip Breau made changes -
          Ken Fyten made changes -
          Assignee Philip Breau [ philip.breau ]
          Mark Collette made changes -
          Link This issue depends on ICE-2364 [ ICE-2364 ]
          Neil Griffin made changes -
          Attachment ice-1343-standard.zip [ 10734 ]
          Philip Breau made changes -
          Assignee Philip Breau [ philip.breau ] Ken Fyten [ ken.fyten ]
          Ken Fyten made changes -
          Assignee Ken Fyten [ ken.fyten ] Philip Breau [ philip.breau ]
          Philip Breau made changes -
          Assignee Philip Breau [ philip.breau ] Ken Fyten [ ken.fyten ]
          Ken Fyten made changes -
          Assignee Ken Fyten [ ken.fyten ] Mark Collette [ mark.collette ]
          Ken Fyten made changes -
          Link This issue duplicates ICE-1741 [ ICE-1741 ]
          Ken Fyten made changes -
          Status In Progress [ 3 ] Closed [ 6 ]
          Resolution Duplicate [ 3 ]
          Assignee Mark Collette [ mark.collette ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Neil Griffin
            • Votes:
              10 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: