asmaoui / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

The datepicker don´t reset the date #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by camil...@gmail.com on 10 Dec 2008 at 2:37

GoogleCodeExporter commented 9 years ago
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 :)

Original comment by kelvin.l...@gmail.com on 10 Dec 2008 at 4:56

GoogleCodeExporter commented 9 years ago
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)).getSubmi
ttedValue());,
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

Original comment by camil...@gmail.com on 10 Dec 2008 at 5:14

GoogleCodeExporter commented 9 years ago
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 :)

Original comment by kelvin.l...@gmail.com on 10 Dec 2008 at 5:31

GoogleCodeExporter commented 9 years ago
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 

Original comment by camil...@gmail.com on 10 Dec 2008 at 7:06

GoogleCodeExporter commented 9 years ago
$('#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.

Original comment by kelvin.l...@gmail.com on 10 Dec 2008 at 9:49

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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.

Original comment by buf...@gmail.com on 1 Oct 2009 at 6:51

GoogleCodeExporter commented 9 years ago
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 :)

Original comment by kelvin.l...@gmail.com on 1 Oct 2009 at 7:09

GoogleCodeExporter commented 9 years ago
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.

Original comment by buf...@gmail.com on 1 Oct 2009 at 9:18

GoogleCodeExporter commented 9 years ago
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,

Original comment by delgado....@gmail.com on 10 Dec 2009 at 4:52

Attachments:

GoogleCodeExporter commented 9 years ago
This has been resolved, i will post you the file later today, it has option to 
clear!

Original comment by ilija.ja...@gmail.com on 1 Mar 2010 at 2:55

GoogleCodeExporter commented 9 years ago
where i can find the solution script of this problem?
thanks in advance

Original comment by rs.sa...@gmail.com on 29 Mar 2010 at 11:16

GoogleCodeExporter commented 9 years ago
I need a solution to clear data too.
Where I can find your solution?

Original comment by bronz...@gmail.com on 20 Apr 2010 at 8:42

GoogleCodeExporter commented 9 years ago
Hey this is the line that will help you to clear the form that worked for me
FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handle
Navigation(FacesContext.getCurrentInstance(),null,managedBeanName);

Original comment by camil...@gmail.com on 20 Apr 2010 at 8:50

GoogleCodeExporter commented 9 years ago
Hi Kelvin,
First of all thanks for the awesome datepicker plugin. I too need to code to 
reset my datepicker. Waiting eargerly for ur help. Thanks in advance!

Original comment by bennetr...@gmail.com on 29 Jan 2013 at 5:03