/** {@see UIInternalLink#make(UIContainer, String, UIBoundString, ViewParameters) */ public static UIInternalLink make(UIContainer parent, String ID, String text, ViewParameters viewparams) { UIBoundString linktext = null; if (text != null) { linktext = new UIOutput(); linktext.setValue(text); } return make(parent, ID, linktext, viewparams); }
/** * Construct a navigation link. * * @param parent Container to which the link is to be added. * @param ID RSF ID of this link. * @param text Text to be rendered for this link. * @param target See {@link #target} */ public static UILink make(UIContainer parent, String ID, String linktext, String target) { UIBoundString linktextnew = null; if (linktext != null) { linktextnew = new UIOutput(); linktextnew.setValue(linktext); } return make(parent, ID, linktextnew, target); }
/** Creates a command link which will initiate a non-idempotent request * (action cycle) to handle the command. * @param parent The parent component to which this action link will be added * as a child. * @param text The text that will be rendered to the user on this component. * @param methodbinding An RSF EL expression representing the action to be * triggered when the user activates this link. */ public static UICommand make(UIContainer parent, String ID, String text, String methodbinding) { UIBoundString commandtext = null; if (text != null) { commandtext = new UIOutput(); commandtext.setValue(text); } return make(parent, ID, commandtext, methodbinding); }
public static UIComponent resolveListMember(View view, UIBasicListMember torendero) { UIComponent parent = view.getComponent(torendero.parentFullID); UIBoundList boundlist = parent instanceof UISelect? ((UISelect) parent).optionnames : (UIBoundList)parent; String[] valuelist = boundlist.getValue(); // Reference off the end of an array is not an error - it may be being dynamically expanded String value = torendero.choiceindex < valuelist.length ? valuelist[torendero.choiceindex] : ""; String submittingname = boundlist.submittingname; UIBoundString togo = new UIBoundString(); togo.setValue(value); if (torendero.willinput) { togo.submittingname = submittingname; togo.willinput = true; } return togo; }
/** * Construct a navigation link with a bound control (e.g. UIMessage) forming * the link text. */ public static UILink make(UIContainer parent, String ID, UIBoundString linktext, String target) { UILink togo = new UILink(); togo.ID = ID; togo.target = new UIOutput(); if (target != null) { togo.target.setValue(target); } togo.linktext = linktext; parent.addComponent(togo); return togo; }
/** Create a link which, while internal, does not participate in the * ViewParameters system. This is largely useful for unmanaged environments * such as SpringMVC/Cocoon. Cannot be named "make" to avoid clashing with * UILink through ridiculous Java semantics on static methods. */ public static UIInternalLink makeURL(UIContainer parent, String ID, String target) { UIInternalLink togo = new UIInternalLink(); togo.ID = ID; togo.target = new UIOutput(); if (target != null) { togo.target.setValue(target); } parent.addComponent(togo); return togo; } /** ViewParameters representing the navigation target of this link control */
/** Creates a selection control without a value binding, either * non-submitting, or suitable for use in a GET form */ public static UISelect make(UIContainer tofill, String ID, String[] values, String[] labels, String value, boolean willinput) { UISelect togo = new UISelect(); togo.optionlist = new UIOutputMany(); togo.ID = ID; togo.optionlist.setValue(values); togo.optionnames = new UIBoundList(); togo.optionnames.setValue(labels); togo.selection = new UIBoundString(); if (value != null) { ((UIBoundString) togo.selection).setValue(value); } togo.selection.willinput = willinput; tofill.addComponent(togo); RSFUtil.updateChildIDs(togo); return togo; }