public static UIInput make(UIContainer parent, String ID, String binding) { return make(parent, ID, binding, null); }
/** * @see #make(String) * @param valuebinding An EL reference to which the bound value is to be associated * @param initvalue An initial value for the control, to take priority over any bound * value during the render cycle. * @return The constructed UIInput control. */ public static UIInput make(String valuebinding, String initvalue) { UIInput togo = new UIInput(); togo.valuebinding = ELReference.make(valuebinding); if (initvalue != null) { togo.setValue(initvalue); } return togo; } }
/** * Constructs a single selection control, where the submitted values are * identical with the rendered labels */ public static UISelect make(UIContainer tofill, String ID, String[] options, String valuebinding, String initvalue) { UISelect togo = make(tofill, ID, options); UIInput selection = UIInput.make(valuebinding); if (initvalue != null) { selection.setValue(initvalue); } togo.selection = selection; return togo; }
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; }
String js = null; if ("ckeditor".equals(editor)) { js = HTMLUtil.emitJavascriptCall("sakai.editor.launch", new String[] { toevolve.getFullID() }); } else { String collectionID = context.equals("") ? "" : contentHostingService.getSiteCollection(context); if (sizeset) js = HTMLUtil.emitJavascriptCall("SakaiProject.fckeditor.initializeEditor", new String[] { toevolve.getFullID(), collectionID, height, width }); else js = HTMLUtil.emitJavascriptCall("SakaiProject.fckeditor.initializeEditor", new String[] { toevolve.getFullID(), collectionID });
/** * A "bare" constructor suitable for the selection member of a single * selection control (UIInput); * @param valuebinding An EL reference to which the bound value is to be associated * @return The constructed UIInput control. */ public static UIInput make(String valuebinding) { UIInput togo = new UIInput(); togo.valuebinding = ELReference.make(valuebinding); return togo; }
String js = null; if ("ckeditor".equals(editor)) { js = HTMLUtil.emitJavascriptCall("sakai.editor.launch", new String[] { toevolve.getFullID() }); } else { String collectionID = context.equals("") ? "" : contentHostingService.getSiteCollection(context); if (sizeset) js = HTMLUtil.emitJavascriptCall("SakaiProject.fckeditor.initializeEditor", new String[] { toevolve.getFullID(), collectionID, height, width }); else js = HTMLUtil.emitJavascriptCall("SakaiProject.fckeditor.initializeEditor", new String[] { toevolve.getFullID(), collectionID });
public void makeSearchFilter(UIContainer tofill, String divID, String startingText) { UIJointContainer joint = new UIJointContainer(tofill, divID, "search-filter:", numHeaders+""); UIInput.make(joint, "search-text-input", null, startingText); UIOutput.make(joint, "find-button"); UIOutput.make(joint, "clear-button"); appendJS(HTMLUtil.emitJavascriptCall("theform.addSearchFilter", new String[] {joint.getFullID(),startingText})); numHeaders++; }
/** * Construct a new UIInput component with the specified container as parent. * * @param parent Parent container to which the component is to be added. * @param ID (RSF) ID of this component. * @param binding An EL expression to be used as the value binding for the * contained String value. May be <code>null</code>. * @param initvalue An initial value for the bound value. May be left * <code>null</code>. If neither this field nor * <code>binding</code> is set. the value present in the template * will be used. * @return The constructed UIInput component. */ public static UIInput make(UIContainer parent, String ID, String binding, String initvalue) { UIInput togo = new UIInput(); togo.valuebinding = ELReference.make(binding); if (initvalue != null) { togo.setValue(initvalue); } togo.ID = ID; parent.addComponent(togo); return togo; }
public void makeSearchFilter(UIContainer tofill, String divID, String startingText) { UIJointContainer joint = new UIJointContainer(tofill, divID, "search-filter:", numHeaders+""); UIInput.make(joint, "search-text-input", null, startingText); UIOutput.make(joint, "find-button"); UIOutput.make(joint, "clear-button"); appendJS(HTMLUtil.emitJavascriptCall("theform.addSearchFilter", new String[] {joint.getFullID(),startingText})); numHeaders++; }
UIInput field = UIInput.make(togo, "date-field", ttb + "short", transit.getShort()); field.mustapply = true; UIOutput.make(togo, "date-annotation", null, ttb + "shortFormat"); UIInput field = UIInput.make(togo, "time-field", ttb + "time", transit.getTime()); field.mustapply = true; UIOutput.make(togo, "time-annotation", null, ttb + "timeFormat"); UIInput truedate = UIInput.make(togo, "true-date", ttb + "ISO8601TZ", truedateval); truedate.willinput = false;
UIInput field = UIInput.make(togo, "date-field", ttb + "short", transit.getShort()); field.mustapply = true; UIOutput.make(togo, "date-annotation", null, ttb + "shortFormat"); UIInput field = UIInput.make(togo, "time-field", ttb + "time", transit.getTime()); field.mustapply = true; UIOutput.make(togo, "time-annotation", null, ttb + "timeFormat"); UIInput truedate = UIInput.make(togo, "true-date", ttb + "ISO8601TZ", truedateval); truedate.willinput = false;