@Name(value="selectionActions") @Scope(value=EVENT) public class SelectionActionsBean extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
SelectionActionsBean.ShiftType |
Modifier and Type | Field and Description |
---|---|
protected String |
leftItems |
protected String |
leftSelect |
protected Integer |
lookupLevel
Lookup level request parameter (defaults to 1, means search is done in r first parent naming container)
|
protected String |
lookupLevelValue
Lookup level field (defaults to 1, means search is done in first parent naming container)
|
protected String |
rightItems |
protected String |
rightSelect |
protected String |
selectedValue
Value held temporarily by this bean to be set on JSF components.
|
protected String |
selectedValueHolder
Value component id held temporarily by this bean to be retrieved from the JSF component tree.
|
protected String |
selectorId
Id of the input selector
|
protected String |
submittedList |
protected String |
valueHolderId
Id of the value holder that will receive the selected value.
|
Constructor and Description |
---|
SelectionActionsBean() |
Modifier and Type | Method and Description |
---|---|
void |
addAllToSelection(javax.faces.event.ActionEvent event) |
void |
addToSelection(javax.faces.event.ActionEvent event) |
protected boolean |
checkLeftComponents() |
protected boolean |
checkRightComponents() |
protected boolean |
checkSubmittedList() |
protected int |
computeLookupLevel() |
javax.faces.model.SelectItem[] |
getEmptySelection() |
String |
getLookupLevelValue() |
String |
getSelectedValue() |
String |
getSelectedValueHolder() |
javax.faces.component.UISelectMany |
getSourceSelectComponent(javax.faces.event.ActionEvent event) |
javax.faces.component.UISelectItems |
getSourceSelectItems(javax.faces.event.ActionEvent event) |
protected String |
getStringAttribute(javax.faces.component.UIComponent component,
String name,
boolean required) |
void |
onClick(javax.faces.event.ActionEvent event)
Deprecated.
since 6.0: use
onClick(AjaxBehaviorEvent) instead. |
void |
onClick(javax.faces.event.AjaxBehaviorEvent event) |
protected void |
onClick(javax.faces.event.FacesEvent event) |
void |
onSelection(javax.faces.event.ActionEvent event)
Deprecated.
since 6.0: use
onSelection(AjaxBehaviorEvent) instead. |
void |
onSelection(javax.faces.event.AjaxBehaviorEvent event) |
protected void |
onSelection(javax.faces.event.FacesEvent event) |
void |
removeAllFromSelection(javax.faces.event.ActionEvent event) |
void |
removeFromSelection(javax.faces.event.ActionEvent event) |
protected javax.faces.component.UIComponent |
retrieveBase(javax.faces.component.UIComponent anchor,
int lookupLevel) |
protected Object |
retrieveSourceComponentValue(javax.faces.component.UIComponent base,
String targetId) |
void |
setLookupLevelValue(String lookupLevelValue) |
void |
setSelectedValue(String selectedValue) |
void |
setSelectedValueHolder(String selectedValueHolder) |
void |
setStaticValue(javax.faces.event.ActionEvent event) |
void |
setStaticValue(javax.faces.event.AjaxBehaviorEvent event)
Retrieves a value passed as an attribute with id "selectedValue" on the event component attributes and sets it on
the target component.
|
protected void |
setStaticValue(javax.faces.event.FacesEvent event) |
protected void |
setTargetComponentValue(javax.faces.component.ValueHolder target,
Object value) |
void |
setValueFromComponent(javax.faces.event.ActionEvent event) |
void |
setValueFromComponent(javax.faces.event.AjaxBehaviorEvent event)
Retrieves a value from another component and sets it on the target component.
|
protected void |
setValueFromComponent(javax.faces.event.FacesEvent event) |
void |
shiftSelected(SelectionActionsBean.ShiftType stype,
javax.faces.event.ActionEvent event) |
void |
shiftSelectedDown(javax.faces.event.ActionEvent event) |
void |
shiftSelectedFirst(javax.faces.event.ActionEvent event) |
void |
shiftSelectedLast(javax.faces.event.ActionEvent event) |
void |
shiftSelectedUp(javax.faces.event.ActionEvent event) |
@RequestParameter protected String leftSelect
@RequestParameter protected String rightSelect
@RequestParameter protected String rightItems
@RequestParameter protected String submittedList
@RequestParameter protected String selectorId
Component must be an instance of ValueHolder
@RequestParameter protected String valueHolderId
Component must be an instance of ValueHolder
@RequestParameter protected Integer lookupLevel
protected String lookupLevelValue
Useful as fallback when posting a button where request parameter lookupLevel
cannot be set.
@RequestParameter protected String selectedValue
protected String selectedValueHolder
this is an alternative to valueHolderId
request parameter usage, to make it possible to set this value
easily from command buttons (as only command links do take request parameters into account).
public SelectionActionsBean()
public String getLookupLevelValue()
public void setLookupLevelValue(String lookupLevelValue)
protected int computeLookupLevel()
public String getSelectedValue()
public void setSelectedValue(String selectedValue)
public String getSelectedValueHolder()
public void setSelectedValueHolder(String selectedValueHolder)
public javax.faces.model.SelectItem[] getEmptySelection()
protected boolean checkRightComponents()
protected boolean checkLeftComponents()
protected boolean checkSubmittedList()
public void shiftSelected(SelectionActionsBean.ShiftType stype, javax.faces.event.ActionEvent event)
public void shiftSelectedUp(javax.faces.event.ActionEvent event)
public void shiftSelectedDown(javax.faces.event.ActionEvent event)
public void shiftSelectedFirst(javax.faces.event.ActionEvent event)
public void shiftSelectedLast(javax.faces.event.ActionEvent event)
public void addToSelection(javax.faces.event.ActionEvent event)
public void removeFromSelection(javax.faces.event.ActionEvent event)
public void addAllToSelection(javax.faces.event.ActionEvent event)
public javax.faces.component.UISelectMany getSourceSelectComponent(javax.faces.event.ActionEvent event)
public javax.faces.component.UISelectItems getSourceSelectItems(javax.faces.event.ActionEvent event)
public void removeAllFromSelection(javax.faces.event.ActionEvent event)
@Deprecated public void onSelection(javax.faces.event.ActionEvent event)
onSelection(AjaxBehaviorEvent)
instead.Must pass request parameters "selectorId" holding the id of component holding the value to pass to the other component, and "valueHolderId" holding the other component id.
event
- public void onSelection(javax.faces.event.AjaxBehaviorEvent event)
protected void onSelection(javax.faces.event.FacesEvent event)
@Deprecated public void onClick(javax.faces.event.ActionEvent event)
onClick(AjaxBehaviorEvent)
instead.getSelectedValue()
to a component
Must pass request parameters "valueHolderId" holding the id of the bound component, and call
setSelectedValue(String)
prior to this call.
As an alternative, must call setSelectedValueHolder(String)
with the id of the bound component, and call
setSelectedValue(String)
prior to this call (this makes it possible to use the same logic in command
buttons that do not make it possible to pass request parameters).
event
- public void onClick(javax.faces.event.AjaxBehaviorEvent event)
protected void onClick(javax.faces.event.FacesEvent event)
protected javax.faces.component.UIComponent retrieveBase(javax.faces.component.UIComponent anchor, int lookupLevel)
public void setValueFromComponent(javax.faces.event.AjaxBehaviorEvent event)
Source component id must be passed in the event component attributes with id "sourceComponentId".
Target component id must be passed in the event component attributes with id "targetComponentId". If target
component is an EditableValueHolder
, its submitted value is set. Otherwise, its local value is set.
event
- public void setValueFromComponent(javax.faces.event.ActionEvent event)
setValueFromComponent(ActionEvent)
protected void setValueFromComponent(javax.faces.event.FacesEvent event)
public void setStaticValue(javax.faces.event.AjaxBehaviorEvent event)
Target component id must be passed in the event component attributes with id "targetComponentId". If target
component is an EditableValueHolder
, its submitted value is set. Otherwise, its local value is set.
event
- public void setStaticValue(javax.faces.event.ActionEvent event)
setStaticValue(ActionEvent)
protected void setStaticValue(javax.faces.event.FacesEvent event)
protected String getStringAttribute(javax.faces.component.UIComponent component, String name, boolean required)
protected Object retrieveSourceComponentValue(javax.faces.component.UIComponent base, String targetId)
protected void setTargetComponentValue(javax.faces.component.ValueHolder target, Object value)
Copyright © 2018 Nuxeo. All rights reserved.