/** Indicate that the "markup" field for this control is to be interpreted * as a message key, to be looked up to a piece of markup in the associated * message bundle. */ public UIVerbatim setMessageKey() { this.resolver = new ELReference("#{messageLocator}"); return this; } }
public Object copy(Object tocopyo) { ELReference tocopy = (ELReference) tocopyo; ELReference togo = new ELReference(); togo.value = tocopy.value; return togo; }
/** Sets the option labels for this selection control to be interpreted * as message keys, rather than as raw Strings. */ public UISelect setMessageKeys() { optionnames.resolver = new ELReference("#{messageLocator}"); return this; }
/** Determine that this is a selection control of entity ids, as managed via an * EntityNameInferrer (perhaps through an EntityBeanLocator) and should, * on submission, have the effect of assigning the entire managed entities * rather than the selected id itself. */ public UISelect setIDDefunnel() { selection.darreshaper = new ELReference("#{id-defunnel}"); return this; }
public static ELReference make(String value) { return value == null? null : new ELReference(value); } }
/** Create a binding that will assign the Object or EL reference <code>rvalue</code> * to the EL path <code>lvalue</code> in the following request cycle. * @param lvalue the EL reference at which the specified object will be assigned. * @param rvalue Either a literal Object, or an {@link ELReference} from which it * can be read in the following request, which is to be assigned to the lvalue path. * @param virtual <code>true</code> if this is a "virtual binding" - that is one that * will not be automatically applied by the client action, but is for the instruction * of client-side code * @param encoding An encoding form in which the rvalue is to be encoded, either * {@link DataAlterationRequest#JSON_ENCODING} (the default) * or {@link DataAlterationRequest#XML_ENCODING}. */ public UIELBinding(String lvalue, Object rvalue, boolean virtual, String encoding) { valuebinding = new ELReference(lvalue); this.rvalue = rvalue; this.virtual = virtual; this.encoding = encoding; }
/** A constructor suitable for the value lists appearing in selection controls */ public static UIOutputMany make(String valuebinding, String resolver) { UIOutputMany togo = new UIOutputMany(); togo.valuebinding = new ELReference(valuebinding); togo.resolver = new ELReference(resolver); return togo; }
/** * A "bare" constructor suitable for the selection member of a multiple * selection control (UIInput); */ public static UIInputMany make(String valuebinding) { UIInputMany togo = new UIInputMany(); togo.valuebinding = new ELReference(valuebinding); return togo; }
public Object parse(String toparse) { ELReference togo = new ELReference(); togo.value = BeanUtil.stripELNoisy(toparse); return togo; }
/** * Adds a binding to the supplied parameter list that will assign the EL * expression <code>source</code> to <code>transit</code> and then * <code>transit</code> to <code>dest</code>, a classic usage of * "whole-object validation through transit". */ public static void addTransitBinding(ParameterList paramlist, String source, String transit, String dest) { paramlist.add(new UIELBinding(transit, new ELReference(source))); paramlist.add(new UIELBinding(dest, new ELReference(transit))); }
/** Sets the method binding for this UICommand to perform no action but to * return the supplied value, should the cycle complete without errors. * This will overwrite any existing method binding for the component. * @param returnvalue The required return value from the action cycle. * @return this component. */ public UICommand setReturn(String returnvalue) { methodbinding = new ELReference(PathUtil.composePath("constantReturn", returnvalue)); return this; }
/** Adds a "deferred resulting view" EL binding to the supplied UIComponent. * This will transfer a value from an EL path in the request context to a * particular path withing the outgoing ViewParameters state for the coming * action cycle, assuming that it completes without error. * @param holder The control whose submission is to include the required binding. * @param viewParamsPath The path within the outgoing ViewParameters state for the * navigation which is to receive the deferred value. * @param requestPath The path within the "final state" of the request context at the * end of the cycle from which the deferred value is to be read. */ public static void addResultingViewBinding(UIParameterHolder holder, String viewParamsPath, String requestPath) { if (holder.parameters == null) { holder.parameters = new ParameterList(); } ELReference vpp = new ELReference(viewParamsPath); holder.parameters.add(new UIELBinding("ARIResult.resultingView."+vpp.value, new ELReference(requestPath))); }
public UIJointContainer evolveDateInput(UIInput toEvolve, Date value) { // Pull in the template UIJointContainer togo = new UIJointContainer(toEvolve.parent, toEvolve.ID, COMPONENT_ID); // Remove the existing component from the tree toEvolve.parent.remove(toEvolve); String transitBean = transitBase + "." + togo.getFullID(); // Need ISO9601 support. ISO8601FieldDateTransit transit = (ISO8601FieldDateTransit) rbg.getBean(transitBean); if (value == null) { // The UIInput we're evolving must have a OTP bean for this to work. value = (Date) rbg.getBean(toEvolve.valuebinding.value); } if (value != null) { transit.setDate(value); } String ttb = transitBean + "."; UIOutput display = UIOutput.make(togo, "display"); UIInput field = UIInput.make(togo, "iso8601", ttb + "ISO8601", transit.getISO8601()); field.mustapply = true; // Bind the value back through to the transitBase. // This generates a custom hidden HTML UIForm form = RSFUtil.findBasicForm(togo); form.parameters.add(new UIELBinding(toEvolve.valuebinding.value, new ELReference(ttb + "date"))); UIInitBlock.make(togo, "init-date", "rsfDatePicker", new Object[] { display.getFullID(), field.getFullID(), // If we just supply a boolean it is output as a string // which doesn't work. (style.equals(DATE_TIME_INPUT) || style.equals(TIME_INPUT)) ? "1" : "0" }); return togo; }
new ELReference(ttb + "date")));
new ELReference(ttb + "date")));
new ELReference(ttb + "date")));
new ELReference(ttb + "date")));