I use seam 2.2.0.GA. 
My password/confirm fields have redisplay="false" so the current password isn't in html.
validateEquality is in the confirm field.

I want the following behavior: when I create a new entity, both password/confirm fields should be required. When I edit an entity, both fields shouldn't be required, but the equality should be checked in any case. For that I have h:inputSecret required="#{required}" and calculate the param "required".

There're 2 problems:

1) s:validateEquality has the attribute "required" too, but it looks buggy: if I hardcode true or false, it works as expected, but if I use required="#{required}" and during a conversation this param changes, the validator still behaves as if the param hasn't changed.

2) s:validateEquality required="false" doesn't check the equality, if the confirm field is empty.

```
#{sandboxController.now}

<ui:param name="label" value="password"/>
<ui:param name="labelConfirm" value="confirm password"/>
<ui:param name="message" value="not the same"/>
<ui:param name="id" value="bbb"/>

<ui:param name="redisplay" value="#{sandboxBean.redisplay}"/>
<ui:param name="required" value="#{sandboxBean.required}"/>
<ui:param name="value" value="#{sandboxBean.password}" />

    <a4j:form id="personalForm">

<a4j:region>
required: <h:selectBooleanCheckbox value="#{required}">
  <a4j:support event="onclick" reRender="passwordpanel" />
</h:selectBooleanCheckbox><br/>
redisplay: <h:selectBooleanCheckbox value="#{redisplay}">
  <a4j:support event="onclick" reRender="passwordpanel" />
</h:selectBooleanCheckbox><br/>
</a4j:region>

<a4j:outputPanel id="passwordpanel">
password: #{value}<br/>
    <s:decorate styleClass="fieldForm #{formClass}">
        <div class="fieldLabel #{labelClass}">
            <s:label styleClass="#{invalid?'error':''}" >
                #{label}
                <s:span styleClass="required" rendered="#{required}">*</s:span>
            </s:label>
        </div>

        <div class="fieldInput">
            <s:validateAll>
                <h:inputSecret id="#{id}" value="#{value}" required="#{required}" redisplay="#{redisplay}">
                </h:inputSecret>
            </s:validateAll>
            <s:message styleClass="error"/>
        </div>
    </s:decorate>
    <s:decorate styleClass="fieldForm #{formClass}">
        <div class="fieldLabel #{labelClass}">
            <s:label styleClass="#{invalid?'error':''}" >
                #{labelConfirm}
                <s:span styleClass="required" rendered="#{required}">*</s:span>
            </s:label>
        </div>
        <div class="fieldInput">
            <s:validateAll>
                <h:inputSecret value="#{value}" required="#{required}" redisplay="#{redisplay}">
                    <s:validateEquality for="#{id}" required="#{required}" message="#{message}"/>
                </h:inputSecret>
            </s:validateAll>
            <s:message styleClass="error"/>
        </div>
    </s:decorate>
</a4j:outputPanel>

<a4j:commandLink value="submit" action="#{sandboxController.getNow}" reRender="personalForm" /><br/>

    </a4j:form>

```

SandboxBean.java :

```
package org.foo.model;

import java.io.Serializable;

public class SandboxBean implements Serializable {
    private static final long serialVersionUID = 1L;
    private String password = "abcde";
    private boolean required=false;
    private boolean redisplay=false;

    public void setRequired(boolean required)        {            this.required = required;        }
    public boolean isRequired()        {            return required;        }
    public String getPassword() {            return password;        }
    public void setPassword(String password) {            this.password = password;        }
    public void setRedisplay(boolean redisplay)        {            this.redisplay = redisplay;        }
    public boolean isRedisplay()        {            return redisplay;        }
}

```

SandboxController.java :

```
package org.foo.logic.model;

import java.io.Serializable;
import java.util.Date;

import org.foo.model.SandboxBean;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.log.Log;

@Name("sandboxController")
@Scope(ScopeType.CONVERSATION)
public class SandboxController implements Serializable{
    private static final long serialVersionUID = 1L;

    @Logger Log log;

    @Out(required = false)
    SandboxBean sandboxBean;

    @Begin(join=true)
    @Factory("sandboxBean")
    public void initSandBoxBean(){
        sandboxBean = new SandboxBean();
    }

  public Date getNow() {
      return new Date();
  }
}

```