• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Abandoning AjaxDatePicker for JQuery?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Abandoning AjaxDatePicker for JQuery?


  • Subject: Re: Abandoning AjaxDatePicker for JQuery?
  • From: Calven Eggert <email@hidden>
  • Date: Fri, 19 May 2017 08:47:19 -0400

I did as you suggested (remove js) and that works, however, putting back the jQuery still doesn’t.  The setter for that field doesn’t get called from some reason.


On May 18, 2017, at 11:20 AM, Klaus Berkling <email@hidden> wrote:


If the  field content isn't saved I'd go back to basics, removing any _javascript_ events and manipulation from the HTML, and fix that first. Manually enter a date that you server side date formatter understands. After all, the date picker is just client side fanciness. 

The validateDate function is _javascript_ I use but didn't add to the email. You can just remove that line in the bindings. I should too since the date picker shouldn't require validation. 

Sent from my phone. 

On May 18, 2017, at 06:36, Calven Eggert <email@hidden> wrote:

Klaus,

Thanks for your code.  The calendar works great however, I can’t get the new value of the date saved.  I’m guessing it has to do with the validateDate() function (Which I currently don’t use). For the variable value of my WOTextField I use the following:

value = patientActivityFieldValueAsDate

And in my java:

public NSTimestamp patientActivityFieldValueAsDate() {
return (NSTimestamp) currentField.valueForKey("fieldDateValue");
}
public void setPatientActivityFieldValueAsDate(NSTimestamp newValue) {
currentField.takeValueForKey(newValue, "fieldDateValue");
}

The setter is not being called after the update to the field.  What needs to be changed in order for this to get called? Can this get called from the validateDate js function?

Calven


On May 17, 2017, at 6:41 AM, Calven Eggert <email@hidden> wrote:

It looks like I’m going to abandon the AjaxDatePicker because I can’t get it to work with the date format my users want for this calendar.

Anyone have experience using WO with JQuery?  Any hints on how to get that setup would be appreciated.



I’m walking out the door but:

In the WOD:

StartDate : WOTextField {
value = event.startDate;
formatter = localDateFormatter;
placeholder = "mm/dd/yyyy";
class = "eventdatepicker";
_onblur_ = "validateDate(this);";
_onchange_ = "$('#Update').click();";
otherTagString = "readonly='true'";
}


And in a js file:


$(document).ready(function() {
console.log("Document ready.")

$(".eventdatepicker").datepicker({
dateFormat: "mm/dd/yy",
changeMonth: true,
changeYear: true,
yearRange: '-0y:+5y',
defaultDate: '0'
});

});

Hope this helps.




Klaus Berkling
www.berkling.us <http://berkling.us/> | Photography <https://kib.smugmug.com/>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Abandoning AjaxDatePicker for JQuery? (From: Calven Eggert <email@hidden>)
 >Re: Abandoning AjaxDatePicker for JQuery? (From: Klaus Berkling <email@hidden>)

  • Prev by Date: Looking for a 64 bit WOAdaptor for Apache 2.4
  • Next by Date: Re: Esoteric issue with automatic property validation and validationFailedWithException()
  • Previous by thread: Re: Abandoning AjaxDatePicker for JQuery?
  • Next by thread: Esoteric issue with automatic property validation and validationFailedWithException()
  • Index(es):
    • Date
    • Thread