Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b:dateTimePicker with ajax="true" refreshes the whole form on click #678

Closed
ggam opened this issue Apr 5, 2017 · 5 comments
Closed

b:dateTimePicker with ajax="true" refreshes the whole form on click #678

ggam opened this issue Apr 5, 2017 · 5 comments
Assignees
Milestone

Comments

@ggam
Copy link
Collaborator

ggam commented Apr 5, 2017

Example snippet:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:b="http://bootsfaces.net/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <b:container>
            <b:form>
                <b:dateTimePicker value="#{index.fecha}" ajax="true" />
            </b:form>
        </b:container>
    </h:body>
</html>

The ajax="true" attaches an onclick handler to the date picker action, that issues an AJAX request, rerendering the whole form. The problem is that (apart from unneeded requests), when you click on the picker to select a date, it gets automatically closed making it impossible to use.

The workaround is to set the update attribute to none (update="").

Anyway, as a user, when I set ajax="true", what I expect is not that every event will result in an AJAX request, but that the value will be updated through an AJAX request. So I propose to change the ajax="true" behaviour to add a listener for the dtchange event instead of onclick. The same would be probably applicable to other components.

@stephanrauh
Copy link
Collaborator

This is what the default values should be:

image

@stephanrauh
Copy link
Collaborator

The problem seems to be AjaxRenderer line 565, which translates an empty update attribute value to @form no matter which component.

If we fix that, does that

  • break compatibility with the previous version of Bootsfaces?
  • break the default attribute of b:commandButton?

stephanrauh added a commit that referenced this issue Apr 30, 2017
@stephanrauh
Copy link
Collaborator

@ggam @chongma @TheCoder4eu What's your opinion? How can we document the breaking change?

@chongma
Copy link
Collaborator

chongma commented Apr 30, 2017

it definitely needs to be put back to the correct defaults. anybody upgrading to 1.1.0 should test their code before upgrade. can it just be mentioned in the release notes?

@stephanrauh
Copy link
Collaborator

Also see #371.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants