Frank Nimphius
ADF Faces RC: How-to cancel an edit form, undoing the edits
Two strategies exist to implement a cancel button for an ADF Faces / ADF edit form that uses client-side and server side validation: a) a bounded taskflow restoring the previous state with a declarative savepoint and b) a client Java method exposed on the ADF Business Component business service. Both strategies are similar in that they use the immediate property on a ADF Faces command button to cancel the edit, but are different in their implementation of the data clean-up. When discussing the problem with Steve Muench, he came up with the the declarative approach that uses a bounded taskflow to clean up the data modification when cancel is pressed. Its a straight forward approach that is easy understand and implement. Especially when re-use is not a requirement, the declarative feature might be seen to complex for such a little functionality, which is why in this how-to document we document the simpler Java version as well. This how-to document describes one of the two options available to cancel an edit form in ADF Faces RC without a required field message being raised by the client validator. Canceling an edit form with ADF requires more than just setting the immediate property set to true on the command button. It requires some housekeeping for the changes performed on the ADF binding layer.
JDeveloper 11 - InputDate: How-to set the default year in the date popup
Before starting I should mention that this is a JavaScript hack that depends on the knowledge of how the af:inputDate component renders in the browser. This means however that there is a risk attached to it that this solution stops working in a future release of ADF Faces RC if the generated component HTML markup changes. So be aware !
A quite common usecase is that users like to pre-set the year of the calendar popup for the af:inputDate field when there is no default value set. You can do this with the following JavaScript solution that sets the selected year to 1966.
PLAIN TEXT CODE:- <f:view>
- <af:document id="d1">
- <f:facet name="metaContainer">
- <trh:script>
- function setYearOnDate(){
- var input = document.getElementById("mdate::pop::cd::ys::content");
- input.value="1966";
- }
- </trh:script>
- </f:facet>
- <af:form id="f1">
- <af:inputDate label="Label 1" id="mdate" minValue="2008-01-19">
- <af:clientListener method="setYearOnDate" type="blur"/>
- </af:inputDate>
- </af:form>
- </af:document>
- </f:view>
The key to this is that the af:inputDate filed has a custom ID defined (which is "mdate" in this example). Based on this infromation, its possible to find and set the year field of the component using the document.getElementById API. An extended version of this preserves existing dates, like the default date and looks as follows
PLAIN TEXT CODE:- <f:view>
- <af:document id="d1">
- <f:facet name="metaContainer">
- <trh:script>
- function setYearOnDate(){
- var input = document.getElementById("mdate::pop::cd::ys::content");
- var dateComp = AdfPage.PAGE.findComponent("mdate");
- if (dateComp.getSubmittedValue().length == 0){
- input.value="1966";
- }
- }
- </trh:script>
- </f:facet>
- <af:form id="f1">
- <af:inputDate label="Label 1" id="mdate">
- <af:clientListener method="setYearOnDate" type="blur"/>
- </af:inputDate>
- </af:form>
- </af:document>
- </f:view>
Frank
Updated Glasspane example in ADF Faces RC with native functionality example
Shortly before JDeveloper 11 went production, a new feature sneaked it that provides a JavaScript contract for a native glass pane in ADF Faces RC. I just got reminded of this feature by a recent post on the OTN forum. I updated the glass pane article on the ADF Code Corner website with this information so you find it all in a single place.
Frank
How-to declaratively create new table rows based on the existing current row content
A frequent requirement posted on the Oracle JDeveloper forum on OTN is to create new rows in a table based on the copy of an existing row. Using the new CreateWithParams operation exposed on the ADF Business Components ViewObject this task becomes fully declarative in Oracle JDeveloper 11. This blog article provides instructions on how to achieve the goal.
How-to build dependent, model driven list of values in ADF Swing
In JDeveloper 10.1.3, the sole option to create a list of value is a manual configuration that associated the list VO with the source attribute that consumes the returned value. In JDeveloper 11, a new features of the business component framework allows developers to define the list of values within the View Object for a more consistent implementation with less overhead in the bindings. In this how-to we show how to configure model based list of values in ADF Swing so that two list of values operate in dependency from each other. Selecting a department in the first list will limit the list of employees returned from the second LOV
How-to configure OID for authentication in WebLogic Server
A frequent question posted on the Oracle Technology Network (OTN) forum for Oracle JDeveloper 11 is how to configure the Oracle Internet Directory (OID) as an authentication provider in WebLogic Server. This how-to document aims to answer this question for container managed authentication and authorization.
Oracle Packs AJAX Session in Silicon Valley in the Midst of Historical 2008 Recession
Seems as if Oracle rocked the 6th International AJAX World RIA Conference & Expo in San Jose. Pieter Humphrey from our team presented the Ajax stack we have in stock for the enterprise developer. I am not surprised we got them impressed as it seems that we are coming out great and just in time with our release of JDeveloper 11.
Frank
ADF Security - Authorization
The third of five camtesia videos that cover ADF Security is online. This third mini lesson talks about how to configure authorization in ADF Security in JDeveloper 11
[Watch it]
1 Container Managed Security
2 ADF Security Overview
3 ADF Security Authorization
4 Security Expressions
5 ADF BC Security
Frank
ADF Code Corner
ADF Security: Authentication and Setup
The second of five camtesia videos that cover ADF Security is online. This second mini lesson talks about how to configure ADF Security in JDeveloper 11g and how authentication is handled
1 Container Managed Security
2 ADF Security Overview
3 ADF Security Authorization
4 Security Expressions
5 ADF BC Security
Frank
ADF Code Corner
ADF Code Corner - Started New Mini Series about ADF Security
The longest journey starts with a first step.
Today I uploaded the first of five camtesia video to cover ADF Security. ADF Security always came a bit short when we talked about JDeveloper 11 because we had to hold back on this until the new architecture was ready for prime. The first mini lesson talks about container managed security with JDeveloper and WebLogic Server.
1 Container Managed Security
2 ADF Security Overview
3 ADF Security Authorization
4 Security Expressions
5 ADF BC Security
Frank
ADF Code Corner
JDeveloper 11 production is here - Keep our browsers pointing to OTN
After more than two years of development, today seems to be when JDeveloper 11 production sees light of day. All OTN staging seem to work okay and the release should appear ready for download by around 9:30 am PST (which is 5:30 pm GMT) on the JDeveloper home page on OTN.
You have the option to download either an executable or a jar file, both starting off the JDeveloper WLS installer. For those using the JAR file, make sure you have a minimum of JDK 1.6_5 in the path before issuing the
java -jar jdevstudio11110install.jar
The installer will come up shortly after, leading you through all the installation steps, finishing with a ready-to-go completely configured JDeveloper 11 / WLS 10.3 environment. The major change in the production release, compared to the Technology previews is that WLS replaces OC4J.
When you hit the run command on a web page, this will start off WLS the same way as you are used to have it with OC4J. To access the WLS configuration console - once the server is started - issue localhost:7101/console in your browser and connect as weblogic/weblogic
Important: Now that we are production, the OTN forum to use for JDeveloper 11 related questions becomes http://forums.oracle.com/forums/forum.jspa?forumID=83, which means we are back to a single forum (one that rules them all
)
Please make sure that you flag your question with the version of JDeveloper you post the question for. This makes it easier for all of us who answer questions.
Frank
ADF Code Corner Internet TV is here !
How to blog about complete end-to-end development processes in JDeveloper without getting lost in writing ?
How to blog about functionality that as a topic is too short to write up ?
The solution is Internet TV, or stream by demand (you name it). In JDeveloper Product Management we use Camtesia for recording our online demos and I think it is a good format to use for the new ADF Code Corner Intern TV as well. So it is not really Internet TV, but the content is narrated and the demos show the flow as good as possible within 5 minutes (which is the max. length I defined for the code corner samples).
The first recording is a demonstration of an OBE I am creating for a partner training that Shaun O’Brian in our team works on. It shows the creation of bookmarkable view activities in an unbounded taskflow.
Frank
How-to extend the default ADF Faces Component Message Bundle
When working with ADF Faces RC, many component uses default labels, tool tips and validation messages that are not customizable through their properties. To customize the default labels, developers need to implement a custom skin, which for this usecase does not have to define a custom look and feel. To change the default messages, like the initial “Loading…” message shown with the splash screen, you need to know about the message keys used by the components. The keys, as well as skinning guides, are available online at otn.oracle.com/products/jdev, but for the special usecase of changing the default messages, this how-to is all you need.


