/** Construct a client-side initialisation block accepting a single argument. * @see #make(UIContainer, String, String, Object[]) */ public static UIInitBlock make(UIContainer parent, String ID, String functionname, Object argument) { if (argument == null || functionname == null) { throw new NullPointerException("Cannot supply null argument or function name to UIInitBlock"); } return make(parent, ID, functionname, new Object[] { argument }); }
/** Construct a client-side initialisation block. * @param parent The parent container in which this init block is to be placed. * @param ID The ID to be given to this block. * @param functionname The client-side name of the function to be invoked when this block is encountered. * @param arguments An array of arguments to be passed to the client-side function. * Arguments may be of the types: * <ul> * <li> Leaf types - these will be converted to String values by the standard conversion * <li> UIComponents - these will be rendered as their own fullIDs. * <li> ViewParameters - these will be converted to "fragment URLs", suitable for * rendering direct (unportalised) versions of the views they address. * </ul> */ public static UIInitBlock make(UIContainer parent, String ID, String functionname, Object[] arguments) { if (arguments == null || functionname == null) { throw new NullPointerException("Cannot supply null arguments or function name to UIInitBlock"); } UIInitBlock togo = new UIInitBlock(); togo.ID = ID; togo.functionname = functionname; togo.arguments = arguments; parent.addComponent(togo); return togo; }
addlabel.valuebinding == null ? null : addlabel.valuebinding.value); UIInitBlock.make(togo, "init-script", "DynamicListInput.init_DynamicListInput", new Object[] {core, new Integer(limit), new Integer(minlength), new Integer(maxlength)});
addlabel.valuebinding == null ? null : addlabel.valuebinding.value); UIInitBlock.make(togo, "init-script", "DynamicListInput.init_DynamicListInput", new Object[] {core, new Integer(limit), new Integer(minlength), new Integer(maxlength)});
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; }
UIOutput.make(togo, "date-link"); UIInitBlock.make(togo, "init-date", JSInitName, new Object[] { togo, title.get(), ttb, UVBProducer.PARAMS });
UIOutput.make(togo, "date-link"); UIInitBlock.make(togo, "init-date", JSInitName, new Object[] { togo, title.get(), ttb, UVBProducer.PARAMS });
rightselect.selection.fossilize = false; UIInitBlock.make(togo, "init-select", JSInitName, togo);
rightselect.selection.fossilize = false; UIInitBlock.make(togo, "init-select", JSInitName, togo);