Monday Dec 17, 2012

Accessing ADF Faces components that are read-only from JavaScript

Almost as a note to myself and to justify the time I spent on analyzing aproblem, a quick note on what to watch out for when working trying to access read-only ADF Faces components from JavaScript. 

Those who tried JavaScript in ADF Faces probably know that you need to ensure the ADF Faces component  is represented by a JavaScript object on the client. You do this either implicitly by adding an af:clientListener component (in case you want to listen for a component event) or explicitly by setting the ADF Faces component clientComponent property to true.

For the use case I looked at in JDeveloper 11g R1 (11.1.1.7) I needed to make an output text component clickable to call a JavaScript function in response. Though I added the af:clientListener tag to the component I recognized that it also needed the clientComponent property set to true.

Though I remember this as not being required in 11.1.1.6, I like the new behavior as it helps preventing read-only components from firing client side events unless you tell it to do so by setting the clientComponent property to true.

Note: As the time of writing, JDeveloper 11.1.1.7 is not publicly available and I put the note in this blog as a reminder in case you ever hit a similar challenge so you know what to do.


Tuesday Jul 31, 2012

Warning: java.lang.IllegalArgumentException: The file .jsff is not a source file

Randomly I experienced the following error when working with JSFF page fragments in JDeveloper 11g R2 (11.1.2.2):

Warning: java.lang.IllegalArgumentException: The file file:<directory listed here>\DepartmentsView.jsff is not a source file

This happened when I compiled the project. As it seems the compiler treats JSFF page fragments as Java source files. This issue has been reported as bug 12732652 for applications using Facelets as the page source holder. The fix for both cases, JSF pages as JSPX and Facelets, is to edit the web.xml file as follows

  <!-- 
  * WORK AROUND
  * randomly, when editing files, compilation fails with an illegal argument exception
  * java.lang.IllegalArgumentException: The file <file name> .jsff is not a source file
  * To avoid this error, which initially has been reported as bug 12732652 for Facelets
  * I added the jsp-property-group entry below
 -->
 <jsp-config>
  <jsp-property-group> 
    <url-pattern>*.jsff</url-pattern>
    <is-xml>true</is-xml>
   </jsp-property-group>
  </jsp-config>
 <!-- 
  * END WORK AROUND
  -->

Just add the above snippet before the " <mime-mapping>" entry in web.xml. At least for me, this did the trick

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