Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set button disabled property based on backing bean method

rade.todorovichJan 22 2014 — edited Jan 23 2014

JDeveloper 12c

I have a table and a button on the page. When user selects certain table row I want to enable/disable the button.

My backing bean (which has backing bean scope in the task flow where the page is) is

package view.backing;

public class Studybrowse {

    public Studybrowse() {

    }

    public String b1_action() {

          //Do something here

        return null;

    }

   public boolean b1_user_auth(){

       // Do something here to return true or false

        return true;

    }

}

My button is something like this:

<af:button text="Do something" id="b4" action="#{backingBeanScope.Studybrowse.b1_action}"

               disabled="#{backingBeanScope.Studybrowse.b1_user_auth THIS DOES NOT WORK}"

               partialTriggers="t1"/>  

The first problem is in design time, it says: "Reference backingBeanScope.Studybrowse.b1_user_auth not found"

and in runtime, desired behavior does not work.

Any help is appreciated

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2014
Added on Jan 22 2014
7 comments
1,067 views