|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.web.form.UifFormBase
public class UifFormBase
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
Field Summary | |
---|---|
protected Map<String,String> |
actionParameters
|
protected org.springframework.web.multipart.MultipartFile |
attachmentFile
|
protected Map<String,Object> |
clientStateForSyncing
|
protected boolean |
defaultsApplied
|
protected String |
focusId
|
protected History |
formHistory
|
protected String |
formKey
|
protected String |
formPostUrl
|
protected String |
jumpToId
|
protected String |
jumpToName
|
protected String |
methodToCall
|
protected Map<String,Object> |
newCollectionLines
|
protected String |
pageId
|
protected View |
postedView
|
protected List<String> |
readOnlyFieldsList
|
protected boolean |
renderFullView
|
protected String |
returnFormKey
|
protected String |
returnLocation
|
protected Map<String,Set<String>> |
selectedCollectionLines
|
protected boolean |
skipViewInit
|
protected boolean |
validateDirty
|
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 |
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 |
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 |
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 |
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 |
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 |
isDefaultsApplied()
Indicates whether the form has had default values from the configured View applied. |
boolean |
isRenderFullView()
|
boolean |
isSkipViewInit()
Indicates whether a new view is being initialized or the call is refresh (or query) call |
boolean |
isValidateDirty()
Indicates whether the form should be validated for dirtyness |
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 |
setAttachmentFile(org.springframework.web.multipart.MultipartFile attachmentFile)
Setter for the form's attachment file |
void |
setDefaultsApplied(boolean defaultsApplied)
Setter for the defaults applied indicator |
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 |
setJumpToId(String jumpToId)
|
void |
setJumpToName(String jumpToName)
|
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 |
setRenderFullView(boolean renderFullView)
|
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 |
setSkipViewInit(boolean skipViewInit)
Setter for the skip view initialization flag |
void |
setValidateDirty(boolean validateDirty)
Setter for dirty validation indicator |
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 |
---|
protected String viewId
protected String viewName
protected UifConstants.ViewType viewTypeName
protected String pageId
protected String methodToCall
protected String formKey
protected String jumpToId
protected String jumpToName
protected String focusId
protected String formPostUrl
protected boolean defaultsApplied
protected boolean skipViewInit
protected View view
protected View postedView
protected Map<String,String> viewRequestParameters
protected List<String> readOnlyFieldsList
protected Map<String,Object> newCollectionLines
protected Map<String,String> actionParameters
protected Map<String,Object> clientStateForSyncing
protected Map<String,Set<String>> selectedCollectionLines
protected org.springframework.web.multipart.MultipartFile attachmentFile
protected String returnLocation
protected String returnFormKey
protected History formHistory
protected boolean renderFullView
protected boolean validateDirty
Constructor Detail |
---|
public UifFormBase()
Method Detail |
---|
protected String generateFormKey()
public void postBind(javax.servlet.http.HttpServletRequest request)
request
- - request object containing the query parameterspublic String getViewId()
ViewModel
View
instance. This is specified for a
view in its definition by setting the 'id' property.
getViewId
in interface ViewModel
ViewModel.getViewId()
public void setViewId(String viewId)
ViewModel
setViewId
in interface ViewModel
ViewModel.setViewId(java.lang.String)
public String getViewName()
ViewModel
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)
getViewName
in interface ViewModel
ViewModel.getViewName()
public void setViewName(String viewName)
ViewModel
setViewName
in interface ViewModel
ViewModel.setViewName(java.lang.String)
public UifConstants.ViewType getViewTypeName()
ViewModel
View
instances by request parameters (not necessary the
unique id)
getViewTypeName
in interface ViewModel
ViewModel.getViewTypeName()
public void setViewTypeName(UifConstants.ViewType viewTypeName)
ViewModel
setViewTypeName
in interface ViewModel
ViewModel.setViewTypeName(org.kuali.rice.krad.uif.UifConstants.ViewType)
public String getPageId()
ViewModel
getPageId
in interface ViewModel
ViewModel.getPageId()
public void setPageId(String pageId)
ViewModel
setPageId
in interface ViewModel
ViewModel.setPageId(java.lang.String)
public String getFormPostUrl()
ViewModel
getFormPostUrl
in interface ViewModel
ViewModel.getFormPostUrl()
public void setFormPostUrl(String formPostUrl)
ViewModel
setFormPostUrl
in interface ViewModel
ViewModel.setFormPostUrl(java.lang.String)
public String getReturnLocation()
public void setReturnLocation(String returnLocation)
public String getReturnFormKey()
public void setReturnFormKey(String returnFormKey)
public String getMethodToCall()
RequestMapping
annotation for the controller method
public void setMethodToCall(String methodToCall)
methodToCall
- public Map<String,String> getViewRequestParameters()
ViewModel
View
.
Maintained on the form to rebuild the view on posts and session timeout
getViewRequestParameters
in interface ViewModel
ViewModel.getViewRequestParameters()
public void setViewRequestParameters(Map<String,String> viewRequestParameters)
ViewModel
setViewRequestParameters
in interface ViewModel
org.kuali.rice.krad.uif.view.ViewModel#setViewRequestParameters(java.util.Map)
public List<String> getReadOnlyFieldsList()
ViewModel
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
getReadOnlyFieldsList
in interface ViewModel
ViewModel.getReadOnlyFieldsList()
public void setReadOnlyFieldsList(List<String> readOnlyFieldsList)
ViewModel
setReadOnlyFieldsList
in interface ViewModel
org.kuali.rice.krad.uif.view.ViewModel#setReadOnlyFieldsList(java.util.List)
public Map<String,Object> getNewCollectionLines()
ViewModel
getNewCollectionLines
in interface ViewModel
ViewModel.getNewCollectionLines()
public void setNewCollectionLines(Map<String,Object> newCollectionLines)
ViewModel
setNewCollectionLines
in interface ViewModel
org.kuali.rice.krad.uif.view.ViewModel#setNewCollectionLines(java.util.Map)
public Map<String,String> getActionParameters()
ViewModel
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.
getActionParameters
in interface ViewModel
ViewModel.getActionParameters()
public Properties getActionParametersAsProperties()
Properties
instance
public void setActionParameters(Map<String,String> actionParameters)
ViewModel
setActionParameters
in interface ViewModel
org.kuali.rice.krad.uif.view.ViewModel#setActionParameters(java.util.Map)
public String getActionParamaterValue(String actionParameterName)
actionParameterName
- - name of the action parameter to retrieve value for
public String getActionEvent()
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
public Map<String,Object> getClientStateForSyncing()
ViewModel
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.
getClientStateForSyncing
in interface ViewModel
ViewModel.getClientStateForSyncing()
public Map<String,Set<String>> getSelectedCollectionLines()
ViewModel
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.
getSelectedCollectionLines
in interface ViewModel
ViewModel.getSelectedCollectionLines()
public void setSelectedCollectionLines(Map<String,Set<String>> selectedCollectionLines)
ViewModel
setSelectedCollectionLines
in interface ViewModel
org.kuali.rice.krad.uif.view.ViewModel#setSelectedCollectionLines(java.util.Map>)
public String getFormKey()
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
public void setFormKey(String formKey)
formKey
- public boolean isDefaultsApplied()
ViewModel
View
applied. This happens only once for each form instance
isDefaultsApplied
in interface ViewModel
ViewModel.isDefaultsApplied()
public void setDefaultsApplied(boolean defaultsApplied)
ViewModel
setDefaultsApplied
in interface ViewModel
ViewModel.setDefaultsApplied(boolean)
public boolean isSkipViewInit()
public void setSkipViewInit(boolean skipViewInit)
skipViewInit
- public org.springframework.web.multipart.MultipartFile getAttachmentFile()
public void setAttachmentFile(org.springframework.web.multipart.MultipartFile attachmentFile)
attachmentFile
- public boolean isRenderFullView()
public void setRenderFullView(boolean renderFullView)
renderFullView
- public View getView()
ViewModel
getView
in interface ViewModel
ViewModel.getView()
public void setView(View view)
ViewModel
setView
in interface ViewModel
ViewModel.setView(org.kuali.rice.krad.uif.view.View)
public View getPostedView()
ViewModel
getPostedView
in interface ViewModel
ViewModel.getPostedView()
public void setPostedView(View postedView)
ViewModel
setPostedView
in interface ViewModel
ViewModel.setPostedView(org.kuali.rice.krad.uif.view.View)
protected ViewService getViewService()
ViewService
that can be used to retrieve
View
instances
public String getJumpToId()
public void setJumpToId(String jumpToId)
jumpToId
- the jumpToId to setpublic String getJumpToName()
public void setJumpToName(String jumpToName)
jumpToName
- the jumpToName to setpublic String getFocusId()
public void setFocusId(String focusId)
focusId
- the focusId to setpublic History getFormHistory()
Used for breadcrumb widget generation on the view and also for navigating back to previous or hub locations
public void setFormHistory(History history)
history
- the history to setpublic boolean isValidateDirty()
For FormView, it's necessary to validate when the user tries to navigate out of the form. If set, all the InputFields will be validated on refresh, navigate, cancel or close Action or on form unload and if dirty, displays a message and user can decide whether to continue with the action or stay on the form
public void setValidateDirty(boolean validateDirty)
validateDirty
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |