org.apache.myfaces.custom.dialog
Class ModalDialog

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIPanel
              extended by org.apache.myfaces.custom.dialog.AbstractModalDialog
                  extended by org.apache.myfaces.custom.dialog.ModalDialog
All Implemented Interfaces:
javax.faces.component.StateHolder, org.apache.myfaces.custom.dojo.DojoWidget

public class ModalDialog
extends AbstractModalDialog


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String DEFAULT_RENDERER_TYPE
           
 
Constructor Summary
ModalDialog()
           
 
Method Summary
 java.lang.Boolean getCloseButton()
          Specifies whether there should be a "close" icon to the right of the popup window title.
 java.lang.String getContentURL()
          The URL to show within the content area of the dialog.
 java.lang.String getDialogAttr()
          A space separated list with attribute='value' pairs, which control the behaviour of the dojo dialog.
 java.lang.String getDialogId()
          An optional raw id to assign to the html div that encloses the modal dialog.
 java.lang.String getDialogTitle()
          The title text to show in the title area of the popup window (ie the "window decoration").
 java.lang.String getDialogVar()
          Specifies the name of the javascript variable which provides access to the dialog functionality.
 java.lang.String getFamily()
           
 java.lang.String getHiderIds()
          A list of ids of components which, when activated, should cause the popup dialog to be hidden.
 java.lang.String getStyle()
          HTML: CSS styling instructions.
 java.lang.String getStyleClass()
          The CSS class for this element.
 java.lang.String getViewId()
          The URL of the view to show within the content area of the dialog.
 java.lang.String getWidgetId()
          Optional enforced dojo widgetId
 void restoreState(javax.faces.context.FacesContext facesContext, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
           
 void setCloseButton(java.lang.Boolean closeButton)
           
 void setContentURL(java.lang.String contentURL)
           
 void setDialogAttr(java.lang.String dialogAttr)
           
 void setDialogId(java.lang.String dialogId)
           
 void setDialogTitle(java.lang.String dialogTitle)
           
 void setDialogVar(java.lang.String dialogVar)
           
 void setHiderIds(java.lang.String hiderIds)
           
 void setStyle(java.lang.String style)
           
 void setStyleClass(java.lang.String styleClass)
           
 void setViewId(java.lang.String viewId)
           
 void setWidgetId(java.lang.String widgetId)
           
 
Methods inherited from class org.apache.myfaces.custom.dialog.AbstractModalDialog
getRendersChildren, getWidgetVar, setWidgetVar
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

DEFAULT_RENDERER_TYPE

public static final java.lang.String DEFAULT_RENDERER_TYPE
See Also:
Constant Field Values
Constructor Detail

ModalDialog

public ModalDialog()
Method Detail

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class javax.faces.component.UIPanel

getDialogAttr

public java.lang.String getDialogAttr()
Description copied from class: AbstractModalDialog
A space separated list with attribute='value' pairs, which control the behaviour of the dojo dialog.

Specified by:
getDialogAttr in class AbstractModalDialog

setDialogAttr

public void setDialogAttr(java.lang.String dialogAttr)

getDialogId

public java.lang.String getDialogId()
Description copied from class: AbstractModalDialog
An optional raw id to assign to the html div that encloses the modal dialog.

This id can be useful for controlling the dialog with javascript. However in most cases it is not necessary.

If this is property is not defined then an id will be automatically generated.

Specified by:
getDialogId in class AbstractModalDialog

setDialogId

public void setDialogId(java.lang.String dialogId)

getDialogVar

public java.lang.String getDialogVar()
Description copied from class: AbstractModalDialog
Specifies the name of the javascript variable which provides access to the dialog functionality.

For example, if this is "myDialog" then a javascript object with name "myDialog" will be defined. This exposes the following methods:

Specified by:
getDialogVar in class AbstractModalDialog

setDialogVar

public void setDialogVar(java.lang.String dialogVar)
Specified by:
setDialogVar in class AbstractModalDialog

getHiderIds

public java.lang.String getHiderIds()
Description copied from class: AbstractModalDialog
A list of ids of components which, when activated, should cause the popup dialog to be hidden.

If the standard title-bar is displayed (ie no custom titleBar facet exists, and property dialogTitle is defined) then the standard close-button in that bar is automatically included.

If the child components of this component (which will appear in the popup) include other items that should cause the window to close (ie a button) then their ids should be defined via this property. This component will then automatically wire them up to the necessary functions to cause the popup to be closed when they are activated.

Specified by:
getHiderIds in class AbstractModalDialog

setHiderIds

public void setHiderIds(java.lang.String hiderIds)

getViewId

public java.lang.String getViewId()
Description copied from class: AbstractModalDialog
The URL of the view to show within the content area of the dialog.

Optional; when not defined (or defined as an EL expression, but that expression returns null) then the popup dialog will be opened with no content. Presumably custom javascript in the calling page will arrange to populate the window content appropriately.

The modalDialog component treats this as a url relative to the webapp base. The value should not start with a slash.

Note that technically this value is not a viewId. A viewId is the internal path to the page definition (eg "foo.jsp" or "foo.xhtml"). What the browser accesses is a URL (which contains the path that triggers the facelets servlet, eg "foo.faces" or "foo.jsf" or "/faces/foo".

The valueIt should not start with a slash.

Specified by:
getViewId in class AbstractModalDialog

setViewId

public void setViewId(java.lang.String viewId)

getContentURL

public java.lang.String getContentURL()
Description copied from class: AbstractModalDialog
The URL to show within the content area of the dialog.

This may be:

Specified by:
getContentURL in class AbstractModalDialog

setContentURL

public void setContentURL(java.lang.String contentURL)

getStyle

public java.lang.String getStyle()
Description copied from class: AbstractModalDialog
HTML: CSS styling instructions.

Specified by:
getStyle in class AbstractModalDialog

setStyle

public void setStyle(java.lang.String style)

getStyleClass

public java.lang.String getStyleClass()
Description copied from class: AbstractModalDialog
The CSS class for this element. Corresponds to the HTML 'class' attribute.

This value is also used as a base for defining style classes for parts of the standard window "title bar" decoration.

Specified by:
getStyleClass in class AbstractModalDialog

setStyleClass

public void setStyleClass(java.lang.String styleClass)

getWidgetId

public java.lang.String getWidgetId()
Description copied from class: AbstractModalDialog
Optional enforced dojo widgetId

Specified by:
getWidgetId in interface org.apache.myfaces.custom.dojo.DojoWidget
Specified by:
getWidgetId in class AbstractModalDialog

setWidgetId

public void setWidgetId(java.lang.String widgetId)

getDialogTitle

public java.lang.String getDialogTitle()
Description copied from class: AbstractModalDialog
The title text to show in the title area of the popup window (ie the "window decoration").

Ignored if there is a "titleBar" facet as a child.

Specified by:
getDialogTitle in class AbstractModalDialog

setDialogTitle

public void setDialogTitle(java.lang.String dialogTitle)

getCloseButton

public java.lang.Boolean getCloseButton()
Description copied from class: AbstractModalDialog
Specifies whether there should be a "close" icon to the right of the popup window title.

Ignored if there is a "titleBar" facet as a child, or dialogTitle is not defined.

Defaults to true.

Specified by:
getCloseButton in class AbstractModalDialog

setCloseButton

public void setCloseButton(java.lang.Boolean closeButton)

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIComponentBase

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIComponentBase


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.