org.kuali.rice.krad.web.form
Class UifFormBase

java.lang.Object
  extended by org.kuali.rice.krad.web.form.UifFormBase
All Implemented Interfaces:
Serializable, ViewModel
Direct Known Subclasses:
CacheAdminForm, CourseOfferingForm, DocumentFormBase, IncidentReportForm, IngesterForm, InitiatedDocumentInfoForm, InquiryForm, KradSampleAppForm, LookupForm, RegistrationForm, StatsForm, TrainingApplicationForm, UifComponentsTestForm, UifDialogTestForm, UITestForm

public class UifFormBase
extends Object
implements ViewModel

Base form class for views within the KRAD User Interface Framework

Holds properties necessary to determine the View instance that will be used to render the UI

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
protected  Map<String,String> actionParameters
           
protected  List<Object> addedCollectionItems
           
protected  boolean ajaxRequest
           
protected  String ajaxReturnType
           
protected  org.springframework.web.multipart.MultipartFile attachmentFile
           
protected  Map<String,Object> clientStateForSyncing
           
protected  boolean defaultsApplied
           
protected  String dialogExplanation
           
protected  DialogManager dialogManager
           
protected  String dialogResponse
           
protected  String focusId
           
protected  History formHistory
           
protected  String formKey
           
protected  String formPostUrl
           
protected  String growlScript
           
protected  String jumpToId
           
protected  String jumpToName
           
protected  String lightboxScript
           
protected  String methodToCall
           
protected  Map<String,Object> newCollectionLines
           
protected  String pageId
           
protected  View postedView
           
protected  List<String> readOnlyFieldsList
           
protected  boolean renderedInLightBox
           
protected  boolean requestRedirected
           
protected  String returnFormKey
           
protected  String returnLocation
           
protected  Map<String,Set<String>> selectedCollectionLines
           
protected  String state
           
protected  String updateComponentId
           
protected  View view
           
protected  String viewId
           
protected  String viewName
           
protected  Map<String,String> viewRequestParameters
           
protected  UifConstants.ViewType viewTypeName
           
 
Constructor Summary
UifFormBase()
           
 
Method Summary
protected  String generateFormKey()
          Creates the unique id used to store this "conversation" in the session.
 String getActionEvent()
          Returns the action event that was sent in the action parameters (if any)
 String getActionParamaterValue(String actionParameterName)
          Retrieves the value for the given action parameter, or empty string if not found
 Map<String,String> getActionParameters()
          Map of parameters sent for the invoked action
 Properties getActionParametersAsProperties()
          Returns the action parameters map as a Properties instance
 List getAddedCollectionItems()
          The List that contains all newly added items for the collections on the model
 String getAjaxReturnType()
          Gets the return type for the ajax call
 org.springframework.web.multipart.MultipartFile getAttachmentFile()
          Holder for files that are attached through the view
 Map<String,Object> getClientStateForSyncing()
          Map that is populated from the component state maintained on the client
 String getDialogExplanation()
          Returns the String entered by the user when presented a dialog
 DialogManager getDialogManager()
          Gets the DialogManager for this view/form
 String getDialogResponse()
          Represents the option chosen by the user when interacting with a modal dialog
 String getFocusId()
          Field to place focus on when the page loads An empty focusId will result in focusing on the first visible input element by default.
 History getFormHistory()
          History parameter representing the History of views that have come before the viewing of the current view
 String getFormKey()
          Key string that identifies the form instance in session storage
 String getFormPostUrl()
          URL the form generated for the view should post to
 String getGrowlScript()
          Script that will run on render (view or component) for generating growl messages
 String getJumpToId()
          The jumpToId for this form, the element with this id will be jumped to automatically when the form is loaded in the view.
 String getJumpToName()
          The jumpToName for this form, the element with this name will be jumped to automatically when the form is loaded in the view.
 String getLightboxScript()
          Script that will run on render (view or component) for a lightbox
 String getMethodToCall()
          Identifies the controller method that should be invoked to fulfill a request.
 Map<String,Object> getNewCollectionLines()
          Holds instances for collection add lines.
 String getPageId()
          Id for the current page being displayed within the view
 View getPostedView()
          View instance for the page that made a request.
 List<String> getReadOnlyFieldsList()
          List of fields that should be read only on the view
 String getReturnFormKey()
           
 String getReturnLocation()
           
 Map<String,Set<String>> getSelectedCollectionLines()
          Holds Set of String identifiers for lines that were selected in a collection
 String getState()
          Gets the state.
 String getUpdateComponentId()
          Id for the component that should be updated for a component refresh process
 View getView()
          View instance associated with the model.
 String getViewId()
          Unique Id for the View instance.
 String getViewName()
          Name for the View instance.
 Map<String,String> getViewRequestParameters()
          Map of parameters that was used to configured the View.
protected  ViewService getViewService()
          Instance of the ViewService that can be used to retrieve View instances
 UifConstants.ViewType getViewTypeName()
          Name for the type of view being requested.
 boolean isAddedCollectionItem(Object item)
          Indicates whether an collection item has been newly added
 boolean isAjaxRequest()
          Indicates whether the request was made by an ajax call
 boolean isBuildViewRequest()
           
 boolean isDefaultsApplied()
          Indicates whether the form has had default values from the configured View applied.
 boolean isRenderedInLightBox()
          Indicates whether the view is rendered within a lightbox
 boolean isRequestRedirected()
          Indicates whether a redirect has been requested for the view
 boolean isUpdateComponentRequest()
          Indicates whether the request is to update a component (only applicable for ajax requests)
 boolean isUpdateDialogRequest()
          Indicates whether the request is to update a dialog (only applicable for ajax requests)
 boolean isUpdateNoneRequest()
          Indicates whether the request is for a non-update of the view (only applicable for ajax requests)
 boolean isUpdatePageRequest()
          Indicates whether the request is to update a page (only applicable for ajax requests)
 boolean isUpdateViewRequest()
           
 void postBind(javax.servlet.http.HttpServletRequest request)
          Called after Spring binds the request to the form and before the controller method is invoked
 void setActionParameters(Map<String,String> actionParameters)
          Setter for the action parameters map
 void setAddedCollectionItems(List addedCollectionItems)
          Setter for the newly added item list
 void setAjaxRequest(boolean ajaxRequest)
          Set the ajaxRequest
 void setAjaxReturnType(String ajaxReturnType)
          Setter for the type of ajax return
 void setAttachmentFile(org.springframework.web.multipart.MultipartFile attachmentFile)
          Setter for the form's attachment file
 void setClientStateForSyncing(Map<String,Object> clientStateForSyncing)
          Setter for the client state
 void setDefaultsApplied(boolean defaultsApplied)
          Setter for the defaults applied indicator
 void setDialogExplanation(String dialogExplanation)
          Sets the dialogExplanation text value.
 void setDialogManager(DialogManager dialogManager)
          Sets the DialogManager for this view
 void setDialogResponse(String dialogResponse)
          Sets the response key text selected by the user as a response to a modal dialog
 void setFocusId(String focusId)
           
 void setFormHistory(History history)
          Setter for the current History object
 void setFormKey(String formKey)
          Setter for the form's session key
 void setFormPostUrl(String formPostUrl)
          Setter for the form post URL
 void setGrowlScript(String growlScript)
          Setter for the script that generates growls on render
 void setJumpToId(String jumpToId)
           
 void setJumpToName(String jumpToName)
           
 void setLightboxScript(String lightboxScript)
          Setter for the script that generates a lightbox on render
 void setMethodToCall(String methodToCall)
          Setter for the method to call
 void setNewCollectionLines(Map<String,Object> newCollectionLines)
          Setter for the new collection lines Map
 void setPageId(String pageId)
          Setter for the current page id
 void setPostedView(View postedView)
          Setter for the previous view instance
 void setReadOnlyFieldsList(List<String> readOnlyFieldsList)
          Setter for the list of read only fields
 void setRenderedInLightBox(boolean renderedInLightBox)
          Setter for the rendered within lightbox indicator
 void setRequestRedirected(boolean requestRedirected)
          Setter for the request redirect indicator
 void setReturnFormKey(String returnFormKey)
           
 void setReturnLocation(String returnLocation)
           
 void setSelectedCollectionLines(Map<String,Set<String>> selectedCollectionLines)
          Setter for the map that holds selected collection lines
 void setState(String state)
          Set the state
 void setUpdateComponentId(String updateComponentId)
          Setter for the component id that should be refreshed
 void setView(View view)
          Setter for the view instance
 void setViewId(String viewId)
          Setter for the unique view id
 void setViewName(String viewName)
          Setter for the view name
 void setViewRequestParameters(Map<String,String> viewRequestParameters)
          Setter for the view's request parameter map
 void setViewTypeName(UifConstants.ViewType viewTypeName)
          Setter for the view type name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewId

protected String viewId

viewName

protected String viewName

viewTypeName

protected UifConstants.ViewType viewTypeName

pageId

protected String pageId

methodToCall

protected String methodToCall

formKey

protected String formKey

jumpToId

protected String jumpToId

jumpToName

protected String jumpToName

focusId

protected String focusId

formPostUrl

protected String formPostUrl

state

protected String state

defaultsApplied

protected boolean defaultsApplied

renderedInLightBox

protected boolean renderedInLightBox

growlScript

protected String growlScript

lightboxScript

protected String lightboxScript

view

protected View view

postedView

protected View postedView

viewRequestParameters

protected Map<String,String> viewRequestParameters

readOnlyFieldsList

protected List<String> readOnlyFieldsList

newCollectionLines

protected Map<String,Object> newCollectionLines

actionParameters

protected Map<String,String> actionParameters

clientStateForSyncing

protected Map<String,Object> clientStateForSyncing

selectedCollectionLines

protected Map<String,Set<String>> selectedCollectionLines

addedCollectionItems

protected List<Object> addedCollectionItems

attachmentFile

protected org.springframework.web.multipart.MultipartFile attachmentFile

returnLocation

protected String returnLocation

returnFormKey

protected String returnFormKey

ajaxRequest

protected boolean ajaxRequest

ajaxReturnType

protected String ajaxReturnType

formHistory

protected History formHistory

dialogExplanation

protected String dialogExplanation

dialogResponse

protected String dialogResponse

dialogManager

protected DialogManager dialogManager

requestRedirected

protected boolean requestRedirected

updateComponentId

protected String updateComponentId
Constructor Detail

UifFormBase

public UifFormBase()
Method Detail

generateFormKey

protected String generateFormKey()
Creates the unique id used to store this "conversation" in the session. The default method generates a java UUID.

Returns:

postBind

public void postBind(javax.servlet.http.HttpServletRequest request)
Description copied from interface: ViewModel
Called after Spring binds the request to the form and before the controller method is invoked

Specified by:
postBind in interface ViewModel
Parameters:
request - - request object containing the query parameters
See Also:
ViewModel.postBind(javax.servlet.http.HttpServletRequest)

getViewId

public String getViewId()
Description copied from interface: ViewModel
Unique Id for the View instance. This is specified for a view in its definition by setting the 'id' property.

Specified by:
getViewId in interface ViewModel
Returns:
String view id
See Also:
ViewModel.getViewId()

setViewId

public void setViewId(String viewId)
Description copied from interface: ViewModel
Setter for the unique view id

Specified by:
setViewId in interface ViewModel
See Also:
ViewModel.setViewId(java.lang.String)

getViewName

public String getViewName()
Description copied from interface: ViewModel
Name for the View instance. This is specified for a view in its definition by setting the 'id' property. The name is not necessary unique and cannot be used by itself to retrieve a view. Typically it is used with other parameters to identify a view with a certain type (view type)

Specified by:
getViewName in interface ViewModel
Returns:
String view name
See Also:
ViewModel.getViewName()

setViewName

public void setViewName(String viewName)
Description copied from interface: ViewModel
Setter for the view name

Specified by:
setViewName in interface ViewModel
See Also:
ViewModel.setViewName(java.lang.String)

getViewTypeName

public UifConstants.ViewType getViewTypeName()
Description copied from interface: ViewModel
Name for the type of view being requested. This can be used to find View instances by request parameters (not necessary the unique id)

Specified by:
getViewTypeName in interface ViewModel
Returns:
String view type name
See Also:
ViewModel.getViewTypeName()

setViewTypeName

public void setViewTypeName(UifConstants.ViewType viewTypeName)
Description copied from interface: ViewModel
Setter for the view type name

Specified by:
setViewTypeName in interface ViewModel
See Also:
ViewModel.setViewTypeName(org.kuali.rice.krad.uif.UifConstants.ViewType)

getPageId

public String getPageId()
Description copied from interface: ViewModel
Id for the current page being displayed within the view

Specified by:
getPageId in interface ViewModel
Returns:
String page id
See Also:
ViewModel.getPageId()

setPageId

public void setPageId(String pageId)
Description copied from interface: ViewModel
Setter for the current page id

Specified by:
setPageId in interface ViewModel
See Also:
ViewModel.setPageId(java.lang.String)

getFormPostUrl

public String getFormPostUrl()
Description copied from interface: ViewModel
URL the form generated for the view should post to

Specified by:
getFormPostUrl in interface ViewModel
Returns:
String form post URL
See Also:
ViewModel.getFormPostUrl()

setFormPostUrl

public void setFormPostUrl(String formPostUrl)
Description copied from interface: ViewModel
Setter for the form post URL

Specified by:
setFormPostUrl in interface ViewModel
See Also:
ViewModel.setFormPostUrl(java.lang.String)

getReturnLocation

public String getReturnLocation()

setReturnLocation

public void setReturnLocation(String returnLocation)

getReturnFormKey

public String getReturnFormKey()

setReturnFormKey

public void setReturnFormKey(String returnFormKey)

getMethodToCall

public String getMethodToCall()
Identifies the controller method that should be invoked to fulfill a request. The value will be matched up against the 'params' setting on the RequestMapping annotation for the controller method

Returns:
String method to call

setMethodToCall

public void setMethodToCall(String methodToCall)
Setter for the method to call

Parameters:
methodToCall -

getViewRequestParameters

public Map<String,String> getViewRequestParameters()
Description copied from interface: ViewModel
Map of parameters that was used to configured the View. Maintained on the form to rebuild the view on posts and session timeout

Specified by:
getViewRequestParameters in interface ViewModel
Returns:
Map view parameters
See Also:
ViewModel.getViewRequestParameters()

setViewRequestParameters

public void setViewRequestParameters(Map<String,String> viewRequestParameters)
Description copied from interface: ViewModel
Setter for the view's request parameter map

Specified by:
setViewRequestParameters in interface ViewModel
See Also:
org.kuali.rice.krad.uif.view.ViewModel#setViewRequestParameters(java.util.Map)

getReadOnlyFieldsList

public List<String> getReadOnlyFieldsList()
Description copied from interface: ViewModel
List of fields that should be read only on the view

If the view being rendered supports request setting of read-only fields, the readOnlyFields request parameter can be sent to mark fields as read only that might not have been otherwise

Note the paths specified should be the simple property names (not the full binding path). Therefore if the property name appears multiple times in the view, all instances will be set as read only

Specified by:
getReadOnlyFieldsList in interface ViewModel
Returns:
List read only property names
See Also:
ViewModel.getReadOnlyFieldsList()

setReadOnlyFieldsList

public void setReadOnlyFieldsList(List<String> readOnlyFieldsList)
Description copied from interface: ViewModel
Setter for the list of read only fields

Specified by:
setReadOnlyFieldsList in interface ViewModel
See Also:
org.kuali.rice.krad.uif.view.ViewModel#setReadOnlyFieldsList(java.util.List)

getNewCollectionLines

public Map<String,Object> getNewCollectionLines()
Description copied from interface: ViewModel
Holds instances for collection add lines. The key of the Map gives the collection name the line instance applies to, the Map value is an instance of the collection object class that holds the new line data

Specified by:
getNewCollectionLines in interface ViewModel
Returns:
Map new collection lines
See Also:
ViewModel.getNewCollectionLines()

setNewCollectionLines

public void setNewCollectionLines(Map<String,Object> newCollectionLines)
Description copied from interface: ViewModel
Setter for the new collection lines Map

Specified by:
setNewCollectionLines in interface ViewModel
See Also:
org.kuali.rice.krad.uif.view.ViewModel#setNewCollectionLines(java.util.Map)

getActionParameters

public Map<String,String> getActionParameters()
Description copied from interface: ViewModel
Map of parameters sent for the invoked action

Many times besides just setting the method to call actions need to send additional parameters. For instance the method being called might do a redirect, in which case the action needs to send parameters for the redirect URL. An example of this is redirecting to a Lookup view. In some cases the parameters that need to be sent conflict with properties already on the form, and putting all the action parameters as form properties would grow massive (in addition to adds an additional step from the XML config). So this general map solves those issues.

Specified by:
getActionParameters in interface ViewModel
Returns:
Map action parameters
See Also:
ViewModel.getActionParameters()

getActionParametersAsProperties

public Properties getActionParametersAsProperties()
Returns the action parameters map as a Properties instance

Returns:
Properties action parameters

setActionParameters

public void setActionParameters(Map<String,String> actionParameters)
Description copied from interface: ViewModel
Setter for the action parameters map

Specified by:
setActionParameters in interface ViewModel
See Also:
org.kuali.rice.krad.uif.view.ViewModel#setActionParameters(java.util.Map)

getActionParamaterValue

public String getActionParamaterValue(String actionParameterName)
Retrieves the value for the given action parameter, or empty string if not found

Parameters:
actionParameterName - - name of the action parameter to retrieve value for
Returns:
String parameter value or empty string

getActionEvent

public String getActionEvent()
Returns the action event that was sent in the action parameters (if any)

The action event is a special action parameter that can be sent to indicate a type of action being taken. This can be looked at by the view or components to render differently

TODO: make sure action parameters are getting reinitialized on each request

Returns:
String action event name or blank if action event was not sent

getClientStateForSyncing

public Map<String,Object> getClientStateForSyncing()
Description copied from interface: ViewModel
Map that is populated from the component state maintained on the client

Used when a request is made that refreshes part of the view. The current state for components (which have state that can be changed on the client), is populated into this map which is then used by the ViewHelperService to update the components so that the state is maintained when they render.

Specified by:
getClientStateForSyncing in interface ViewModel
Returns:
Map map where key is name of property or component id, and value is the property value or another map of component key/value pairs
See Also:
ViewModel.getClientStateForSyncing()

setClientStateForSyncing

public void setClientStateForSyncing(Map<String,Object> clientStateForSyncing)
Setter for the client state

Parameters:
clientStateForSyncing -

getSelectedCollectionLines

public Map<String,Set<String>> getSelectedCollectionLines()
Description copied from interface: ViewModel
Holds Set of String identifiers for lines that were selected in a collection

When the select field is enabled for a CollectionGroup, the framework will be default bind the selected identifier strings to this property. The key of the map uniquely identifies the collection by the full binding path to the collection, and the value is a set of Strings for the checked lines.

Specified by:
getSelectedCollectionLines in interface ViewModel
Returns:
Map> map of collections and their selected lines
See Also:
ViewModel.getSelectedCollectionLines()

setSelectedCollectionLines

public void setSelectedCollectionLines(Map<String,Set<String>> selectedCollectionLines)
Description copied from interface: ViewModel
Setter for the map that holds selected collection lines

Specified by:
setSelectedCollectionLines in interface ViewModel
See Also:
org.kuali.rice.krad.uif.view.ViewModel#setSelectedCollectionLines(java.util.Map>)

getFormKey

public String getFormKey()
Key string that identifies the form instance in session storage

When the view is posted, the previous form instance is retrieved and then populated from the request parameters. This key string is retrieve the session form from the session service

Returns:
String form session key

setFormKey

public void setFormKey(String formKey)
Setter for the form's session key

Parameters:
formKey -

isDefaultsApplied

public boolean isDefaultsApplied()
Description copied from interface: ViewModel
Indicates whether the form has had default values from the configured View applied. This happens only once for each form instance

Specified by:
isDefaultsApplied in interface ViewModel
Returns:
boolean true if default values have been applied, false if not
See Also:
ViewModel.isDefaultsApplied()

setDefaultsApplied

public void setDefaultsApplied(boolean defaultsApplied)
Description copied from interface: ViewModel
Setter for the defaults applied indicator

Specified by:
setDefaultsApplied in interface ViewModel
See Also:
ViewModel.setDefaultsApplied(boolean)

isRequestRedirected

public boolean isRequestRedirected()
Indicates whether a redirect has been requested for the view

Returns:
boolean true if redirect was requested, false if not

setRequestRedirected

public void setRequestRedirected(boolean requestRedirected)
Setter for the request redirect indicator

Parameters:
requestRedirected -

getAttachmentFile

public org.springframework.web.multipart.MultipartFile getAttachmentFile()
Holder for files that are attached through the view

Returns:
MultipartFile representing the attachment

setAttachmentFile

public void setAttachmentFile(org.springframework.web.multipart.MultipartFile attachmentFile)
Setter for the form's attachment file

Parameters:
attachmentFile -

getUpdateComponentId

public String getUpdateComponentId()
Id for the component that should be updated for a component refresh process

Returns:
String component id

setUpdateComponentId

public void setUpdateComponentId(String updateComponentId)
Setter for the component id that should be refreshed

Parameters:
updateComponentId -

getView

public View getView()
Description copied from interface: ViewModel
View instance associated with the model. Used to render the user interface

Specified by:
getView in interface ViewModel
Returns:
View
See Also:
ViewModel.getView()

setView

public void setView(View view)
Description copied from interface: ViewModel
Setter for the view instance

Specified by:
setView in interface ViewModel
See Also:
ViewModel.setView(org.kuali.rice.krad.uif.view.View)

getPostedView

public View getPostedView()
Description copied from interface: ViewModel
View instance for the page that made a request. Since a new view instance gets initialized for each request before the controller logic is invoked, any state about the previous view is lost. This could be needed to read metadata from the view for such things as collection processing. When this is necessary the previous view instance can be retrieved

Specified by:
getPostedView in interface ViewModel
Returns:
View instance
See Also:
ViewModel.getPostedView()

setPostedView

public void setPostedView(View postedView)
Description copied from interface: ViewModel
Setter for the previous view instance

Specified by:
setPostedView in interface ViewModel
See Also:
ViewModel.setPostedView(org.kuali.rice.krad.uif.view.View)

getViewService

protected ViewService getViewService()
Instance of the ViewService that can be used to retrieve View instances

Returns:
ViewService implementation

getJumpToId

public String getJumpToId()
The jumpToId for this form, the element with this id will be jumped to automatically when the form is loaded in the view. Using "TOP" or "BOTTOM" will jump to the top or the bottom of the resulting page. jumpToId always takes precedence over jumpToName, if set.

Returns:
the jumpToId

setJumpToId

public void setJumpToId(String jumpToId)
Parameters:
jumpToId - the jumpToId to set

getJumpToName

public String getJumpToName()
The jumpToName for this form, the element with this name will be jumped to automatically when the form is loaded in the view. WARNING: jumpToId always takes precedence over jumpToName, if set.

Returns:
the jumpToName

setJumpToName

public void setJumpToName(String jumpToName)
Parameters:
jumpToName - the jumpToName to set

getFocusId

public String getFocusId()
Field to place focus on when the page loads An empty focusId will result in focusing on the first visible input element by default.

Returns:
the focusId

setFocusId

public void setFocusId(String focusId)
Parameters:
focusId - the focusId to set

getFormHistory

public History getFormHistory()
History parameter representing the History of views that have come before the viewing of the current view

Used for breadcrumb widget generation on the view and also for navigating back to previous or hub locations

Returns:
History instance giving current history

setFormHistory

public void setFormHistory(History history)
Setter for the current History object

Parameters:
history - the history to set

isRenderedInLightBox

public boolean isRenderedInLightBox()
Indicates whether the view is rendered within a lightbox

Some discussion (for example how a close button behaves) need to change based on whether the view is rendered within a lightbox or the standard browser window. This boolean is true when it is within a lightbox

Returns:
boolean true if view is rendered within a lightbox, false if not

setRenderedInLightBox

public void setRenderedInLightBox(boolean renderedInLightBox)
Setter for the rendered within lightbox indicator

Parameters:
renderedInLightBox -

getGrowlScript

public String getGrowlScript()
Description copied from interface: ViewModel
Script that will run on render (view or component) for generating growl messages

Specified by:
getGrowlScript in interface ViewModel
Returns:
String JS growl script
See Also:
ViewModel.getGrowlScript()

setGrowlScript

public void setGrowlScript(String growlScript)
Description copied from interface: ViewModel
Setter for the script that generates growls on render

Specified by:
setGrowlScript in interface ViewModel
See Also:
ViewModel.setGrowlScript(java.lang.String)

getState

public String getState()
Description copied from interface: ViewModel
Gets the state. This is the default location for state on KRAD forms.

Specified by:
getState in interface ViewModel
Returns:
the state
See Also:
ViewModel.getState()

setState

public void setState(String state)
Description copied from interface: ViewModel
Set the state

Specified by:
setState in interface ViewModel
See Also:
ViewModel.setState(String)

getLightboxScript

public String getLightboxScript()
Description copied from interface: ViewModel
Script that will run on render (view or component) for a lightbox

Specified by:
getLightboxScript in interface ViewModel
Returns:
String JS lightbox script
See Also:
ViewModel.getLightboxScript()

setLightboxScript

public void setLightboxScript(String lightboxScript)
Description copied from interface: ViewModel
Setter for the script that generates a lightbox on render

Specified by:
setLightboxScript in interface ViewModel
See Also:
ViewModel.setLightboxScript(java.lang.String)

isAjaxRequest

public boolean isAjaxRequest()
Description copied from interface: ViewModel
Indicates whether the request was made by an ajax call

Depending on whether the request was made via ajax (versus standard browser submit) the response will be handled different. For example with an ajax request we can send back partial page updates, which cannot be done with standard submits

If this indicator is true, ViewModel.getAjaxReturnType() will be used to determine how to handling the ajax return

Specified by:
isAjaxRequest in interface ViewModel
Returns:
boolean true if the request was an ajax call, false if not
See Also:
ViewModel.isAjaxRequest()

setAjaxRequest

public void setAjaxRequest(boolean ajaxRequest)
Description copied from interface: ViewModel
Set the ajaxRequest

Specified by:
setAjaxRequest in interface ViewModel
See Also:
ViewModel.setAjaxRequest(boolean)

getAjaxReturnType

public String getAjaxReturnType()
Description copied from interface: ViewModel
Gets the return type for the ajax call

The ajax return type indicates how the response content will be handled in the client. Typical examples include updating a component, the page, or doing a redirect.

Specified by:
getAjaxReturnType in interface ViewModel
Returns:
String return type
See Also:
ViewModel.getAjaxReturnType()

isUpdateComponentRequest

public boolean isUpdateComponentRequest()
Description copied from interface: ViewModel
Indicates whether the request is to update a component (only applicable for ajax requests)

Specified by:
isUpdateComponentRequest in interface ViewModel
Returns:
boolean true if the request is for update component, false if not
See Also:
ViewModel.isUpdateComponentRequest()

isUpdateDialogRequest

public boolean isUpdateDialogRequest()
Description copied from interface: ViewModel
Indicates whether the request is to update a dialog (only applicable for ajax requests)

Specified by:
isUpdateDialogRequest in interface ViewModel
Returns:
boolean true if the request is for update dialog, false if not
See Also:
ViewModel.isUpdateDialogRequest()

isUpdatePageRequest

public boolean isUpdatePageRequest()
Description copied from interface: ViewModel
Indicates whether the request is to update a page (only applicable for ajax requests)

Specified by:
isUpdatePageRequest in interface ViewModel
Returns:
boolean true if the request is for update page, false if not
See Also:
ViewModel.isUpdatePageRequest()

isUpdateNoneRequest

public boolean isUpdateNoneRequest()
Description copied from interface: ViewModel
Indicates whether the request is for a non-update of the view (only applicable for ajax requests)

Examples of requests that do not update the view are ajax queries or requests that download a file

Specified by:
isUpdateNoneRequest in interface ViewModel
Returns:
boolean true if the request is for non-update, false if not
See Also:
ViewModel.isUpdateNoneRequest()

isBuildViewRequest

public boolean isBuildViewRequest()
Specified by:
isBuildViewRequest in interface ViewModel
See Also:
ViewModel.isBuildViewRequest()

isUpdateViewRequest

public boolean isUpdateViewRequest()
Specified by:
isUpdateViewRequest in interface ViewModel
See Also:
ViewModel.isUpdateViewRequest()

setAjaxReturnType

public void setAjaxReturnType(String ajaxReturnType)
Description copied from interface: ViewModel
Setter for the type of ajax return

Specified by:
setAjaxReturnType in interface ViewModel
See Also:
ViewModel.setAjaxReturnType(java.lang.String)

getDialogExplanation

public String getDialogExplanation()
Returns the String entered by the user when presented a dialog

Field defined here so all forms will be able to bind to a dialog using the same property

Returns:
String - the text entered by a user as a reply in a modal dialog.

setDialogExplanation

public void setDialogExplanation(String dialogExplanation)
Sets the dialogExplanation text value.

Parameters:
dialogExplanation - - text entered by user when replying to a modal dialog

getDialogResponse

public String getDialogResponse()
Represents the option chosen by the user when interacting with a modal dialog

This is used to determine which option was chosen by the user. The value is the key in the key/value pair selected in the control.

Returns:
- String key selected by the user

setDialogResponse

public void setDialogResponse(String dialogResponse)
Sets the response key text selected by the user as a response to a modal dialog

Parameters:
dialogResponse - - the key of the option chosen by the user

getDialogManager

public DialogManager getDialogManager()
Gets the DialogManager for this view/form

The DialogManager tracks modal dialog interactions with the user

Returns:

setDialogManager

public void setDialogManager(DialogManager dialogManager)
Sets the DialogManager for this view

Parameters:
dialogManager - - DialogManager instance for this view

getAddedCollectionItems

public List getAddedCollectionItems()
The List that contains all newly added items for the collections on the model

This list contains the new items for all the collections on the model.

Returns:
List of the newly added item lists

setAddedCollectionItems

public void setAddedCollectionItems(List addedCollectionItems)
Setter for the newly added item list

Parameters:
addedCollectionItems -

isAddedCollectionItem

public boolean isAddedCollectionItem(Object item)
Indicates whether an collection item has been newly added

Tests collection items against the list of newly added items on the model. This list gets cleared when the view is submitted and the items are persisted.

Parameters:
item - - the item to test against list of newly added items
Returns:
boolean true if the item has been newly added


Copyright © 2005-2014 The Kuali Foundation. All Rights Reserved.