1 Reply Latest reply on Mar 30, 2009 6:20 AM by ilya_shaikovsky

    Disable component(rich:menuItem) dynamically using CSS?

    jegancareer

      Dear All,

      I am using Richfaces 3.3.0 with Spring.

      I am including CSS based on the user ROLE (who logged in). so for some user i need to disabled the menuitem and for some user i need to enable the menuitem.

      In my css
      for ROLE 1
      .DisableMenuItem1{height: expression(this.disabled=false);}

      for ROLE 2
      .DisableMenuItem1{height: expression(this.disabled=true);}


      so that in my component i say

      <rich:menuItem submitMode="ajax" value="Edit" styleClass="DisableMenuItem1"
      onclick="location.href='#facesContext.externalContext.requestContextPath}/faces/pages/user/edit.jspx">
      </rich:menuItem>
      


      But here the problem is
      when the component having disabled=true directly it works fine.
      but when i disable from css even though it looks like disabled but it events are exists.(here in my code onclick is happening).


      Is there anyother way to set the component disabled dynamically?
      Please tell me how to resolve this problem.

      Thanks in advance.
      Jegan