Skip to main content

Posts

Showing posts with the label ADF 11g Quicky

ADF 11g Quicky 4 : Where is my cursor ?

In my current project I encountered a usability issue. The users where unable to see where the cursor was located. It was flickering, but on a page with ,multiple input components it was very difficult to locate the field where the cursor was located. I decided to help them out and that proofed to be both very simple and in the end very helpful. I used skinning to give the active field a colored background. First I defined a skin in my trinidad-config.xml <?xml version="1.0" encoding="windows-1252" ?> <skins xmlns="http://myfaces.apache.org/trinidad/skin"> <skin> <id>custom.desktop</id> <family>custom</family> <extends>fusion.desktop</extends> <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id> <style-sheet-name>skin/custom.css</style-sheet-name> </skin> </skins> Next I made sure that the application uses the skin by defining it in the...

ADF 11g Quicky 3 : Adding Error, Info and Warning messages

How can we add a message programatically ? Last week I got this question for the second time in a months time. I decided to write a short blogpost on how this works. Adding messages is very easy, you just need to know how it works. You can add a message to your faces context by creating a new FacesMessage. Set the severity (ERROR, WARNING, INFO or FATAL ), set the message text, and if nessecary a message detail. The fragment below shows the code for an ERROR message. 1: public void setMessagesErr(ActionEvent actionEvent) { 2: String msg = "This is a message"; 3: AdfFacesContext adfFacesContext = null; 4: adfFacesContext = AdfFacesContext.getCurrentInstance(); 5: FacesContext ctx = FacesContext.getCurrentInstance(); 6: FacesMessage fm = 7: new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, ""); 8: ctx.addMessage(null, fm); 9: } I created a simple page with a couple of buttons to show the result of setting the message. When the but...

ADF 11g Quicky 2 - Set Focus on MouseOver Event

Another Quick solution here. What if I want to set focus on a field without actually having to click it ? This can be done by using a clientListeners and some java script code. 1: <?xml version='1.0' encoding='UTF-8'?> 2: <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" 3: xmlns:f="http://java.sun.com/jsf/core" 4: xmlns:h="http://java.sun.com/jsf/html" 5: xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> 6: <jsp:directive.page contentType="text/html;charset=UTF-8"/> 7: <f:view> 8: <af:document> 9: <af:resource type="javascript"> 10: function makeActive(event){ 11: event.getSource().focus(); 12: } 13: </af:resource> 14: <af:form id="f1"> 15: <af:inputText label="Label 1" id="it1"> 16: <af:clientListener type="mouseOver...

ADF 11g Quickies - A new series of posts

As an ADF consultant I get lots and lots of questions on ADF (duh..). I usually answer these using a simple sample and some explanations. These effort are hardly ever documented by me. I decided to use this Blog to write all these tiny things down for future 'ADF generations'. From now on this Blog will host ADF 11g Quickies.