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

A blog on Oracle JDeveloper, ADF, MAF, MCS and other mobile and web topics inspired by questions and answers posted on the OTN forums.



Frank Nimphius

Search

Archives
« March 2015
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
31
    
       
Today