| Issue 1: | The datepicker don´t reset the date |
1 of 59
Next ›
|
| 3 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
1. I´m usign this to call the date picker from the jpsx
<ice:inputText id="inpTextBusqContraFechaGgrabacion" styleClass="date-pick
dp-applied inputFormulario"
converter="SqlTimestampConverter"
value="#{backJspMntoContratos.fechaGrabacion}"/>
2. The i have a button that use this to clear the form ir order to clear
the user search
((UIInput)children.get(i)).setSubmittedValue(null);
((UIInput)children.get(i)).setValue(null);
3. When i try to choose a new date from the calendar the control does not
allow me to pick a new date, i mean, the input text next to the calendar
icon does no get any value.
What is the expected output?
The new date that i select
What do you see instead?
An empty field
What version of the product are you using? On what operating system?
I´m using windows XP and this * $Id: jquery.datePicker.js 3739 2007-10-25
13:55:30Z kelvin.luck $
Please provide any additional information below.
Thanks in advance, i hope you can provide me any clue to solve this problem.
|
|
,
Dec 10, 2008
Hi,
Can you please provide a test URL displaying the problem?
I'm not familiar with jpsx (or is that jspx?) but I notice a couple of things in the
code above...
* You should not be adding the class dp-applied yourself. The datepicker does this
automatically when it's initialised.
* Why are you using a serverside function to clear the input? You could do this
clientside using jQuery like so:
$('#inpTextBusqContraFechaGgrabacion').val('');
Cheers,
Kelvin :)
Status: Accepted
Owner: kelvin.luck |
|
,
Dec 10, 2008
Hi kelvin thx for your replay but since is a form there are also more fields that i
need to clean that is why i use the server to clean the values, i don´t have the
server on internet in order to you can see the problem but i can describe you better
my issue:
i have this field in the form usgin the picker
<ice:inputText id="fecha" styleClass="date-pick dp-applied inputFormulario"
converter="SqlTimestampConverter" size="12"
value="#{backXXXX.fecha}"/>
The in the same form i have the clean button that is called like this
<ice:commandButton value ="Clean" immediate="true"
accesskey="l"
id="BtCleanr"
styleClass="boton"
action="#{backXXX.CleanForm}
In the CleanForm i have
((UIInput)children.get(i)).setSubmittedValue(null);
((UIInput)children.get(i)).setValue(null);
So i set all the values in null, my problem is when i go back to the page to select a
new date the inputText is empty but if i try to choose other date from tha calendar
nothing happends, no date is passed to the input text field, i did some testing and i
found that if i do this
((UIInput)children.get(i)).setSubmittedValue(((UIInput)children.get(i)).getSubmittedValue());,
i mean i do not assign a null value i just put the same date that the user selected,
tha calendar allow me to change to a different date, but is a try to put another date
instead the null, i mean not the same that the user selected the calendar does not
work.... any ideas???
Thanks in advanced
|
|
,
Dec 10, 2008
Hi, Without a URL to view it is very hard for me to guess what is going on. What does the generated HTML look like after you have cleaned the form? Could you not just add an INPUT TYPE="RESET" to your form to reset it? Like I said before, you should get rid of the "dp-applied" in your code - this is added automatically by javascript. You could also try setting the fields to '' (and empty string) rather than null. I can't make any more suggestions without seeing the page with the problem... Cheers, Kelvin :) |
|
,
Dec 10, 2008
Sorry for bothering you :(, i already tried to set the value to ''and it did't work
,i'm new in the Jquery but i want to ask you if i use your suggestion
$('#inpTextBusqContraFechaGgrabacion').val('');
how do i include this call in this block of code that has action of the clean button,
i mean this part of my code
<ice:commandButton value ="Clean" immediate="true"
accesskey="l"
id="BtCleanr"
styleClass="boton"
action="#{backXXX.CleanForm}
Again thankyou so much for your answers
|
|
,
Dec 10, 2008
$('#inpTextBusqContraFechaGgrabacion').val('');
is client side javascript code. So you need to run it in the context of the generated
webpage, not in the serverside language you are programming in.
For example, if you put the following somewhere in your generated html page it would
make that button clear the field:
<script type="text/javascript">
$(function() {
$('#BtCleanr').bind(
'click',
function()
{
$('#inpTextBusqContraFechaGgrabacion').val('');
}
);
});
</script>
Also make sure you have removed the "dp-applied" from the styleclass like I suggested
earlier.
|
|
,
Oct 01, 2009
No URL to provide for this as it's not publicly accessible. However, it's simple to recreate. Make two fields. Add datePicker to them. Create a 'cancel' button that when clicked sets the date input fields to blank. When you choose to enter a date again, the previously selected days are still selected. This especially wreaks havoc when the two date pickers are tied together so that selecting a date in one blocks out dates in the other. |
|
,
Oct 01, 2009
Are you using the latest date picker code from svn or my website? There were some bugs related to this which have been fixed already... Please provide the svn revision number of the code you are using. Thanks, Kelvin :) |
|
,
Oct 01, 2009
I was using the version from Dec 17, 2008. I went to the site and updated to the latest, but I still had the issue. The primary reason I went with datePicker as opposed to jQuery UI was the start and end date restriction dynamically updating. At this point, that can be considered an unnecessary benefit, so I just went with jQuery UI. Thanks for your quick response. |
|
,
Dec 10, 2009
Please take a look at the attached files and let me know if there is a solution for this. What we would like to get on my end is a clean input text and a unselected date in the datepicker. Cheers, |
|
|
|