/** * @return * @see com.nexitia.emaginplatform.jfx.core.engine.components.form.row.InputComponentWrapper#currentInternalValueProperty() */ public final SimpleStringProperty currentInternalValueProperty() { return owner.currentInternalValueProperty(); }
/** * * @see com.nexitia.emaginplatform.jfx.core.engine.components.form.row.InputComponentWrapper#cancelModification() */ public void cancelModification() { owner.cancelModification(); }
/** * validate entries * * @return */ @Override public void validate() { // commit the form before validating for(IInputComponentWrapper editInput: rows) { editInput.commitModification(); } //logR.debug("End Commit values from form to backing bean"); //logR.debug("Backing bean to string : "); if (controller.getModel() != null) { //logR.debug(controller.getModel().toString()); } // validate each row for(IInputComponentWrapper row: rows) { row.validate(); } isValid = true; for (IInputComponentWrapper row : rows) { if (row.isNotValid()) { isValid = false; break; } } //logR.debug("Form is valid : " + isValid); }
public default Map<String, Object> extracValue(List<IInputComponentWrapper> rows) { Map<String, Object> result = new HashMap<>(); for(IInputComponentWrapper row: rows) { IEditInputComponent edit = row.getEditInputComponent(); String value = edit.getInputComponentWrapper().getCurrentInternalValue(); String name = row.getAttributeName(); result.put(name, value); } return result; }
/** * {@inheritDoc} */ @Override public void destroy() { owner.currentInternalValueProperty().unbind(); owner.initialInternalValueProperty().unbind(); }
/** * @{inheritedDoc} */ @Override public void build(IInputComponentWrapper inputComponentWrapper) { super.build(inputComponentWrapper); NodeHelper.styleClassAddAll(label, getConfiguration(), "viewStyleClass", "form-info-value"); String curVal = inputComponentWrapper.getCurrentInternalValue(); label.setText(curVal); Bindings.bindBidirectional(label.textProperty(), inputComponentWrapper.currentInternalValueProperty(), inputComponentWrapper.getConverter()); }
/** * @{inheritedDoc} */ @Override public void build(IInputComponentWrapper inputComponentWrapper) { super.build(inputComponentWrapper); // the type of value to display treatFlow(inputComponentWrapper.getCurrentInternalValue()); inputComponentWrapper.currentInternalValueProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { treatFlow(newValue); }); }
owner.commitModification(); if (!owner.getEnumeratedValueModels().isEmpty()) { owner.currentInternalValueProperty().set(((EnumeratedValueModel) newValue.getUserData()).getSavedValue()); }); final IEnumeratedValuesLoader evl = owner.getEnumeratedValuesLoader(); if (evl instanceof IMultipleEnumeratedValuesLoader) { final Map<String, List<IEnumeratedValueModel>> vals = ((IMultipleEnumeratedValuesLoader) evl).getValues(); if (!owner.getEnumeratedValueModels().isEmpty()) { Node content = buildRadioButtons(owner.getEnumeratedValueModels()); radioLayout.getChildren().add(content);
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); final String desc = configuration.getPropertyValue("description"); if (StringUtils.isNotBlank(desc)) { checkBox.setText(controller.getLocalised(desc)); } checkBox.selectedProperty().addListener((ChangeListener<Boolean>) (observable, oldValue, newValue) -> { owner.setCurrentValue(newValue); owner.commitModification(); }); layout.getChildren().addAll(NodeHelper.horizontalSpacer(), checkBox); checkBox.selectedProperty().set(Boolean.valueOf(owner.getCurrentInternalValue())); }
Bindings.bindBidirectional(choosenFullPath.textProperty(), owner.currentInternalValueProperty(), owner.getConverter());
combobox.setId(id); if (owner.getEnumeratedValueModels() != null && !owner.getEnumeratedValueModels().isEmpty()) { items.setAll(owner.getEnumeratedValueModels()); owner.currentInternalValueProperty().set(newValKey); commitModification(); owner.currentInternalValueProperty().set(newValKey); owner.currentInternalValueProperty().set(null);
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { final String ispasswordField = configuration.getPropertyValue("passwordField"); newInstance(StringUtils.isNotBlank(ispasswordField) && Boolean.valueOf(ispasswordField)); super.buildFrom(controller, configuration); textField.setId(id); configure(); textField.setText(owner.getInitialInternalValue()); Bindings.bindBidirectional(owner.currentInternalValueProperty(), textField.textProperty(), owner.getConverter()); }
String[] audiencesT = audiences.split(","); for (String aud : audiencesT) { IEnumeratedValueModel model = owner.getEnumeratedValue(aud); if (model != null) { comboBox.getItems().add(model); String internalVal = (String) owner.getInitialInternalValue(); IEnumeratedValueModel val = owner.getEnumeratedValue(internalVal); comboBox.getSelectionModel().select(val); owner.currentInternalValueProperty().set(selected.savedValueProperty().get()); }; comboBox.valueProperty().addListener(valueChangeListener);
private void updateMultiValuedCheckBox() { String vals = ""; for (final List<CheckBox> checkboxs : checkBoxes.values()) { for (final CheckBox checkbox : checkboxs) { if (checkbox.isSelected()) { final String val = ((EnumeratedValueModel) checkbox.getUserData()).getSavedValue(); if (vals != "") { vals = vals + owner.getMultivaluedSeparator(); } vals = vals + val; } } } owner.currentInternalValueProperty().set(vals); }
public boolean onDone(IFormRowEditor editor) { for(IInputComponentWrapper r: row.getEntries()) { r.validate(); boolean foundAtLeastOne = row.getEntries().stream().filter(r -> r.isNotValid()).findAny().isPresent(); if (Boolean.TRUE == Boolean.valueOf(foundAtLeastOne)) { for(IInputComponentWrapper r: row.getEntries()) { r.displayError(); } else { for(IInputComponentWrapper r: row.getEntries()) { r.commitModification();
/** * Synchronize between the current value to model */ @Override public void commitModification() { if (owner != null) { owner.commitModification(); } }
public void postProcess() { for (final IFieldset fieldset : fieldsets) { FormFieldset formFieldset = (FormFieldset) fieldset; for (final IInputComponentWrapper row : formFieldset.getRows()) { final String visibleIf = row.getConfiguration().getVisibleIf(); if (StringUtils.isNotEmpty(visibleIf)) { // means that visibility of this component depends on the // value of a component // VisibleIF format: componentId,value1,value2 ... valuen // VisibleIF format: componentId,value1 if (visibleIf.contains(",")) { final String attrId = visibleIf.split(",")[0]; final List<String> attrValue = Arrays.asList(visibleIf.split(",")); final AbstractInputComponent comp = (AbstractInputComponent) controller.getComponent(attrId); if (comp != null) { comp.addValueChangeListner((arg0, arg1, arg2) -> { String newValKey = (String) comp.getValueToValidate(); if (attrValue.contains(newValKey)) { row.getDisplay().setVisible(true); } else { row.getDisplay().setVisible(false); } }); } } } } } }
/** * @{inheritedDoc} */ @Override public void build(IInputComponentWrapper inputComponentWrapper) { super.build(inputComponentWrapper); label.textProperty().unbind(); label.setWrapText(true); NodeHelper.styleClassAddAll(label, getConfiguration(), "viewStyleClass", "form-info-value"); // convert saved date to displayed date String currval = (String) inputComponentWrapper.getConverter().fromString(inputComponentWrapper.getCurrentInternalValue()); label.setText(currval); }
protected void displayValidationErrorMessage() { for(IInputComponentWrapper e: row.getEntries()) { if (e.getEditInputComponent().getFirstErrorMessage() != null) { Label label = new Label(e.getEditInputComponent().getFirstErrorMessage()); label.getStyleClass().add("form-inline-error-message"); errorMessagesContainer.getChildren().add(label); } } }
/** * @return * @see com.nexitia.emaginplatform.jfx.core.engine.components.form.row.InputComponentWrapper#getAttributePath() */ public final String getAttributePath() { return owner.getAttributePath(); }