0

I have taskflow containing a .jsff page (Let's call this child page) in which we are calling javascript method on click of a button. The javascript methos is doing

element = findComponent("id")

and then doing some operation on that element. This javascript method is added to .jsff page as a resource.

This taskflow is inserted in another page (Let's call this page as parent page) as a region . Now the parent page also has an element with id ="id" which is being used in findComponent of child page, that is child page and parent page has the same id.

So does invoking of javascript from child page taskflow will find element of child page or parent page?

1
  • I'd just pass the Id of the exact component erks.addScript(context,"yourmethod('"+formBinding.getClientId(context) +"')"); and enable clientComponent=true for that component. Commented Mar 16, 2016 at 18:55

1 Answer 1

2

You can use af:resource tag to add javascript function , but it would be better to add it to a page component so that the browser does not cache it

<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<af:panelFormLayout>
 <af:resource type="javascript">
    function yourMethod(evt){ ... }
 </af:resource>
</af:panelFormLayout> 

You should read more about this.

https://blogs.oracle.com/jdevotnharvest/entry/gotcha_when_using_javascript_in

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.