Search in sources :

Example 1 with ComponentBindingObject

use of com.ibm.xsp.binding.ComponentBindingObject in project org.openntf.domino by OpenNTF.

the class FormulaContextXsp method getValueBinding.

/**
 * Create a value binding for {@link #getField(String)} and {@link #setField(String, ValueHolder)}
 *
 * @param variable
 *            the variableName, like <code>"document2.Form"</code>
 * @return a {@link ValueBinding}
 */
protected ValueBinding getValueBinding(final String variable) {
    ValueBinding ret = valueBindings.get(variable);
    if (ret == null) {
        ApplicationEx app = (ApplicationEx) context.getApplication();
        // $NON-NLS-1$ //$NON-NLS-2$
        ret = app.createValueBinding("#{" + variable + "}");
        if ((ret instanceof ValueBindingEx)) {
            ValueBindingEx valueEx = (ValueBindingEx) ret;
            valueEx.setComponent(component);
            // TODO RPr: What to set here
            valueEx.setSourceReferenceId(null);
            valueEx.setExpectedType(Object.class);
        } else if ((ret instanceof ComponentBindingObject)) {
            ((ComponentBindingObject) ret).setComponent(component);
        }
        valueBindings.put(variable, ret);
    }
    return ret;
}
Also used : ValueBindingEx(com.ibm.xsp.binding.ValueBindingEx) ApplicationEx(com.ibm.xsp.application.ApplicationEx) ValueBinding(javax.faces.el.ValueBinding) ComponentBindingObject(com.ibm.xsp.binding.ComponentBindingObject)

Aggregations

ApplicationEx (com.ibm.xsp.application.ApplicationEx)1 ComponentBindingObject (com.ibm.xsp.binding.ComponentBindingObject)1 ValueBindingEx (com.ibm.xsp.binding.ValueBindingEx)1 ValueBinding (javax.faces.el.ValueBinding)1