Alexandre Alves
Alexandre Alves

Reputation: 421

primefaces blockui does not hide

I have a dialog that is shown for user input. This dialog has some validations and when the validation fails the blockui goes away.

This works well on my laptop with everything on it. But when I deploy the war file onto the remote server and test it my blockui does not "unblock" after validation error. I get my growl message stating which field is wrong and the growl goes away but the blockui keeps blocking my dialog. Not allowing the user to correct the input.

                <p:commandButton id="bttAddUser" value="Submit" update=":contentView:lstUsers :growl"  oncomplete="handleSubmitRequest(xhr, status, args, 'newUserDialog','newUserForm');" actionListener="#{userController.create}">
                    <p:blockUI id="addBlockUI" trigger="bttAddUser" block="newUserGrid"></p:blockUI>
                </p:commandButton>

Both systems, my laptop and remote server have glassfish 3.1.2.2. I was trying to figure out if there is a way of doing this and force the unblock of the ui.

Any ideas?

EDIT:

So it seems that is not a network problem but something else: I'm actually getting an error:

SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data

My dialog:

    <h:form id="newUserForm">
        <p:panelGrid id="newUserGrid" columns="2">
            <h:outputText value="Email : " ></h:outputText>
            <p:inputText value="#{userController.newUser.email}" required="true" requiredMessage="Please the email of the user" validatorMessage="Email is invalid" >
                <f:validateRegex pattern="[\w\.-]*[a-zA-Z0-9_]@[\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]" />
            </p:inputText>

            <h:outputText value="Name : " ></h:outputText>
            <p:inputText value="#{userController.newUser.name}" required="true" requiredMessage="Please the name of the user" ></p:inputText>

            <h:outputText value="Role"></h:outputText>
            <p:selectOneMenu id="newUserRole" required="true" value="#{userController.newUser.roleid}" requiredMessage="A role must be chosen">
                <f:selectItems value="#{userController.listRoles}" var="_role" itemValue="#{_role}" itemLabel="#{_role.roleid}"></f:selectItems>
                <f:converter converterId="misc.util.RoleConverter"></f:converter>
            </p:selectOneMenu>
            <h:outputText value="TimeZone"></h:outputText>
            <p:selectOneMenu id="newUserTz" required="true" value="#{userController.newUser.tzone}" requiredMessage="TimeZone must be specified">
                <f:selectItems value="#{userController.listTimeZone}" var="_tz" itemValue="#{_tz}" itemLabel="#{_tz}">  </f:selectItems>
            </p:selectOneMenu>

            <h:outputText value="Password"></h:outputText>
            <p:password value="#{userController.newUser.password}" required="true"  requiredMessage="Define a password"></p:password>
            <f:facet name="footer">
                <p:commandButton id="bttAddUser" value="Submit" update=":contentView:lstUsers :growl"  oncomplete="handleSubmitRequest(xhr, status, args, 'newUserDialog','newUserForm');" actionListener="#{userController.create}">
                </p:commandButton>
                <p:commandButton type="reset" value="Reset"></p:commandButton>
            </f:facet>
            <p:blockUI id="addBlockUI" trigger="bttAddUser" block="newUserGrid" widgetVar="blockUI"></p:blockUI>
        </p:panelGrid>
    </h:form>

I get the error on Solaris but not in Windows. Both have glassfish 3.1.2.2 build 5.

Upvotes: 3

Views: 1763

Answers (1)

Alexandre Alves
Alexandre Alves

Reputation: 421

Finally fixed this.

I had two primefaces jars in my WebApp:

One in domain/lib and the other one under WEB-INF/lib.

It seems that when using some functions of primefaces, it would return more than it should.

Post in Primefaces Forums

Upvotes: 1

Related Questions