How to include javascript resources in  Facelet tag library

I've been trying out Duncans watermark behavior tag (https://blogs.oracle.com/groundside/entry/placeholder_watermarks_with_adf_11). Indeed a great article and the example work perfectly when the tag library is included within the project and when the javascript resource (common.js) file is added to the document using af:resource tag.
I would like to create a deployable tag library, including a setWatermarkBehavior tag, for reuse in various apps. I'm able to create and deploy the tag library as a ADF library and include it for use in an application. But on runtime, the pages are not able to find the "addWatermarkBehavior" method, which I hoped automatically got loaded from the javascript file defined in the tag library jar. In the tag library file, I've added a "adf-js-features.xml" in META-INF. This file and the .js file is included in the ADF library jar. "adf-js-features.xml" looks like this:
<adf-js-features xmlns="http://xmlns.oracle.com/adf/faces/feature">
<features xmlns="http://xmlns.oracle.com/adf/faces/feature">
<feature>
<feature-name>adfExtTaglib</feature-name>
<feature-class>com/cgi/adf/ext/taglib/js/adfExtTaglib.js</feature-class>
</feature>
</features>
</adf-js-features>
I'm not sure, what value should be used for "feature-name" - I've tried many different "meaningful" names. I presume, that the ADF framework, should automatically discover all "adf-js-features" files and automatically load js-file on pages, which are using tags from the particular tag library. But apparently I'm missing something. In the facelets page used for testing, I have these few components.
<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:adfext="http://xmlns.cgi.com/adf/ext">
<af:document title="testAdfExtTaglib" id="d1">
<!-- af:resource type="javascript" source="/resources/js/common.js" / -->
<af:form id="f1">
<af:inputText label="Label 1" id="it1">
<adfext:setWatermarkBehavior value="CHR-Nr"/>
</af:inputText>
</af:form>
</af:document>
</f:view>
Doing some debugging, I can confirm that the "getScript" method of the setWatermarkBehavior class is called. I can also find the javascript produced by the "getScript" method in the DOM. But I cannot find anywhere in the DOM, where the javascript file from the tag library is loaded.
Please, help me out?
Edited by: wmjaboj on 2012-09-23 23:58

The Javascript source URI has the value "RES_NOT_FOUND".
If I try to access it using ".../faces/javax.faces.resource/javascript.js?ln=js" I get a blank page (contains a Html and Body only).
If I try to access it using ".../faces/resources/js/javascript.js" I can download the javascript file from the taglib.
If I manually copy the javascript.js file from the taglib into the enclosing project and save it in "resource/js", then the javascript source URI is resolved correctly to ".../faces/javax.faces.resource/javascript.js?ln=js" and I can downloaded it, but then it is the local copy and not the one from the taglib jar.
Do I need some specific configuration in web.xml or other deployment descriptors, to be able to use "javax.faces.resource"?
The only configurations whoch smells like "javax.faces.resource" is this context param: javax.faces.FACELETS_RESOURCE_RESOLVER=oracle.adfinternal.view.faces.facelets.rich.AdfFaceletsResourceResolver
In web.xml various "resource" servlets is defined (I'm not sure whether I need them, JDeveloper has created them automatically):
a) resources = org.apache.myfaces.trinidad.webapp.ResourceServlet, maps to: /adf/*, /afr/*, /bi/*
b) adflibResources = oracle.adf.library.webapp.ResourceServlet, maps to: /adflib/*
I appreciate your help.

Similar Messages

  • How to include JavaScript in a list instance's form in Visual Studio

    So I know you can use JSLink to include JavaScript files in list definitions in Schema.<g class="gr_ gr_8 gr-alert gr_spell ContextualSpelling ins-del multiReplace" data-gr-id="8" id="8">xml</g> like so:
    <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" JSLink="~site/SiteAssets/Scripts/jquery-1.11.1.min.js" />
    But how can I do this with a list instance that I'm provisioning that's based on the tasks list definition? Is there somewhere I can include JSLink in the instance's Elements.xml?

    If you would have your own custom list definition, you could deploy a custom form for your list instance, and set the JSLink element of the Form. You cannot set it "globally" for the list, only per form.
    If your list instance is based on a built-in list instance (like Tasks in your case) you should set the JSLink property from code. If you would like to deploy the list instance and set the JSLink property from a .wsp package, you should lookup the list form
    and set this property from a feature receiver. If you already created / deployed the list instance, the simplest method is to set the property via PowerShell. See the code samples for PowerShell and C# in this thread.

  • How to include javascript in Edge?

    I am new to jQuery and Edge.
    I want to add some "Drag" functions to my project and I browsed the forum and found a javascript plugin. So I downloaded the js files and placed them in my project folder (the folder containing .an and .html)
    I searched the forum and found a way to include javascript which is adding the following code in compositonReady event
    $("<script type='text/javascript' charset='utf-8' src='myjs.js'>").appendTo("#Stage");
    and I replaced "myjs.js" with the plugin file name but it seems not working. When I view the html code there is only "MyProject_edgePreload.js" in it. Thanks for guiding me what's wrong here.

    Better tools are available: yepnope() and $.getScript().
    1) About yepnope(): you can download samples file here.
    2) $.getScript() is a jQuery function :  $.getScript("js fileName", function(){ your code });

  • How to include javascript and HTML in analysis output?

    Is there any document for that? Currently I set Treat Text As HTML under Data Format tab and include some simple HTML in Column formula, but I doubt it is correct way to include javascript and HTML in ayalysis output. Can anybody provide any idea or sample?
    Thanks

    Hi,
    i am not sure about javascript but yes treat text as Html is used to utilize HTML power in OBIEE.There are many examples of this.Common uses are a href,GoNav and PortalPagenav fuction.These function are mix of HTML and OBIEE.We gebrally use this option when we want to carry out some HTML operation on data rendered by OBIEE.Common example is to make data values a hyperlink for which we use a href
    See the below links for GoNav and a href
    http://108obiee.blogspot.com/2009/09/go-url-request-navigation-between.html
    Creating Hierarchies on Direct Database Requests
    You can also write java scripts here.
    Regards,
    Sandeep

  • How to include javascript file (.js) to pages in portal

    Hi,
    I have been trying to include a javascript file (something.js) to a portal. actually, I want to include it on a html portlet that will be my navigation page.
    I have used the code below to add the js file, but it seems not working
    <script language="JavaScript1.2" src="/javascript/cp_navigation.js">
    </script>
    I have uploaded the js file to the /ora9ias/enterprise/portal/javascript folder (created) in portal server. is there any configuration that I have left out?
    another thing, if I want to include some of the js file to the <head> section, am I possible to do it? and how?
    thanks

    Jerry,
    Where to find this? give the date or the name, please?
    *We're often desperate users that are under pressure to make these Oracle applications WORK for our employers!
    Your help in making us efficient is definitely appreciated!

  • Issue with firePartialAction or how to include JavaScript Functions

    We are using the Client Action Type: firePartialAction on an element in a region of type: TABLE. When a user enters data in here and tabs away, the action fires and recalculates 2 other fields in the same region. On a object with a small number of rows, it seems to work fine. However, when you have a large number of rows (anything over 25), the page seems to hang for nearly a minute and then when it does come back, the values are sometimes not calculated properly.
    The only reason we are using firePartialAction is because the dev guide says that JavaScript is not supported by OAF. We would much rather use a client-side JavaScript function to do these simple arithemtic operations rather than do them on the server.
    My question is two-fold:
    1 - Has anyone experienced this issue and are there any other settings or coding tricks that we should be aware of.
    2 - Has anyone ever rendered a page with a custom JavaScript tag (or library)? Also, where would you add the code in JDeveloper to get a particular element to execute a particulate javascript function (ie: onchange=MCalc())?

    The firePartialAction event is not working for us, so we need to be able to at least try out javascript. We're rendering the page from an XML file, so it's not clear to us how we would even get a custom HTML tag to render into the page at all. Normally, I'd use some kind of HttpServletResponse.getWriter()...println method call to write html (as in a controller servlet), but how would you do that using the OAWebBean? I checked the OAFromattedTextBean, would that allow me to embed onchange into the field?

  • How to include javascript on form load

    Hello,
    I am new to JDeveloper. I wanted to include multiple javascript files in a jspx file. Then involve one of the functions in the javascript file. Below is what I am trying to do, but seems like the syntax is wrong:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <html>
    <head>
    <script language='JavaScript' src='jslib/script1.js' type='text/javascript'></script>
    <script language='JavaScript' src='jslib/viewer.js' type='text/javascript'></script>
    </head>
    <body onload="javascript:initializeViewer()">
    <f:view>
    <af:document>
    <af:form></af:form>
    </af:document>
    </f:view>
    </body>
    </html>
    </jsp:root>
    When using firebugs, I realized that the page takes only the first js file. Also, the onload event is deleted.
    Thanks for any help

    The following blog post demonstrates this:
    http://thepeninsulasedge.com/blog/2007/06/22/adf-faces-rc-more-on-javascript/
    --RiC                                                                                                                                                                                                                                                                       

  • Tag library for cf8

    Can someone tell me where / how I can update dreamweaver
    cs3's tag library for coldfusion 8 tags? TIA!

    Darn it, I can't get it to install. I left message a while
    back about this but got no reply. The extension manager begins the
    install, puts files into a temp directory, but then halts with the
    message:
    "C:\Documents and Settings\myname\Local
    Settings\Temp\CF8_DW9_Ext_Final_mxi\TagLibraries\cfml\cfqueryparam.vtm"
    is missing'. The extension will not be installed."
    On checking the file IS there.
    Can anyone help me get this to install?
    Thanks in advance!
    Richard

  • How to add Weblogic 10.3 Thin-Client library to project?

    Dear All,
    Can anyone help me how to include Weblogic 10.3 Thin-Client library to project. I am wondering for the location of Weblogic 10.3 Thin-Client library, but unable to locate it.
    Thanks in advance.
    Best Regards
    Bilal

    Its done...
    Go to project properties -> libraries -> Add library -> Weblogic 10.3 Thin-Client.

  • How to include external JavaScript files

    Hello All,
    i'm wondering haow can i include externel JavaScrip files, there is an clip-example with a function in the same JSP file
    but not how to include a file?
    <body>
    <script language='JavaScript' src="menu/menu.js'></script>
    If some one has a clip i would appreciate.
    Thanks
    Gino

    <script src="resources/myscript.js"></script>
    I did this exact thing in my jsp but it did not work, nothing popped up.
    When I tried replacing it with:
    <script language="JavaScript" type="text/javascript"><![CDATA[
    function postMessage(message) {
    alert(message);
    ]]></script>
    It worked. Can someone tell me why? Can't i refer to javascript files this way?

  • How to include HTML file in JSP using HTML elements or Javascript?

    Hi,
    I have around 15000 static html files one for each item which we display each upon invoking an item.The HTML file should be part of a JSP file.
    Please note that the name of the HTML file is determined dynamically
    Placing all the HTML files within the web application does not give us good performance so i would like to put all of them in the webserver.
    I am not able to include the file in the JSP using the jsp:include attribute if i place the HTML files in the webserver ,
    in order to do that i think should use either HTML element or javascript to include the HTML in the JSP.is there any alternative to <Jsp:include>
    Does anyone have an idea how to include the HTML file and take advan tage of webserver?
    Any ideas are appreciated

    What you need to do is simply read the HTML file from the disk and dump it out to the outputstream. It really is that simple.
    There's no reason you need to include all 15000 files in the actual WAR, you can place those files any place handy that is easy for the application to see (in another directory, or accessible from a file server if you have multiple front ends).
    Then, just write a utiility function that takes the output stream (i.e. the 'out' JSP variable), and the file name, read the file, and write it to the stream.
    If you start noticing performance issues, then you can try doing some caching, but truth is your OS should be doing that for you.
    But, truth be told that's the only practical way to do it.
    Another solution would be to use JavaScriipt and XMLHttpRequest (i.e "AJAX") to load the file at the client side, and simply replace a tag with the results.
    That's also pretty trivial to write, any web site talking about AJAX should give you hint there.
    Of course, that won't work for folks who have JavaScript turned off, or some other incompatible browser, whereas the server side solution obviously works everywhere.

  • How to include resource files in the application and how to retrieve ?

    Hi,
    I want to include resource file in my application jar file and retrieve data from the file ......Is there any way for it? How i create these resources files and how i include them?.........Which classes shall i use for retrieving the data from these files?.........Any kind of help would be appreciated........Iam using NetBeans IDE 6.1,CLDC1.0 and MIDP 2.0........Thanx,in advance..........

    How i create these resources files and how i include them?How you create the files will depend on what resources you need to include.
    [How to ask questions the smart way|http://catb.org/~esr/faqs/smart-questions.html]
    db

  • How to include custom taglib in javascript on a given jsp page

    Hi,
    How to include custom taglib in javascript on a given jsp page?
    i have a jsp page on which i am adding selectboxes using javascript.
    But now i have created my own custom select box and want to add it on a given jsp page.
    is the code to create the box box.
    <sample:pickListOptions employeeId="abcs123"/>
    but how should i embed it in javascript, so that i will be able to add it on the give jsp page.
    Thanks,
    Javaqueue

    when the jsp page is loaded for the first time it contains a select box containg names created by a taglib.but there is a feature i want to add wherein though javascript the name selectebox will keep on coming on each row i want to add. and this is row addition and deletion is being handled by the javascript. there i encounter the bug how to interact the javascript with taglib so tha with each row addition i will have populated taglib created select box on each row.
    Thanks,
    Javaqueue

  • Component.getChilderen() does not include facelet tags

    Hi,
    I’m writing a function to export a dataTable to excel.
    Everything works fine! Except when my UIColumn has facelet tags inside.
    for (int nr = uiData.getFirst(); nr < uiData.getRowCount(); nr++) {
         List<UIComponent> children = abstractTableComponent.getChildren();
         xls.append("<tr>");
         for(UIComponent child : children){
              xls.append("<td>");
              xls.append(renderChild(new StringBuilder(), child));
              xls.append("</td>");
         xls.append("</tr>");
    public StringBuilder renderChild(StringBuilder builder, UIComponent component){
         builder.append(component.getAttributes().get("value"));
         if(component.getChildren() != null){
              for(UIComponent child : component.getChildren()){
                   renderChild(builder, child);
         return builder;
    }Example 1:
    <h:column>
    <f:facet name=”header”>
    email
    </f:facet>
    <h:outputText value=”#{e.person.email}” />
    </h:column>     
    Result: <table><tr><td>[email protected]</td></tr></table>
    Example 2:
    <h:column>
    <f:facet name=”header”>
    email
    </f:facet>
    #{e.person.email}
    </h:column>     
    Result: <table><tr><td></td></tr></table>
    #{e.person.email} is not converted a a component, so it doesn’t have a value.
    My question is how to get the value of a Facelets component.
    Thanks in advance,
    Pieter
    Edited by: Pieter_Pareit on Apr 19, 2010 5:34 AM

    I wouldn't call this a "Facelets Component", after all the issue is that it is not a component.
    My advice would be if you want to ensure that everything is available for manipulation via the component tree you ought to make sure everything is a component. You could make this a component by surrounding it with ui:component or ui:fragment or the like.

  • How to call javascript function with dynamic data in display tag

    Hi,
    Iam new to pagination concept. Iam using display tag to display rows in jsp by strtus.
    I have a problem when calling the javascript function using ahref in attribute in display tag.
    <bean:define name="form1" property="EditDetails.List" id="ListDisplay"/>
    <display:table name="pageScope.ListDisplay" cellpadding="0" cellspacing="1" pagesize="10" partialList="false" size="listSize" requestURI="">
    <display:column property="poNo" href='javascript:searchEditDetails("./submitOrder.do? actionID=getMISLoadEdit&poNumberSel=<%=((com.po.bean.EditDetails)poListDisplay).getNo()%>&statusIdSelected=<%=((com.po.bean.EditDetails)ListDisplay).getStatusId()%>")'
    title="Number"/>                         
    <display:column property="strDate"title="Date" />
    <display:column property="orderValue"title="Order Value(INR)"/>
    <display:column property="stringRequestedDeliveryDate"title="Suggested Delivery Date"/>
    <display:column property="statusDescription" title="Status" />
    </display:table>
    The above code display the data in row format is working fine when I click the No It thow javascript error and its not redirecting to the other page.
    When I try this with ordinary struts its working fine the code is:
    <logic:iterate id="polist" name="Form1" property="EditDetails.List" indexId="i" type="com.bean.EditDetails">
    <tr>
    <td ><a href="javascript:searchEditDetails("./submitOrder.do?actionID=getMISLoadEdit&NumberSel=<%=((com.bean.EditDetails)polist).getNo()%>&statusIdSelected=<%=((com.bean.EditDetails)polist).getStatusId()%>")"><html:hidden name="polist" property="No" write="true" /></a>     </td>
    <td><html:hidden name="polist" property="strDate" write="true" /></td>
    <td><html:hidden name="polist" property="orderValue" write="true" /></td>
    <td><html:hidden name="polist" property="stringRequestedDeliveryDate" write="true" />     </td>
    <td><html:hidden name="polist" property="statusDescription" write="true" /></td>
    </tr>
    </logic:iterate>
    Please help me how to call javascript with dynamic data.
    Thanks in advance

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

Maybe you are looking for

  • Invoice and foreing trade

    Hi, Create billing document (2 delivery- need 1 invoice) split analy.: Split due to differing header data: Number of foreign trade (EIKP-EXNUM) how we can create 1 invoice? thanks.

  • How to close goods receipt PO

    Hi All, We are using SAP 8.8 how to close Goods Receipt PO that has been pulled to A/P Invoice with a partial amount of freight ? i.e. Our GRPO has freight 5000. On pressing COPY FROM button in A/P invoice we selected that GRPO On Pressing Customize

  • Pasting from Photoshop into InDesign

    Platform: Windows XP Software: Photoshop CS2 Illustrator CS2 How do I paste Photoshop Images into InDesign without any surrounding pixels except for the image? Thanks.

  • PLS-00307: too many declarations of 'TO_CHAR' match this call

    Hi, I've got the error "PLS-00307: too many declarations of 'TO_CHAR' match this call" when I test to run a dynamic page portlet. Someone helps? Thanks.

  • Can't find movie files that are eating up my memory

    I have a MacBook Pro (Retina, 13 inch, Late 2012) and last week I kept getting notifications that my memory was almost full so I checked out "Storage" under "About this Mac" and it showed that about 120 GB were being taken up by movies. I removed all