logo
down
shadow

Composite component with multiple input fields, validation failed in WebSphere 8.0


Composite component with multiple input fields, validation failed in WebSphere 8.0

By : Isa Said
Date : November 22 2020, 10:33 AM
wish of those help First of all, WildFly doesn't use MyFaces. It uses Mojarra.
As to your concrete problem, it turns out that in case of UIInput, MyFaces first processes the validation phase on the component's children and then finally the component itself, while Mojarra does exactly the other way round. Evidence can be found in the provided source code (click the links to see it).
code :
@Override
public Object getSubmittedValue() {
    return day.getSubmittedValue()
        + "-" + month.getSubmittedValue()
        + "-" + year.getSubmittedValue();
}
@Override
public Object getSubmittedValue() {
    return (day.isLocalValueSet() ? day.getValue() : day.getSubmittedValue())
        + "-" + (month.isLocalValueSet() ? month.getValue() : month.getSubmittedValue())
        + "-" + (year.isLocalValueSet() ? year.getValue() : year.getSubmittedValue());
}


Share : facebook icon twitter icon
ajax validation with multiple input fields

ajax validation with multiple input fields


By : Aung Myat
Date : March 29 2020, 07:55 AM
should help you out There are many jQuery plugins for this problem.
http://jquery.bassistance.de/validate/demo/ Is this what you need?
Styling input component after validation failed

Styling input component after validation failed


By : Kandra Miskenack
Date : March 29 2020, 07:55 AM
it helps some times Your concrete problem is caused because you didn't update the input component on complete of the ajax request. You're only updating the growl component. So the changes to the input component are never reflected into the client side.
I suggest to just update the entire form as it might contain other input components which also needs to be highlighted:
code :
<p:commandButton ... update="@form" />
JSF 2 - composite-component - Bean validation fails due to component with empty value

JSF 2 - composite-component - Bean validation fails due to component with empty value


By : mary
Date : March 29 2020, 07:55 AM
wish of those help Looks like your inputText tag is missing the value attribute. The value attribute does the binding between the input and the bean.
code :
<h:inputText value="#{yourBean.yourValue" ...
Input fields hold previous values only if validation failed

Input fields hold previous values only if validation failed


By : travytrav
Date : March 29 2020, 07:55 AM
With these it helps This problem is in JSF 2 also recognized and explained in detail in the following answer: How can I populate a text field using PrimeFaces AJAX after validation errors occur? If you were using JSF 2, you could have used OmniFaces' ResetInputAjaxActionListener or PrimeFaces' or resetValues="true" for this.
To the point, you need to clear the state of the EditableValueHolder component when it's about to be ajax-rendered, but which isn't included in the ajax-execute. To clear the state, in JSF 2 you would have used the convenience method resetValue() for this, but this isn't available in JSF 1.2 and you need to invoke the 4 individual methods setValue(null), setSubmittedValue(null), setLocalValueSet(false), setValid(true) to clear the state.
code :
UIInput nameInput = (UIInput) context.getViewRoot().findComponent("popForm:nameInput");
nameInput.setValue(null);
nameInput.setSubmittedValue(null);
nameInput.setLocalValueSet(false);
nameInput.setValid(true);
Composite component to produce output from multiple input components

Composite component to produce output from multiple input components


By : blubzel
Date : March 29 2020, 07:55 AM
wish help you to fix your issue I am creating a composite component that consists of a selectOneListbox and several selectManyCheckboxes. The user will be presented with these inputs and once they have made their selections, the values of these components will be combined to produce a formatted String output which is the "value" of this composite component. Currently I have the composite component looking something like below, how do I bind the formatted output string to the value of the composite component when the user submits the form? , Add this script to composite component:
code :
function ajaxUpdateComplete(){
    var formattedOutputElement = document.getElementById("#{cc.clientId}" + ":formattedOutput");
    var updatedValue = formattedOutputElement.innerHTML;//we are taking innerHTML because outputText renders as span and has no "value"
    var hiddenElement = document.getElementById('#{cc.clientId}' + ":hiddenValue");
    hiddenElement.value = updatedValue;
}
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org