本文整理汇总了Java中javax.faces.el.ValueBinding.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java ValueBinding.getValue方法的具体用法?Java ValueBinding.getValue怎么用?Java ValueBinding.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.faces.el.ValueBinding
的用法示例。
在下文中一共展示了ValueBinding.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: select
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public String select()
{
FacesContext context = FacesContext.getCurrentInstance();
// The tableSelectOne is marked as required; so there'd better
// be a selected row - an exception will result here if there
// isn't. Is there some better code?
Iterator<Object> iterator = _table.getSelectedRowKeys().iterator();
Object rowKey = iterator.next();
Object oldRowKey = _table.getRowKey();
_table.setRowKey(rowKey);
ValueBinding binding = context.getApplication().
createValueBinding("#{row.symbol}");
Object value = binding.getValue(context);
RequestContext.getCurrentInstance().returnFromDialog(value, null);
_table.setRowKey(oldRowKey);
return null;
}
示例2: select
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public String select() {
try{
FacesContext context = FacesContext.getCurrentInstance();
Iterator<Object> iterator = _table.getSelectedRowKeys().iterator();
Object rowKey = iterator.next();
Object oldRowKey = _table.getRowKey();
_table.setRowKey(rowKey);
ValueBinding binding = context.getApplication().
createValueBinding("#{row.name}");
Object value = binding.getValue(context);
RequestContext.getCurrentInstance().returnFromDialog(value, null);
_table.setRowKey(oldRowKey);
}
catch (NoSuchElementException e){}
return null;
}
示例3: getInstance
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
public Object getInstance() throws InstantiationException
{
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext == null)
{
log.error("Object " + getManagedBeanName() + " cannot be created since the faces context is null");
return null;
}
Application application = facesContext.getApplication();
Object resolvedObject = null;
if (isVBExpression(getManagedBeanName()))
{
ValueBinding vb = application.createValueBinding(getManagedBeanName());
if (vb != null)
{
resolvedObject = vb.getValue(facesContext);
}
}
else
{
VariableResolver resolver = application.getVariableResolver();
resolvedObject = resolver.resolveVariable(facesContext, getManagedBeanName());
}
return resolvedObject;
}
示例4: getInstance
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
@Override
public Object getInstance() throws InstantiationException
{
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext == null)
{
log.error("Object " + getManagedBeanName() + " cannot be created since the faces context is null");
return null;
}
Application application = facesContext.getApplication();
Object resolvedObject = null;
if (isVBExpression(getManagedBeanName()))
{
ValueBinding vb = application.createValueBinding(getManagedBeanName());
if (vb != null)
{
resolvedObject = vb.getValue(facesContext);
}
}
else
{
VariableResolver resolver = application.getVariableResolver();
resolvedObject = resolver.resolveVariable(facesContext, getManagedBeanName());
}
return resolvedObject;
}
示例5: getNumDataItemsForToggle
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
private int getNumDataItemsForToggle(FacesContext context, UIComponent component) {
int numDataItems = 0;
ValueBinding gbItemsBinding = component.getValueBinding("value");
List gbItemList = (List)gbItemsBinding.getValue(context);
if (gbItemList != null && !gbItemList.isEmpty()) {
numDataItems = gbItemList.size();
}
return numDataItems;
}
示例6: getFieldOrBinding
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
protected Object getFieldOrBinding(Object field, String bindingName) {
Object retVal = null;
if (field != null) {
retVal = field;
} else {
ValueBinding binding = getValueBinding(bindingName);
if (binding != null) {
retVal = binding.getValue(getFacesContext());
}
}
return retVal;
}
示例7: getAttribute
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
/**
* Return the attribute value - handles getting the value from a
* ValueBinding if necessary. This is necessary because of a difference in
* the Sun JSF RI versus the MyFaces RI. The Sun RI
* component.getAttributes().get(attrName) will automatically return value
* bindings, whereas the MyFaces implmentation requires getting values from
* ValueBinding seperately.
*/
public static Object getAttribute(FacesContext context, UIComponent component, String name)
{
// first check the attributes
Object ret = component.getAttributes().get(name);
if (ret != null)
return ret;
// next check the value bindings
ValueBinding vb = component.getValueBinding(name);
if (vb != null)
ret = vb.getValue(context);
return ret;
}
示例8: getBean
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
public PhaseAware getBean() {
PhaseAware bean = null;
ValueBinding vb = getValueBinding("bean");
if (vb != null) {
bean = (PhaseAware) vb.getValue(getFacesContext());
}
if (log.isDebugEnabled()) log.debug("getBean " + bean);
return bean;
}
示例9: get
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
/**
*
* @param context FacesContext
* @param component UIComponent
* @param name String
* @return Object
*/
private static Object get(FacesContext context, UIComponent component,
String name)
{
ValueBinding binding = component.getValueBinding(name);
if (binding != null)
{
return binding.getValue(context);
}
else
{
return component.getAttributes().get(name);
}
}
示例10: returnValueBindingAsString
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
public String returnValueBindingAsString(String attr) {
ValueBinding valueBinding = getValueBinding(attr);
if (valueBinding != null)
return (String)valueBinding.getValue(this.getFacesContext());
else
return null;
}
示例11: getNavbarLogoStyleClass
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
public String getNavbarLogoStyleClass() {
if(navbarLogoStyleClass!=null) {
return navbarLogoStyleClass;
}
ValueBinding vb = getValueBinding("navbarLogoStyleClass"); // $NON-NLS-1$
if(vb!=null) {
return (String)vb.getValue(getFacesContext());
}
return null;
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:SimpleResponsiveApplicationConfiguration.java
示例12: getTitle
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
public String getTitle() {
if (null != this.title) {
return this.title;
}
ValueBinding _vb = getValueBinding("title"); //$NON-NLS-1$
if (_vb != null) {
return (java.lang.String) _vb.getValue(FacesContext.getCurrentInstance());
} else {
return null;
}
}
示例13: isUseHash
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
public boolean isUseHash() {
if (null != this.useHash) {
return this.useHash;
}
ValueBinding _vb = getValueBinding("useHash"); //$NON-NLS-1$
if (_vb != null) {
Boolean val = (java.lang.Boolean) _vb.getValue(FacesContext.getCurrentInstance());
if(val!=null) {
return val;
}
}
return false;
}
示例14: isSelectable
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
public boolean isSelectable() {
if (null != this.selectable) {
return this.selectable;
}
ValueBinding _vb = getValueBinding("selectable"); //$NON-NLS-1$
if (_vb != null) {
Boolean val = (java.lang.Boolean) _vb.getValue(getFacesContext());
if(val!=null) {
return val;
}
}
return false;
}
示例15: getTimeout
import javax.faces.el.ValueBinding; //导入方法依赖的package包/类
public int getTimeout() {
if (null != this.timeout) {
return this.timeout;
}
ValueBinding _vb = getValueBinding("timeout"); //$NON-NLS-1$
if (_vb != null) {
Number val = (Number) _vb.getValue(FacesContext.getCurrentInstance());
if(val!=null) {
return val.intValue();
}
}
return 0;
}