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!

Call JavaScript code on click of a button

user10873676Mar 30 2017 — edited Apr 3 2017

Hi,

On click of a button .. I am trying to call a java script code ..  I am using Jdev 11.1.1.7.1

Here on the jsff page fragment i have added the following code at the beginning

<f:view>

    <af:document id="d1" title="abc">

      <af:resource type="javascript">

      function myFunction() {

    alert("I am an alert box!");

}

</af:resource>

On button i have used the clientlistener like this

<af:clientListener type="action" method="myFunction"/>

I am getting the following error when i run the page.

javax.faces.component.UIViewRoot cannot be cast to oracle.adf.view.rich.component.fragment.UIXRegion

Any idea of why this is happening ? what change should I be doing ?

Thanks,

Vinay

This post has been answered by Ashish Awasthi on Apr 3 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2017
Added on Mar 30 2017
11 comments
1,305 views