Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-14252

@resetValues doesn't work with MyFaces

    XMLWordPrintable

    Details

    • Steps to Reproduce:
      Hide
      1. Empty the input field and click save
        Result : the required message appears
      2. Click the 2nd button "Change Info1 Value"
        Result : the field is still empty
        Excepted Result : the field should show "Changed Value"
      Show
      Empty the input field and click save Result : the required message appears Click the 2nd button "Change Info1 Value" Result : the field is still empty Excepted Result : the field should show "Changed Value"

      Description

      Michal Petrov said :

      When deciding to reset values MyFaces tries to obtain renderIds (i.e. ids of the components that should be reset) from the request parameters instead of getting them [from] our implementation of PartialViewContext. And since RichFaces doesn't include the ids in the request the input fails to reset. (f:ajax with @resetValues obviously works but h:commandButton with f:resetValues doesn't seem to).

      Code example to reproduce :

      <h:form id="f1">  
              <rich:messages id="msg" />  
              <h:outputLabel value="Info 1" for="itInfo1" />
              <h:inputText id="itInfo1" value="#{testBean.info1}" 
                      required="true" label="Info 1" />  
              <a4j:commandButton value="save" />  
              <a4j:commandButton value="change Info1 Value" 
                      execute="@this" 
                      action="#{testBean.setInfo1('Changed value')}" 
                      render="itInfo1" 
                      resetValues="true" />  
      </h:form>
      
      import javax.faces.bean.ManagedBean;
      import javax.faces.bean.ViewScoped;
      import javax.faces.event.AjaxBehaviorEvent;
      
      @ManagedBean
      @ViewScoped
      public class TestBean {
      	
      	private String info1 = "info1";
      	
      	public TestBean() {
      	}
      	
      	public String getInfo1() {
      		return info1;
      	}
      	public void setInfo1(String info1) {
      		this.info1 = info1;
      	}
      }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                michpetrov Michal Petrov
                Reporter:
                bluez974 Franck Gasparotto
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: