Using af:resource tag in page fragments

The af:resource tag is an ADF Faces tag that allows developers to add or reference JavaScript and CSS resources from a page. Given that ADF Faces uses the skinning framework for applying CSS, the use of the af:resource tag to reference or add JavaScript is more common.

The tag documentation mistakenly states that the af:resource tag should be a direct child of the af:document tag, which excluded its use in page fragments, which appeared limiting for developers that use JavaScript in ADF regions. So far the recommendation was to use the trh:script tag instead, which then added another tag library dependency to the project.

So the official stance thus is that you can use af:resource in page fragments as well. The JavaScript sources then load when the page fragment loads.

Comments:

Post a Comment:
Comments are closed for this entry.
About

The Oracle JDeveloper forum ranks in the Top 5 of the most active forums on the Oracle Technology Network (OTN).



The OTN Harvest blog is a summary of selected topics posted on the OTN Oracle JDeveloper forum.



It is an effort to turn knowledge exchange into an interesting read for developers who enjoy little nuggets of wisdom





Frank Nimphius

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today