Open GoogleCodeExporter opened 8 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
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
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
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
$('#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
[deleted comment]
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
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
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
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:
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
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
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
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
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
Original issue reported on code.google.com by
camil...@gmail.com
on 10 Dec 2008 at 2:37