[richfaces-issues] [JBoss JIRA] Updated: (RF-4458) a4j:commandButton disabled attribute is checked prematurely

Shadow Creeper (JIRA) jira-events at lists.jboss.org
Thu Sep 11 16:33:20 EDT 2008


     [ https://jira.jboss.org/jira/browse/RF-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shadow Creeper updated RF-4458:
-------------------------------

    Description: 
If disabled was true, the expected behavior (not allowed to click on disabled element) is seen.

If disabled was false, the EL will be rechecked after click but before actionListener is run.

Expected behavior:
If disabled was false, then the button should work without checking disabled EL unless and until the button is told to reRender.

test.xhtml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<head>
   <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/>
   <title>disabled attribute test</title>
</head>

<body>
   <div>
      <h:form id="testForm">
         <a4j:commandButton id="testButton"
                            disabled="#{TestBean.loggingBooleanCheck}"
                            styleClass="entry"
                            actionListener="#{TestBean.actionMethod}"
                            value="Test"/>
      </h:form>
   </div>
</body>
</html>

TestBean methods:
   public void actionMethod ( ActionEvent ignored )
   {
      System.out.println( "Running action" );
   }

   public boolean isLoggingBooleanCheck ()
   {
      System.out.println( "Checking disabled value" );
      return false;
   }

  was:
If disabled was true, the expected behavior (not allowed to click on disabled element) is seen.

If disabled was false, the EL will be rechecked after click but before actionListener is run.

Expected behavior:
If disabled was false, then the button should work without checking disabled EL unless and until the button is told to reRender.



> a4j:commandButton disabled attribute is checked prematurely
> -----------------------------------------------------------
>
>                 Key: RF-4458
>                 URL: https://jira.jboss.org/jira/browse/RF-4458
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.2.2
>         Environment: Tested on JBoss 4.0.5 with Facelets 1.1.14, MyFaces 1.2.3 and RichFaces 3.2.2.GA
> Browsers tested Firefox 3.0.1 and IE 7(.0.5730.13)
>            Reporter: Shadow Creeper
>
> If disabled was true, the expected behavior (not allowed to click on disabled element) is seen.
> If disabled was false, the EL will be rechecked after click but before actionListener is run.
> Expected behavior:
> If disabled was false, then the button should work without checking disabled EL unless and until the button is told to reRender.
> test.xhtml:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
>      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
>       xmlns:h="http://java.sun.com/jsf/html"
>       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
>       xmlns:ui="http://java.sun.com/jsf/facelets">
> <head>
>    <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8"/>
>    <title>disabled attribute test</title>
> </head>
> <body>
>    <div>
>       <h:form id="testForm">
>          <a4j:commandButton id="testButton"
>                             disabled="#{TestBean.loggingBooleanCheck}"
>                             styleClass="entry"
>                             actionListener="#{TestBean.actionMethod}"
>                             value="Test"/>
>       </h:form>
>    </div>
> </body>
> </html>
> TestBean methods:
>    public void actionMethod ( ActionEvent ignored )
>    {
>       System.out.println( "Running action" );
>    }
>    public boolean isLoggingBooleanCheck ()
>    {
>       System.out.println( "Checking disabled value" );
>       return false;
>    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list