Class UifFormBase
- All Implemented Interfaces:
Serializable,ViewModel
- Direct Known Subclasses:
DocumentFormBase,DummyLoginForm,DynaForm,IncidentReportForm,InitiatedDocumentInfoForm,InquiryForm,LookupForm,SessionTimeoutForm
Holds properties necessary to determine the View instance that
will be used to render the user interface
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringprotected booleanprotected org.springframework.web.multipart.MultipartFileprotected Booleanprotected Stringprotected Stringprotected Map<String, DialogResponse> protected booleanprotected booleanprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected HistoryFlowprotected HistoryManagerprotected Stringprotected Stringprotected Stringprotected Stringprotected booleanprotected booleanprotected javax.servlet.http.HttpServletRequestprotected Stringprotected booleanprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected intprotected Stringprotected Stringprotected Stringprotected Stringprotected Viewprotected Stringprotected Stringprotected ViewPostMetadataprotected UifConstants.ViewType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringCreates the unique id used to store this "conversation" in the session.Returns the action event that was sent in the action parameters (if any)Copy of the action flags on the view to be used by subsequent requests (so they don't need to be evaluated on each request).getActionParamaterValue(String actionParameterName) Retrieves the value for the given action parameter, or empty string if not foundMap of parameters sent for the invoked actionReturns the action parameters map as aPropertiesinstanceTheListthat contains all newly added items for the collections on the modelGets the return type for the ajax callorg.springframework.web.multipart.MultipartFileHolder for files that are attached through the viewMap that is populated from the component state maintained on the clientName of the controllerMapping for this form (includes slash)The data object to bind to for a dialogContains values for dialog explanation fields present on the page.getDialogResponse(String dialogId) Helper method to get a dialog response for the given dialog id.Map containing dialog responses for a request 'conversation'.Copy of the edit modes on the view to be used by subsequent requests (so they don't need to be evaluated on each request).A generic map for framework pieces (such as component modifiers) that need to dynamically store data to the formThe flowKey representing the HistoryFlow this form may be in.Field to place focus on when the page loads An empty focusId will result in focusing on the first visible input element by default.Key string that identifies the form instance in session storageURL the form generated for the view should post toScript that will run on render (view or component) for generating growl messagesThe currentHistoryFlowfor this form which stores a trail of urls/breadcrumbs primarily used for path-based breadcrumb displayThe currentHistoryManagerthat was pulled from session which store allHistoryFlowobjects in the current session to keep track of the path the user has taken across views (primarily used by path-based breadcrumbs)The requestParameters represent all the parameters in the query string that were initially passed to this View by the initial requestThe jumpToId for this form, the element with this id will be jumped to automatically when the form is loaded in the view.The jumpToName for this form, the element with this name will be jumped to automatically when the form is loaded in the view.Identifies the controller method that should be invoked to fulfill a request.Holds instances for collection add lines.Id for the current page being displayed within the viewList of fields that should be read only on the viewjavax.servlet.http.HttpServletRequestHttp servlet request instance for the current request being processed.This is the formKey sent on the original request.Template the will be invoked to return a JSON stringThe original requestUrl for the View represented by this form (url received by the controller for initial request)Used by the dialog framework to set the dialog id for a return dialog call (when the server has triggered a dialog).Used by the dialog framework to set the dialog response for a return dialog call (when the server has triggered a dialog).Holds Set of String identifiers for lines that were selected in a collection from a single page.Holds Set of String identifiers for lines that were selected in a lookup collection results across multiple pages.Holds the id for the user's current sessionintHolds the configured session timeout intervalFor cases where the request was triggered from within a dialog, we want to show that dialog, identified by this id, again.getState()Gets the state.When the request has been triggered by an action component, gives the id for the action.Component instance that been built for a refresh/disclosure request.Id for the component that should be updated for a component refresh processgetView()View instance associated with the model.Returns an instance of the view's configured view helper service.Unique Id for theViewinstance.Name for theViewinstance.Gets theViewPostMetadatathat has been built up from processing of a view.Map of parameters that was used to configured theView.protected ViewServiceInstance of theViewServicethat can be used to retrieveViewinstancesName for the type of view being requested.booleanisAddedCollectionItem(Object item) Indicates whether an collection item has been newly addedbooleanIndicates whether the request was made by an ajax callbooleanIndicates whether default values should be applied.Copy of the edit view flag to be used by subsequent requests (so they don't need to be evaluated on each request).booleanIndicates whether the request is for paging a collection (or sorting).booleanTrue when the form is considered dirty (data has changed from original value), false otherwisebooleanDetermines whether edit modes and action flags should be evaluated.booleanIndicates whether the request should return a JSON stringbooleanIndicates whether the view is rendered within a lightboxbooleanIndicates whether the view is rendered within an iframe (this setting must be passed to the View on the url)booleanIndicates whether a redirect has been requested for the viewbooleanIndicates whether the request is to update a component (only applicable for ajax requests)booleanIndicates whether the request is to update a dialog (only applicable for ajax requests)booleanIndicates whether the request is for a non-update of the view (only applicable for ajax requests)booleanIndicates whether the request is to update a page (only applicable for ajax requests)voidpostBind(javax.servlet.http.HttpServletRequest request) Called after Spring binds the request to the form and before the controller method is invokedvoidpreBind(javax.servlet.http.HttpServletRequest request) Called before Spring binds the request to the form to allow for pre-processing before setting values.voidpreRender(javax.servlet.http.HttpServletRequest request) Called after the controller has finished executing, but before rendering occurs.voidsetActionFlags(Map<String, Boolean> actionFlags) voidsetActionParameters(Map<String, String> actionParameters) Setter for the action parameters mapvoidsetAddedCollectionItems(List addedCollectionItems) Setter for the newly added item listvoidsetAjaxRequest(boolean ajaxRequest) Set the ajaxRequestvoidsetAjaxReturnType(String ajaxReturnType) Setter for the type of ajax returnvoidsetApplyDefaultValues(boolean applyDefaultValues) Set whether default values should be applied to the viewvoidsetAttachmentFile(org.springframework.web.multipart.MultipartFile attachmentFile) Setter for the form's attachment filevoidsetCanEditView(Boolean canEditView) voidsetClientStateForSyncing(Map<String, Object> clientStateForSyncing) Setter for the client statevoidsetCollectionPagingRequest(boolean collectionPagingRequest) voidsetCsrfToken(String csrfToken) voidsetDialogDataObject(Object dataObject) voidsetDialogExplanations(Map<String, String> dialogExplanations) voidsetDialogResponses(Map<String, DialogResponse> dialogResponses) voidsetDirtyForm(boolean dirtyForm) Sets the dirtyForm flagvoidsetDirtyForm(String dirtyForm) Set the dirtyForm flag using a String that will be converted to booleanvoidsetEditModes(Map<String, Boolean> editModes) voidsetEvaluateFlagsAndModes(boolean evaluateFlagsAndModes) voidsetExtensionData(Map<String, Object> extensionData) Setter for the generic extension data mapvoidsetFlowKey(String flowKey) Set the flowKeyvoidsetFocusId(String focusId) voidsetFormKey(String formKey) Setter for the form's session keyvoidsetFormPostUrl(String formPostUrl) Setter for the form post URLvoidsetGrowlScript(String growlScript) Setter for the script that generates growls on rendervoidsetHistoryFlow(HistoryFlow historyFlow) Set the current HistoryFlow for this formvoidsetHistoryManager(HistoryManager historyManager) Set the current HistoryManagervoidsetInitialRequestParameters(Map<String, String[]> requestParameters) Set the requestParametersvoidsetJumpToId(String jumpToId) voidsetJumpToName(String jumpToName) voidsetMethodToCall(String methodToCall) Setter for the method to callvoidsetNewCollectionLines(Map<String, Object> newCollectionLines) Setter for the new collection lines MapvoidSetter for the current page idvoidsetReadOnlyFieldsList(List<String> readOnlyFieldsList) Setter for the list of read only fieldsvoidsetRenderedInDialog(boolean renderedInDialog) Setter for the rendered within lightbox indicatorvoidsetRenderedInIframe(boolean renderedInIframe) voidsetRequest(javax.servlet.http.HttpServletRequest request) voidsetRequestedFormKey(String requestedFormKey) Set the requestedFormKeyvoidsetRequestJsonTemplate(String requestJsonTemplate) Setter for the template to render for the requestvoidsetRequestRedirected(boolean requestRedirected) Setter for the request redirect indicatorvoidsetRequestUrl(String requestUrl) Set the requestUrlvoidsetReturnDialogId(String returnDialogId) voidsetReturnDialogResponse(String returnDialogResponse) voidsetReturnFormKey(String returnFormKey) voidsetReturnLocation(String returnLocation) voidsetSelectedCollectionLines(Map<String, Set<String>> selectedCollectionLines) Setter for the map that holds selected collection linesvoidsetSelectedLookupResultsCache(Set<String> selectedLookupResultsCache) Sets the lookup result selection cache valuesvoidsetShowDialogId(String dialogId) voidSet the statevoidsetTriggerActionId(String triggerActionId) voidsetUpdateComponent(Component updateComponent) voidsetUpdateComponentId(String updateComponentId) Setter for the component id that should be refreshedvoidSetter for the view instancevoidSetter for the unique view idvoidsetViewName(String viewName) Setter for the view namevoidsetViewPostMetadata(ViewPostMetadata viewPostMetadata) voidsetViewRequestParameters(Map<String, String> viewRequestParameters) Setter for the view's request parameter mapvoidsetViewTypeName(UifConstants.ViewType viewTypeName) Setter for the view type nametoString()
-
Field Details
-
viewId
-
viewName
-
viewTypeName
-
pageId
-
methodToCall
-
formKey
-
requestedFormKey
-
flowKey
-
sessionId
-
sessionTimeoutInterval
protected int sessionTimeoutInterval -
historyFlow
-
historyManager
-
jumpToId
-
jumpToName
-
focusId
-
dirtyForm
-
formPostUrl
-
controllerMapping
-
state
-
renderedInDialog
-
renderedInIframe
-
growlScript
-
view
-
viewPostMetadata
-
viewRequestParameters
-
readOnlyFieldsList
-
newCollectionLines
-
triggerActionId
-
actionParameters
-
clientStateForSyncing
-
selectedCollectionLines
-
selectedLookupResultsCache
-
addedCollectionItems
-
attachmentFile
protected org.springframework.web.multipart.MultipartFile attachmentFile -
returnLocation
-
returnFormKey
-
ajaxRequest
-
ajaxReturnType
-
showDialogId
-
returnDialogId
-
returnDialogResponse
-
dialogExplanations
-
dialogResponses
-
requestRedirected
protected boolean requestRedirected -
updateComponentId
-
extensionData
-
applyDefaultValues
protected boolean applyDefaultValues -
evaluateFlagsAndModes
protected boolean evaluateFlagsAndModes -
canEditView
-
actionFlags
-
editModes
-
csrfToken
-
request
protected transient javax.servlet.http.HttpServletRequest request
-
-
Constructor Details
-
UifFormBase
public UifFormBase()
-
-
Method Details
-
preBind
public void preBind(javax.servlet.http.HttpServletRequest request) Called before Spring binds the request to the form to allow for pre-processing before setting values. -
postBind
public void postBind(javax.servlet.http.HttpServletRequest request) Called after Spring binds the request to the form and before the controller method is invoked -
preRender
public void preRender(javax.servlet.http.HttpServletRequest request) Called after the controller has finished executing, but before rendering occurs. -
generateFormKey
Creates the unique id used to store this "conversation" in the session. The default method generates a java UUID.- Returns:
- UUID
-
getViewId
Description copied from interface:ViewModelUnique Id for theViewinstance. This is specified for a view in its definition by setting the 'id' property. -
setViewId
Description copied from interface:ViewModelSetter for the unique view id -
getViewName
Description copied from interface:ViewModelName for theViewinstance. 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:
getViewNamein interfaceViewModel- Returns:
- String view name
- See Also:
-
setViewName
Description copied from interface:ViewModelSetter for the view name- Specified by:
setViewNamein interfaceViewModel- Parameters:
viewName-- See Also:
-
getViewTypeName
Description copied from interface:ViewModelName for the type of view being requested. This can be used to findViewinstances by request parameters (not necessary the unique id)- Specified by:
getViewTypeNamein interfaceViewModel- Returns:
- String view type name
- See Also:
-
setViewTypeName
Description copied from interface:ViewModelSetter for the view type name- Specified by:
setViewTypeNamein interfaceViewModel- Parameters:
viewTypeName-- See Also:
-
getPageId
Description copied from interface:ViewModelId for the current page being displayed within the view -
setPageId
Description copied from interface:ViewModelSetter for the current page id -
getFormPostUrl
Description copied from interface:ViewModelURL the form generated for the view should post to- Specified by:
getFormPostUrlin interfaceViewModel- Returns:
- String form post URL
- See Also:
-
setFormPostUrl
Description copied from interface:ViewModelSetter for the form post URL- Specified by:
setFormPostUrlin interfaceViewModel- Parameters:
formPostUrl-- See Also:
-
getControllerMapping
Name of the controllerMapping for this form (includes slash)- Returns:
- the controllerMapping string
-
getHistoryFlow
The currentHistoryFlowfor this form which stores a trail of urls/breadcrumbs primarily used for path-based breadcrumb display- Returns:
- the
HistoryFlow
-
setHistoryFlow
Set the current HistoryFlow for this form -
getHistoryManager
The currentHistoryManagerthat was pulled from session which store allHistoryFlowobjects in the current session to keep track of the path the user has taken across views (primarily used by path-based breadcrumbs)- Returns:
- the HistoryManager
-
setHistoryManager
Set the current HistoryManager -
getFlowKey
The flowKey representing the HistoryFlow this form may be in.This allows for a flow to continue by key or start (if set to "start"). If null or blank, no flow (or path based breadcrumbs) are being tracked.
- Returns:
- the flowKey
-
setFlowKey
Set the flowKey -
getRequestUrl
The original requestUrl for the View represented by this form (url received by the controller for initial request)- Returns:
- the requestUrl
-
setRequestUrl
Set the requestUrl -
getInitialRequestParameters
The requestParameters represent all the parameters in the query string that were initially passed to this View by the initial request- Returns:
- the requestParameters
-
setInitialRequestParameters
Set the requestParameters -
getReturnLocation
-
setReturnLocation
-
getReturnFormKey
-
setReturnFormKey
-
getSessionId
Holds the id for the user's current sessionThe user's session id is used to track when a timeout has occurred and enforce the policy configured with the
ViewSessionPolicy. This property gets initialized in thepostBind(javax.servlet.http.HttpServletRequest)method and then is written out as a hidden on the view. Therefore each post done on the view will send back the session id when the view was rendering, and theUifSessionTimeoutFiltercan use that to determine if a timeout has occurred- Returns:
- id for the user's current session
-
getSessionTimeoutInterval
public int getSessionTimeoutInterval()Holds the configured session timeout intervalHolds the session timeout interval so it can be referenced to give the user notifications (for example the session timeout warning reads this property). This is initialized from the session object in
postBind(javax.servlet.http.HttpServletRequest)- Returns:
- amount of time in milliseconds before the session will timeout
-
getMethodToCall
Identifies the controller method that should be invoked to fulfill a request. The value will be matched up against the 'params' setting on theRequestMappingannotation for the controller method- Returns:
- String method to call
-
setMethodToCall
Setter for the method to call -
getViewRequestParameters
Map of parameters that was used to configured theView. Maintained on the form to rebuild the view on posts and session timeout- Specified by:
getViewRequestParametersin interfaceViewModel- Returns:
- Mapinvalid input: '<'String, String> view parameters
-
setViewRequestParameters
Setter for the view's request parameter map- Specified by:
setViewRequestParametersin interfaceViewModel- Parameters:
viewRequestParameters- map of request parameters
-
getReadOnlyFieldsList
List of fields that should be read only on the viewIf 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:
getReadOnlyFieldsListin interfaceViewModel- Returns:
- List<String> read only property names
- See Also:
-
setReadOnlyFieldsList
Setter for the list of read only fields- Specified by:
setReadOnlyFieldsListin interfaceViewModel
-
getNewCollectionLines
Description copied from interface:ViewModelHolds 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:
getNewCollectionLinesin interfaceViewModel- Returns:
- Mapinvalid input: '<'String, Object> new collection lines
- See Also:
-
setNewCollectionLines
Setter for the new collection lines Map- Specified by:
setNewCollectionLinesin interfaceViewModel- Parameters:
newCollectionLines-
-
getTriggerActionId
When the request has been triggered by an action component, gives the id for the action.- Specified by:
getTriggerActionIdin interfaceViewModel- Returns:
- String action id, or null if request was not triggered by an action component
-
setTriggerActionId
- Specified by:
setTriggerActionIdin interfaceViewModel- See Also:
-
getActionParameters
Description copied from interface:ViewModelMap of parameters sent for the invoked actionMany 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
Lookupview. 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:
getActionParametersin interfaceViewModel- Returns:
- Mapinvalid input: '<'String, String> action parameters
- See Also:
-
getActionParametersAsProperties
Returns the action parameters map as aPropertiesinstance- Returns:
- Properties action parameters
-
setActionParameters
Setter for the action parameters map- Specified by:
setActionParametersin interfaceViewModel- Parameters:
actionParameters-
-
getActionParamaterValue
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
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
Description copied from interface:ViewModelMap that is populated from the component state maintained on the clientUsed 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
ViewHelperServiceto update the components so that the state is maintained when they render.- Specified by:
getClientStateForSyncingin interfaceViewModel- Returns:
- Mapinvalid input: '<'String, Object> 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:
-
setClientStateForSyncing
Setter for the client state -
getSelectedCollectionLines
Description copied from interface:ViewModelHolds Set of String identifiers for lines that were selected in a collection from a single page. selectedCollectionLines are request level values and get reset with every page requestWhen 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:
getSelectedCollectionLinesin interfaceViewModel- Returns:
- Map<String, Set<String>> map of collections and their selected lines
- See Also:
-
setSelectedCollectionLines
Setter for the map that holds selected collection lines- Specified by:
setSelectedCollectionLinesin interfaceViewModel
-
getSelectedLookupResultsCache
Holds Set of String identifiers for lines that were selected in a lookup collection results across multiple pages. The value in the cache is preserved in the session across multiple requests. This allows for the server side paging of results to retain the user choices as they move through the pages.- Returns:
- set of identifiers
-
setSelectedLookupResultsCache
Sets the lookup result selection cache values -
getFormKey
Key string that identifies the form instance in session storageWhen 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
Setter for the form's session key -
getRequestedFormKey
This is the formKey sent on the original request. It may differ from the actual form key stored in formKey based on if the form still exists in session by this key or not.- Returns:
- the original requested form key
-
setRequestedFormKey
Set the requestedFormKey -
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 -
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 -
getUpdateComponentId
Description copied from interface:ViewModelId for the component that should be updated for a component refresh process- Specified by:
getUpdateComponentIdin interfaceViewModel- Returns:
- String component id
- See Also:
-
setUpdateComponentId
Description copied from interface:ViewModelSetter for the component id that should be refreshed- Specified by:
setUpdateComponentIdin interfaceViewModel- Parameters:
updateComponentId-- See Also:
-
getUpdateComponent
Description copied from interface:ViewModelComponent instance that been built for a refresh/disclosure request.This is generally set by org.kuali.rice.krad.uif.lifecycle.ViewLifecycle#performComponentLifecycle(org.kuali.rice.krad.uif.view.View, java.lang.Object, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.kuali.rice.krad.uif.lifecycle.ViewPostMetadata, java.lang.String) after processing the lifecycle. The form property provides access to the rendering layer.
- Specified by:
getUpdateComponentin interfaceViewModel- Returns:
- component instance for updating
- See Also:
-
setUpdateComponent
- Specified by:
setUpdateComponentin interfaceViewModel- See Also:
-
getView
Description copied from interface:ViewModelView instance associated with the model. Used to render the user interface -
setView
Description copied from interface:ViewModelSetter for the view instance -
getViewHelperService
Returns an instance of the view's configured view helper service.First checks if there is an initialized view containing a view helper instance. If not, and there is a view id on the form, a call is made to retrieve the view helper instance or class configuration.
Returns the view helper service instance that was configured for the current view.- Specified by:
getViewHelperServicein interfaceViewModel- Returns:
- instance of view helper service, null if view is null
-
getViewPostMetadata
Gets theViewPostMetadatathat has been built up from processing of a view.The view post metadata is used to read information about the view that was rendered when a post occurs. For example, you might need to check whether a particular flag was enabled for the rendered view when processing the post logic
- Specified by:
getViewPostMetadatain interfaceViewModel- Returns:
- ViewPostMetadata instance for the previously processed view
-
setViewPostMetadata
- Specified by:
setViewPostMetadatain interfaceViewModel- See Also:
-
getViewService
Instance of theViewServicethat can be used to retrieveViewinstances- Returns:
- ViewService implementation
-
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
- Parameters:
jumpToId- the jumpToId to set
-
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
- Parameters:
jumpToName- the jumpToName to set
-
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
- Parameters:
focusId- the focusId to set
-
isDirtyForm
public boolean isDirtyForm()True when the form is considered dirty (data has changed from original value), false otherwiseFor most scenarios, this flag should NOT be set to true. If this is set, it must be managed explicitly by the application. This flag exists for marking a form dirty from a server call, so it must be changed to false when the form is no longer considered dirty. The krad save Action and navigate methodToCall resets this flag back to false, but any other setting of this flag must be managed by custom configuration/methods, if custom dirtyForm management is needed.
- Returns:
- true if the form is considered dirty, false otherwise
-
setDirtyForm
public void setDirtyForm(boolean dirtyForm) Sets the dirtyForm flagFor most scenarios, this flag should NOT be set to true. If this is set, it must be managed explicitly by the application. This flag exists for marking a form dirty from a server call, so it must be changed to false when the form is no longer considered dirty. The krad save Action and navigate methodToCall resets this flag back to false, but any other setting of this flag must be managed by custom configuration/methods, if custom dirtyForm management is needed.
-
setDirtyForm
Set the dirtyForm flag using a String that will be converted to boolean -
isRenderedInDialog
public boolean isRenderedInDialog()Indicates whether the view is rendered within a lightboxSome 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
-
setRenderedInDialog
public void setRenderedInDialog(boolean renderedInDialog) Setter for the rendered within lightbox indicator -
isRenderedInIframe
public boolean isRenderedInIframe()Indicates whether the view is rendered within an iframe (this setting must be passed to the View on the url)- Returns:
- boolean true if view is rendered within a iframe, false if not
-
setRenderedInIframe
public void setRenderedInIframe(boolean renderedInIframe) - See Also:
-
isApplyDefaultValues
public boolean isApplyDefaultValues()Description copied from interface:ViewModelIndicates whether default values should be applied.Default field values of a view need to be applied after the view life cycle completes. Otherwise, they risk getting over written.
- Specified by:
isApplyDefaultValuesin interfaceViewModel- Returns:
- boolean true if the request was an ajax call, false if not
- See Also:
-
setApplyDefaultValues
public void setApplyDefaultValues(boolean applyDefaultValues) Description copied from interface:ViewModelSet whether default values should be applied to the view- Specified by:
setApplyDefaultValuesin interfaceViewModel- See Also:
-
isEvaluateFlagsAndModes
public boolean isEvaluateFlagsAndModes()Description copied from interface:ViewModelDetermines whether edit modes and action flags should be evaluated.Initially this will be true causing edit modes and action flags to be evaluated on the initial request to a view. If these need to be reevaluated at some point (for a particular view instance), this flag can be set to true and causing the authorization to be reevaluated during the lifecycle.
- Specified by:
isEvaluateFlagsAndModesin interfaceViewModel- Returns:
- boolean true if flags and modes should be evaluate during the view lifecycle, false if not
- See Also:
-
setEvaluateFlagsAndModes
public void setEvaluateFlagsAndModes(boolean evaluateFlagsAndModes) - Specified by:
setEvaluateFlagsAndModesin interfaceViewModel- See Also:
-
isCanEditView
Description copied from interface:ViewModelCopy of the edit view flag to be used by subsequent requests (so they don't need to be evaluated on each request).If null, edit check will be performed
- Specified by:
isCanEditViewin interfaceViewModel- See Also:
-
setCanEditView
- Specified by:
setCanEditViewin interfaceViewModel- See Also:
-
getActionFlags
Description copied from interface:ViewModelCopy of the action flags on the view to be used by subsequent requests (so they don't need to be evaluated on each request).- Specified by:
getActionFlagsin interfaceViewModel- See Also:
-
setActionFlags
- Specified by:
setActionFlagsin interfaceViewModel- See Also:
-
getEditModes
Description copied from interface:ViewModelCopy of the edit modes on the view to be used by subsequent requests (so they don't need to be evaluated on each request).- Specified by:
getEditModesin interfaceViewModel- See Also:
-
setEditModes
- Specified by:
setEditModesin interfaceViewModel- See Also:
-
getGrowlScript
Description copied from interface:ViewModelScript that will run on render (view or component) for generating growl messages- Specified by:
getGrowlScriptin interfaceViewModel- Returns:
- String JS growl script
- See Also:
-
setGrowlScript
Description copied from interface:ViewModelSetter for the script that generates growls on render- Specified by:
setGrowlScriptin interfaceViewModel- Parameters:
growlScript-- See Also:
-
getState
Description copied from interface:ViewModelGets the state. This is the default location for state on KRAD forms. -
setState
Description copied from interface:ViewModelSet the state -
isAjaxRequest
public boolean isAjaxRequest()Description copied from interface:ViewModelIndicates whether the request was made by an ajax callDepending 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:
isAjaxRequestin interfaceViewModel- Returns:
- boolean true if the request was an ajax call, false if not
- See Also:
-
setAjaxRequest
public void setAjaxRequest(boolean ajaxRequest) Description copied from interface:ViewModelSet the ajaxRequest- Specified by:
setAjaxRequestin interfaceViewModel- Parameters:
ajaxRequest-- See Also:
-
getAjaxReturnType
Description copied from interface:ViewModelGets the return type for the ajax callThe 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:
getAjaxReturnTypein interfaceViewModel- Returns:
- String return type
- See Also:
-
setAjaxReturnType
Description copied from interface:ViewModelSetter for the type of ajax return- Specified by:
setAjaxReturnTypein interfaceViewModel- Parameters:
ajaxReturnType-- See Also:
-
isUpdateComponentRequest
public boolean isUpdateComponentRequest()Description copied from interface:ViewModelIndicates whether the request is to update a component (only applicable for ajax requests)- Specified by:
isUpdateComponentRequestin interfaceViewModel- Returns:
- boolean true if the request is for update component, false if not
- See Also:
-
isUpdateDialogRequest
public boolean isUpdateDialogRequest()Description copied from interface:ViewModelIndicates whether the request is to update a dialog (only applicable for ajax requests)- Specified by:
isUpdateDialogRequestin interfaceViewModel- Returns:
- boolean true if the request is for update dialog, false if not
- See Also:
-
isUpdatePageRequest
public boolean isUpdatePageRequest()Description copied from interface:ViewModelIndicates whether the request is to update a page (only applicable for ajax requests)- Specified by:
isUpdatePageRequestin interfaceViewModel- Returns:
- boolean true if the request is for update page, false if not
- See Also:
-
isUpdateNoneRequest
public boolean isUpdateNoneRequest()Description copied from interface:ViewModelIndicates 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:
isUpdateNoneRequestin interfaceViewModel- Returns:
- boolean true if the request is for non-update, false if not
- See Also:
-
isJsonRequest
public boolean isJsonRequest()Description copied from interface:ViewModelIndicates whether the request should return a JSON stringWhen this indicator is true, the rendering process will invoke the template given by
ViewModel.getRequestJsonTemplate()which should return a JSON stringFor JSON requests the view is not built, however a component can be retrieved and exported in the request by setting
ViewModel.getUpdateComponentId()- Specified by:
isJsonRequestin interfaceViewModel- Returns:
- boolean true if request is for JSON, false if not
- See Also:
-
getRequestJsonTemplate
Description copied from interface:ViewModelTemplate the will be invoked to return a JSON stringCertain templates can be rendered to build JSON for a JSON request. The template set here (by a controller) will be rendered
- Specified by:
getRequestJsonTemplatein interfaceViewModel- Returns:
- path to template
- See Also:
-
setRequestJsonTemplate
Description copied from interface:ViewModelSetter for the template to render for the request- Specified by:
setRequestJsonTemplatein interfaceViewModel- Parameters:
requestJsonTemplate-- See Also:
-
isCollectionPagingRequest
public boolean isCollectionPagingRequest()Indicates whether the request is for paging a collection (or sorting).- Specified by:
isCollectionPagingRequestin interfaceViewModel- Returns:
- boolean true if a paging request is present, false if not
-
setCollectionPagingRequest
public void setCollectionPagingRequest(boolean collectionPagingRequest) - Specified by:
setCollectionPagingRequestin interfaceViewModel- See Also:
-
getShowDialogId
For cases where the request was triggered from within a dialog, we want to show that dialog, identified by this id, again. -
setShowDialogId
- See Also:
-
getReturnDialogId
Used by the dialog framework to set the dialog id for a return dialog call (when the server has triggered a dialog).Note this is a request only property. On a return call the value for this gets pulled and used to create an entry in
getDialogResponses()- Returns:
- String id for the dialog being returned from
-
setReturnDialogId
- See Also:
-
getReturnDialogResponse
Used by the dialog framework to set the dialog response for a return dialog call (when the server has triggered a dialog).Note this is a request only property. On a return call the value for this gets pulled and used to create an entry in
getDialogResponses()- Returns:
- String response for the dialog being returned from
-
setReturnDialogResponse
- See Also:
-
getDialogExplanations
Contains values for dialog explanation fields present on the page.Since multiple dialogs can be present on the same page using the generic explanation field, the values are maintained in this map using the dialog id as the key. Values are cleared on each request.
- Specified by:
getDialogExplanationsin interfaceViewModel- Returns:
- map of dialog explanations, where key is the dialog id and map value is the explanation
-
setDialogExplanations
- Specified by:
setDialogExplanationsin interfaceViewModel- See Also:
-
getDialogResponses
Map containing dialog responses for a request 'conversation'.When a controller methods requests a dialog, the response is collected on the return call and placed into this map. The key to the map is the id for the dialog. Since a single controller method can spawn multiple dialogs in a single conversation (these are actually multiple requests/responses, but part of the same action request), the responses are collected in this map. Whenever a request is encountered that is not a return, the map is cleared. This means the responses will be cleared in case the action is triggered action.
- Specified by:
getDialogResponsesin interfaceViewModel- Returns:
- map of dialog responses, where map key is the dialog id and the map value is the dialog response object
-
getDialogResponse
Helper method to get a dialog response for the given dialog id.- Specified by:
getDialogResponsein interfaceViewModel- Parameters:
dialogId- id of the dialog to get response for- Returns:
- dialog response object, or null if response does not exist
- See Also:
-
setDialogResponses
- Specified by:
setDialogResponsesin interfaceViewModel- See Also:
-
getExtensionData
Description copied from interface:ViewModelA generic map for framework pieces (such as component modifiers) that need to dynamically store data to the form- Specified by:
getExtensionDatain interfaceViewModel- Returns:
- Mapinvalid input: '<'String, Object>
- See Also:
-
setExtensionData
Setter for the generic extension data map- Specified by:
setExtensionDatain interfaceViewModel- Parameters:
extensionData-
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()Http servlet request instance for the current request being processed.- Returns:
- HttpServletRequest instance
-
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request) - See Also:
-
getAddedCollectionItems
TheListthat contains all newly added items for the collections on the modelThis list contains the new items for all the collections on the model.
- Returns:
- List of the newly added item lists
-
setAddedCollectionItems
Setter for the newly added item list -
isAddedCollectionItem
Indicates whether an collection item has been newly addedTests 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
-
getDialogDataObject
The data object to bind to for a dialogThe data object serves as a placeholder for temporary properties that might be used within a dialog. The purpose of placeholder is to provide a separation between the dialog object and the underlying object for use in cases like object manipulation.
-
setDialogDataObject
- See Also:
-
toString
-
getCsrfToken
-
setCsrfToken
-