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!

Enable/Disable <af:button/> using javaScript

Moe_ADF_541Aug 3 2017 — edited Aug 8 2017

Dear Experts,

I have an <af:button/> that I wish to hide using javascript. I have the following setting:

- ADF fusion application.

- 1 bounded Task flow.

- 1 fragment page (*.jsff).

- 1 button on screen.

- 1 *.jsf page to run the taskflow as region.

On click of this button, I want it to disable itself. To achieve this, I added the following resource tag:

<af:resource type="javascript">

      function disableField(actionEvent) {

          var cButton = actionEvent.getSource().findComponent('r1:0:b1');

          cButton.setProperty("rendered", true);

      }

    </af:resource>

The first thing is that  I had to pass the button id as "region:0: button id", I don't know why it's only accepting this as id. If I put only the id of the button (b1), it will not be recognized.

- On click of the button, configured as:

    <af:button text="button 1" id="b1">

        <af:clientListener method="disableField" type="click"/>

    </af:button>

but the button is not being disabled. Can someone kindly point me to the right direction?

Best Regards,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2017
Added on Aug 3 2017
3 comments
225 views