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

Fix Ajax call in DateTimePicker ondtchange wrapped in an Outer div #736

Closed
wants to merge 2 commits into from

Conversation

mtvweb
Copy link

@mtvweb mtvweb commented Apr 26, 2017

This fixes Ajax call inside DataTimePicker ondtchange events. Since change of commit 821dfca Ajax calls are not executed any more on server side, if DateTimePicker is wrapped in an Outer container.

Example:

<b:dateTimePicker id="dtp" value="#{ bean.dtpValue }"
			label="DTP Test with AJAX" render-label="true" span="6" show-time="false"
			format="MM.YYYY" tabindex="1" ajax="true" immediate="true" viewMode="months"
			process="@this" update="@form:otherDtp @form:data"
			ondtchange="ajax:bean.updateFilter();" />

The generated Field id is now changed from clientId + "Input" to "input" + clientId to fulfill the requirements to be detected in AjaxRenderer

jens and others added 2 commits April 26, 2017 09:38
The commented ajax call has disabled the call of ajax: in i.E. ondtchange, if the DateTimePicker is wrapped
in an Outer container.

Example:

	<b:dateTimePicker id="dtp" value="#{ bean.dtpValue }"
				label="DTP Test with AJAX" render-label="true" span="6" show-time="false"
				format="MM.YYYY" tabindex="1" ajax="true" immediate="true" viewMode="months"
				process="@this" update="@Form:otherDtp @Form:data"
				ondtchange="ajax:bean.updateFilter();" />
Replaced _Input with input_ which is already used in AjaxRenderer
@mtvweb
Copy link
Author

mtvweb commented Apr 26, 2017

Found another bug. Still not working perfect. Work in progress....

@mtvweb mtvweb closed this Apr 26, 2017
@stephanrauh
Copy link
Collaborator

I suppose you're up onto something. With all these divs Bootstrap wraps around input fields, it's easy to use the wrong id, thus breaking our AJAX engine.

@mtvweb
Copy link
Author

mtvweb commented Apr 26, 2017

At least it is somewhere between the id used for the "Outer" div and the real id used for the component. The dp.change is bound to the outer one, but AjaxRenderer decode doesn't find the bound "Ajax:action", because it can't find the reference in "form:dtpOuter". Not sure yet, if I need to fix it in DateTimePickerRenderer decode or AjaxRenderer.

@TheCoder4eu TheCoder4eu mentioned this pull request May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants