com.mizar.adfrichfaces
Class ADFUtils

java.lang.Object
  extended by com.mizar.adfrichfaces.ADFUtils

public class ADFUtils
extends java.lang.Object


Constructor Summary
ADFUtils()
           
 
Method Summary
static void addPartialTarget(java.lang.String id)
          The method calls ADFUtils.findComponent to find the UIComponent to pass to AdfFacesContext.getCurrentInstance().addPartialTarget with the appropriate bail outs if anything returns null.
static void closePopup(java.lang.String popupId)
          Deprecated. 
static void closePopup(javax.faces.component.UIComponent popupComponent)
          This method will close a popup dialog.
static void closePopup2(java.lang.String popupId)
          This method will close a popup dialog.
static void closePopupByTraverse(javax.faces.component.UIComponent originComponent)
          This method will close a popup dialog.
static void generateColumnsForTable(org.apache.myfaces.trinidad.component.UIXTable table, GenericBean bean)
           
static java.lang.String getClientAttributeValue(java.lang.String name, javax.faces.component.UIComponent component)
          Returns the String value of an <af:clientAttribute /> of the given name
static java.util.Map getPageFlowScope()
           
static void launchApprovalDialog(java.lang.String title, java.lang.String remark, javax.faces.component.UIComponent source)
          This is here largely for compatibility with older code.
static void launchApprovalDialog(java.lang.String title, java.lang.String remark, javax.faces.component.UIComponent source, java.util.HashMap userProps)
          This is here largely for compatibility with older code.
static void launchDialog(javax.faces.event.ActionEvent ae)
           
static void launchDialog(javax.faces.event.FacesEvent ae)
           
static void launchDialogInTab(javax.faces.event.ActionEvent ae)
           
static void launchHtmlNoteDialog(java.lang.String title, java.lang.String htmlFile, javax.faces.component.UIComponent source)
          Create a pop-up approval dialog box using /popups/ApprovalDialog.jspx as the template.
static void launchMessageDialog(java.lang.String title, java.lang.String remark)
          This is here largely for compatibility with older code.
static void launchPage(java.lang.String jspxFileName, javax.faces.component.UIComponent source)
          This is here largely for compatibility with older code.
static void resetSelectedSingleRowKey(TrinidadTable table, RowInterface row)
           
static void setCurrentRowFromTableSelection(TrinidadTable table, org.apache.myfaces.trinidad.event.SelectionEvent event)
          A utility method to set the current work unit row in a TrinidadTable class to the row that is selected by the recipient in a ADFRichTable
static void setSelectedSingleRowKey(TrinidadTable table, RowInterface row)
           
static void showPopup(java.lang.String popupId)
          Displays a pop-up
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ADFUtils

public ADFUtils()
Method Detail

getPageFlowScope

public static java.util.Map getPageFlowScope()

launchDialog

public static void launchDialog(javax.faces.event.ActionEvent ae)

launchDialog

public static void launchDialog(javax.faces.event.FacesEvent ae)

launchDialogInTab

public static void launchDialogInTab(javax.faces.event.ActionEvent ae)

closePopup

public static void closePopup(javax.faces.component.UIComponent popupComponent)
This method will close a popup dialog. The method is necessary when a af:dialog contains a button panel instead of the standard OK and Cancel buttons.

Parameters:
popupComponent -
See Also:
closePopup(String)

closePopupByTraverse

public static void closePopupByTraverse(javax.faces.component.UIComponent originComponent)
This method will close a popup dialog. The method is necessary when a af:dialog contains a button panel instead of the standard OK and Cancel buttons, it will start with the button component and keep looking for popup in ancestors until the popup component is found

Parameters:
originComponent -
See Also:
closePopup(String)

closePopup

@Deprecated
public static void closePopup(java.lang.String popupId)
Deprecated. 

This method will close a popup dialog. The method is necessary when a af:dialog contains a button panel instead of the standard OK and Cancel buttons.

Parameters:
popupId - the component id of the popup to close
See Also:
closePopup(UIComponent)

closePopup2

public static void closePopup2(java.lang.String popupId)
This method will close a popup dialog. This function uses the more advanced MIZAR.adf.getComponent() JS call to find the pop-up The method is necessary when a af:dialog contains a button panel instead of the standard OK and Cancel buttons.

Parameters:
popupId - the component id of the popup to close
See Also:
closePopup(UIComponent)

showPopup

public static void showPopup(java.lang.String popupId)
Displays a pop-up

Parameters:
popupId -

launchPage

public static void launchPage(java.lang.String jspxFileName,
                              javax.faces.component.UIComponent source)
This is here largely for compatibility with older code. If you are using ADF Rich Client Faces you should be using a af:popup not this.

Parameters:
jspxFileName -
source -

launchApprovalDialog

public static void launchApprovalDialog(java.lang.String title,
                                        java.lang.String remark,
                                        javax.faces.component.UIComponent source,
                                        java.util.HashMap userProps)
This is here largely for compatibility with older code. If you are using ADF Rich Client Faces you should be using a af:popup not this.

Parameters:
title -
remark -
source -
userProps -

launchApprovalDialog

public static void launchApprovalDialog(java.lang.String title,
                                        java.lang.String remark,
                                        javax.faces.component.UIComponent source)
This is here largely for compatibility with older code. If you are using ADF Rich Client Faces you should be using a af:popup not this. Create a pop-up approval dialog box using /popups/ApprovalDialog.jspx as the template

Parameters:
title - A plain-text title
remark - A narrative that may be in HTML
source - An optional originating component, required if a returnListener is registered. Will cause the Approve button to appear.

launchMessageDialog

public static void launchMessageDialog(java.lang.String title,
                                       java.lang.String remark)
This is here largely for compatibility with older code. If you are using ADF Rich Client Faces you should be using a af:popup not this. Create a pop-up approval dialog box using /popups/ApprovalDialog.jspx as the template. The Approve button will not appear as no source is defined.

Parameters:
title - A plain-text title
remark - A narrative that may be in HTML
See Also:
launchApprovalDialog(String,String,UIComponent)

launchHtmlNoteDialog

public static void launchHtmlNoteDialog(java.lang.String title,
                                        java.lang.String htmlFile,
                                        javax.faces.component.UIComponent source)
Create a pop-up approval dialog box using /popups/ApprovalDialog.jspx as the template.

Parameters:
title - A plain-text title
htmlFile - a file in the htmlNoteFolder to be used as remark for pop-up.
source - An optional originating component, required if a returnListener is registered. Will cause the Approve button to appear.
See Also:
launchApprovalDialog(String,String,UIComponent), ServletUtils.readFromRelativeFile(java.lang.String), ApplicationConstants.getHtmlNoteFolder()

addPartialTarget

public static void addPartialTarget(java.lang.String id)
The method calls ADFUtils.findComponent to find the UIComponent to pass to AdfFacesContext.getCurrentInstance().addPartialTarget with the appropriate bail outs if anything returns null.

Parameters:
id - of the component to add as a partial target Note: id can be a string of multiple targets delimited by white space

getClientAttributeValue

public static java.lang.String getClientAttributeValue(java.lang.String name,
                                                       javax.faces.component.UIComponent component)
Returns the String value of an <af:clientAttribute /> of the given name

Parameters:
name - name of the <af:clientAttribute /> element
Returns:
String value of the <af:clientAttribute /> element

generateColumnsForTable

public static void generateColumnsForTable(org.apache.myfaces.trinidad.component.UIXTable table,
                                           GenericBean bean)

setCurrentRowFromTableSelection

public static void setCurrentRowFromTableSelection(TrinidadTable table,
                                                   org.apache.myfaces.trinidad.event.SelectionEvent event)
A utility method to set the current work unit row in a TrinidadTable class to the row that is selected by the recipient in a ADFRichTable

Parameters:
table - (TrinidadTable) the table class
event - (SelectionEvent) the event sent by the SelectionListener from the ADFRichTable

setSelectedSingleRowKey

public static void setSelectedSingleRowKey(TrinidadTable table,
                                           RowInterface row)

resetSelectedSingleRowKey

public static void resetSelectedSingleRowKey(TrinidadTable table,
                                             RowInterface row)