/** Adds a "literal" resulting view binding to the supplied control. Rather than reading * a path in the final request context as in {@link #addResultingViewBinding(UIParameterHolder, String, String)}, * this supplies a constant, literal value into the outgoing state. * @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 value The value to be applied to the outgoing ViewParameters path. */ public static void addResultingViewBinding(UIParameterHolder holder, String viewParamsPath, Object value) { if (holder.parameters == null) { holder.parameters = new ParameterList(); } holder.parameters.add(new UIELBinding("ARIResult.resultingView."+viewParamsPath, value)); } /**
/** * 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))); }
/** 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))); }
UIOutput.make(togo, "date-annotation", null, ttb + "shortFormat"); if (invalidDateKey != null) { form.parameters.add(new UIELBinding(ttb + "invalidDateKey", invalidDateKey)); UIOutput.make(togo, "time-annotation", null, ttb + "timeFormat"); if (invalidTimeKey != null) { form.parameters.add(new UIELBinding(ttb + "invalidTimeKey", invalidTimeKey)); form.parameters.add(new UIELBinding(toevolve.valuebinding.value, new ELReference(ttb + "date")));
UIOutput.make(togo, "date-annotation", null, ttb + "shortFormat"); if (invalidDateKey != null) { form.parameters.add(new UIELBinding(ttb + "invalidDateKey", invalidDateKey)); UIOutput.make(togo, "time-annotation", null, ttb + "timeFormat"); if (invalidTimeKey != null) { form.parameters.add(new UIELBinding(ttb + "invalidTimeKey", invalidTimeKey)); form.parameters.add(new UIELBinding(toevolve.valuebinding.value, new ELReference(ttb + "date")));
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; }
form.parameters.add(new UIELBinding(toevolve.valuebinding.value, new ELReference(ttb + "date")));
form.parameters.add(new UIELBinding(toevolve.valuebinding.value, new ELReference(ttb + "date")));