Sunday, 15 May 2011

Real “ToolTip” for OAF GUI Elements

My goal is very simple. I want when my mouse hover over some element to display a simple tooltip that shows some message and disappear after mouse is moved away. However there is no such thing in OAF. Oracle built something that is called Tip  Message. It is a message that appears bellow/near specific GUI element and doesn’t disappear.

The solution is very simple.

For example you, have a textfield element called “PrinterName” . Get a reference to this object and attach a java script command by using onMouseOver  event.

public void processRequest(OAPageContext pageContext, OAWebBean webBean)
 {
   super.processRequest(pageContext, webBean);
  
 
   OAMessageTextInputBean msgPrinterName2 = (OAMessageTextInputBean)pageContext.getPageLayoutBean().findChildRecursive("PrinterName");
   if (msgPrinterName2!=null)
      msgPrinterName2.setOnMouseOver("this.title='This is my tooltip';");

No comments:

Post a Comment