/** * Sets the label object for the auto complete * * @param label */ public void setLabel(JQUIAutoCompleteLabel label) { this.label = label; label.addAttribute(LabelAttributes.For, getInput().getID()); }
/** * Sets the label object for the auto complete * * @param label */ public void setLabel(JQUIAutoCompleteLabel label) { this.label = label; label.addAttribute(LabelAttributes.For, getInput().getID()); }
/** * Builds the validation for the input * * @param input * The input to build a validatoin for * * @return Any prepending classes to use */ @NotNull public String buildValidationClass(@NotNull Input input, String prependClass) { String finalOutput = "{"; String formInputIdentifier = (prependClass.isEmpty() ? StaticStrings.STRING_EMPTY : StaticStrings.STRING_SPACE) + getID() + "." + input.getID() + "."; String errorOuput = prependClass + formInputIdentifier + "$invalid && " + formInputIdentifier + "$dirty && !" + formInputIdentifier + "$pristine"; errorOuput = "'" + getErrorClass() + "':" + errorOuput + ""; String successOutput = prependClass + getID() + "." + input.getID() + ".$valid && " + formInputIdentifier + "$dirty && !" + formInputIdentifier + "$pristine"; successOutput = "'" + getSuccessClass() + "':" + successOutput + ""; finalOutput += errorOuput + "," + successOutput + "}"; return finalOutput; }
/** * Sets the label object for the auto complete * * @param label */ public void setLabel(JQUIAutoCompleteLabel label) { this.label = label; label.addAttribute(LabelAttributes.For, getInput().getID()); }
/** * Builds the validation for the input * * @param input * The input to build a validatoin for * * @return Any prepending classes to use */ @NotNull public String buildValidationClass(@NotNull Input input, String prependClass) { String finalOutput = "{"; String formInputIdentifier = (prependClass.isEmpty() ? StaticStrings.STRING_EMPTY : StaticStrings.STRING_SPACE) + getID() + "." + input.getID() + "."; String errorOuput = prependClass + formInputIdentifier + "$invalid && " + formInputIdentifier + "$dirty && !" + formInputIdentifier + "$pristine"; errorOuput = "'" + getErrorClass() + "':" + errorOuput + ""; String successOutput = prependClass + getID() + "." + input.getID() + ".$valid && " + formInputIdentifier + "$dirty && !" + formInputIdentifier + "$pristine"; successOutput = "'" + getSuccessClass() + "':" + successOutput + ""; finalOutput += errorOuput + "," + successOutput + "}"; return finalOutput; }
/** * Builds the validation for the input * * @param input * The input to build a validatoin for * * @return Any prepending classes to use */ @NotNull public String buildValidationClass(@NotNull Input input, String prependClass) { String finalOutput = "{"; String formInputIdentifier = (prependClass.isEmpty() ? StaticStrings.STRING_EMPTY : StaticStrings.STRING_SPACE) + getID() + "." + input.getID() + "."; String errorOuput = prependClass + formInputIdentifier + "$invalid && " + formInputIdentifier + "$dirty && !" + formInputIdentifier + "$pristine"; errorOuput = "'" + getErrorClass() + "':" + errorOuput + ""; String successOutput = prependClass + getID() + "." + input.getID() + ".$valid && " + formInputIdentifier + "$dirty && !" + formInputIdentifier + "$pristine"; successOutput = "'" + getSuccessClass() + "':" + successOutput + ""; finalOutput += errorOuput + "," + successOutput + "}"; return finalOutput; }
/** * Builds the validation for the input * * @param input * The input to build a validatoin for * * @return Any prepending classes to use */ @NotNull public String buildValidationClass(@NotNull Input input, String prependClass) { String finalOutput = "{"; String formInputIdentifier = (prependClass.isEmpty() ? StaticStrings.STRING_EMPTY : StaticStrings.STRING_SPACE) + getID() + "." + input.getID() + "."; String errorOuput = prependClass + formInputIdentifier + "$invalid && " + formInputIdentifier + "$dirty && !" + formInputIdentifier + "$pristine"; errorOuput = "'" + getErrorClass() + "':" + errorOuput + ""; String successOutput = prependClass + getID() + "." + input.getID() + ".$valid && " + formInputIdentifier + "$dirty && !" + formInputIdentifier + "$pristine"; successOutput = "'" + getSuccessClass() + "':" + successOutput + ""; finalOutput += errorOuput + "," + successOutput + "}"; return finalOutput; }
/** * Construct a new instance of the input type field * <p> * * @param inputType */ public Input(InputTypes inputType) { super(ComponentTypes.Input); if (inputType != null) { this.inputType = inputType; addAttribute(GlobalAttributes.Type, getInputType().name() .toLowerCase()); addAttribute(GlobalAttributes.Name, getID()); } if (!getInlineClosingTag() && getPage().getHtmlVersion() .name() .startsWith("X") || !"select".equals(getTag())) { setInlineClosingTag(true); } setClosingTag(false); }
/** * Construct a new instance of the input type field * <p> * * @param inputType */ public Input(InputTypes inputType) { super(ComponentTypes.Input); if (inputType != null) { this.inputType = inputType; addAttribute(GlobalAttributes.Type, getInputType().name() .toLowerCase()); addAttribute(GlobalAttributes.Name, getID()); } if (!getInlineClosingTag() && getPage().getHtmlVersion() .name() .startsWith("X") || !"select".equals(getTag())) { setInlineClosingTag(true); } setClosingTag(false); }
/** * Construct a new instance of the input type field * <p> * * @param inputType */ public Input(InputTypes inputType) { super(ComponentTypes.Input); if (inputType != null) { this.inputType = inputType; addAttribute(GlobalAttributes.Type, getInputType().name() .toLowerCase()); addAttribute(GlobalAttributes.Name, getID()); } if (!getInlineClosingTag() && getPage().getHtmlVersion() .name() .startsWith("X") || !"select".equals(getTag())) { setInlineClosingTag(true); } setClosingTag(false); }
/** * Adds a success feedback configured with styled if it is set before it * <p> * make sure to style before this method * * @param feedback * @param inline * * @return */ @Override @NotNull @SuppressWarnings("unchecked") public J addSuccessFeedback(String feedback, boolean inline) { ComponentHierarchyBase component; if (inline) { component = new Span(); } else { component = new Div(); } component.add(new Paragraph<>(feedback).setTextOnly(true)); component.addClass("valid-feedback"); component.addAttribute(AngularAttributes.ngShow, getForm().getID() + "." + getInput().getID() + ".$valid"); add(component); return (J) this; }
/** * Adds a success feedback configured with styled if it is set before it * <p> * make sure to style before this method * * @param feedback * @param inline * * @return */ @Override @NotNull @SuppressWarnings("unchecked") public J addSuccessFeedback(String feedback, boolean inline) { ComponentHierarchyBase component; if (inline) { component = new Span(); } else { component = new Div(); } component.add(new Paragraph<>(feedback).setTextOnly(true)); component.addClass("valid-feedback"); component.addAttribute(AngularAttributes.ngShow, getForm().getID() + "." + getInput().getID() + ".$valid"); add(component); return (J) this; }
/** * Adds a success feedback configured with styled if it is set before it * <p> * make sure to style before this method * * @param feedback * @param inline * * @return */ @Override @NotNull @SuppressWarnings("unchecked") public J addSuccessFeedback(String feedback, boolean inline) { ComponentHierarchyBase component; if (inline) { component = new Span(); } else { component = new Div(); } component.add(new Paragraph<>(feedback).setTextOnly(true)); component.addClass("valid-feedback"); component.addAttribute(AngularAttributes.ngShow, getForm().getID() + "." + getInput().getID() + ".$valid"); add(component); return (J) this; }