Esoteric issue with automatic property validation and validationFailedWithException()

2017-05-19 Thread Paul Hoadley
Hello,

Let’s say I have a Page component. On this page is a subcomponent, MyText, that 
looks like this in Page’s template:



And then MyText itself is just this:



Item.content is a String, and allowsNull is N in the model. So, obviously, it’s 
a candidate for automatic EOF property validation on form submission. When I 
leave the textarea blank and submit, validationFailedWithException() is called 
on the page—great.

But that’s not quite what MyText looks like—say I need to do other things with 
the bound string. So it actually looks like this:



and has a couple of accessor methods instead:

public String value() {
return stringValueForBinding("value");
}

public void setValue(String value) {
setValueForBinding(value, "value");
}

Now, when I submit a blank textarea, validationFailedWithException() is _not_ 
called on the page. What’s going on here? What have I stomped on? How do I 
trigger automatic property validation with a component like this?


-- 
Paul Hoadley
http://logicsquad.net/
https://www.linkedin.com/company/logic-squad/



 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Looking for a 64 bit WOAdaptor for Apache 2.4

2017-05-19 Thread Soles, James T
I've read a number of comments on the list about WOAdaptor for Apache 2.4 and 
saw some with a link to a binary but that link is no longer valid.  Does anyone 
have a 64 bit WOAdaptor for Apache 2.4 that I can get?

Thanks,

Terry Soles
214-273-3916

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Abandoning AjaxDatePicker for JQuery?

2017-05-19 Thread Calven Eggert
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  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  > 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 >> > 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/";
>>  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  > > | Photography > >

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Esoteric issue with automatic property validation and validationFailedWithException()

2017-05-19 Thread Chuck Hill
Looking at the code, it looks like it should work.  
WOKeyValueAssociation.setValue() does the validation and calls that method.  Is 
it calling it on a different component than in the first example?

Chuck

From: Webobjects-dev 
 on behalf of Paul 
Hoadley 
Date: Friday, May 19, 2017 at 3:52 AM
To: WebObjects-Dev 
Subject: Esoteric issue with automatic property validation and 
validationFailedWithException()

Hello,

Let’s say I have a Page component. On this page is a subcomponent, MyText, that 
looks like this in Page’s template:



And then MyText itself is just this:



Item.content is a String, and allowsNull is N in the model. So, obviously, it’s 
a candidate for automatic EOF property validation on form submission. When I 
leave the textarea blank and submit, validationFailedWithException() is called 
on the page—great.

But that’s not quite what MyText looks like—say I need to do other things with 
the bound string. So it actually looks like this:



and has a couple of accessor methods instead:

public String value() {
return stringValueForBinding("value");
}

public void setValue(String value) {
setValueForBinding(value, "value");
}

Now, when I submit a blank textarea, validationFailedWithException() is _not_ 
called on the page. What’s going on here? What have I stomped on? How do I 
trigger automatic property validation with a component like this?


--
Paul Hoadley
http://logicsquad.net/
https://www.linkedin.com/company/logic-squad/



 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Improved exception page

2017-05-19 Thread Tim Worman
Nice! Thanks Hugi!

Tim

> On May 17, 2017, at 11:18 AM, Hugi Thordarson  wrote:
> 
> Hi all,
> a couple of months back I added a new exception page to Wonder. If you’d like 
> to try it out and are using a relatively current version of Wonder, just add…
> 
> @Override
> public WOResponse reportException( Throwable exception, WOContext context, 
> NSDictionary extraInfo ) {
>   return ERXExceptionPage.reportException( exception, context, extraInfo 
> );
> }
> 
> …to your Application class and you should get nice looking exception pages 
> like this one: https://www.dropbox.com/s/mo22t9dgkym0ceb/wo.png. It’s been my 
> default for a couple of years and I’ve found it quite beneficial since it 
> immediately highlights the code to blame during development. Suggestions for 
> improvement are very welcome.
> 
> - hugi
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/lists%40thetimmy.com
> 
> This email sent to li...@thetimmy.com

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Looking for a 64 bit WOAdaptor for Apache 2.4

2017-05-19 Thread Musall, Maik
Hi Terry,

I compiled one for Ubuntu Xenial, which has Apache 2.4. I already put it onto 
the new wocommunity.org  site, but that is not yet 
publicly available because a lot of other details on the website are not yet 
migrated. But I just copied it over to the old site. Get it here:

http://wocommunity.org/documents/tools/mod_WebObjects/Apache2.4/linux/ubuntu/xenial/
 


Maik


> Am 19.05.2017 um 14:24 schrieb Soles, James T :
> 
> I’ve read a number of comments on the list about WOAdaptor for Apache 2.4 and 
> saw some with a link to a binary but that link is no longer valid.  Does 
> anyone have a 64 bit WOAdaptor for Apache 2.4 that I can get?
>  
> Thanks,
>  
> Terry Soles
> 214-273-3916
>  
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
> )
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/maik%40selbstdenker.ag 
> 
> 
> This email sent to m...@selbstdenker.ag 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Compiling ERExtensions in Sierra no worky

2017-05-19 Thread Ray Kiddy


So, I just have to say, I wanted to build wonder on my new Sierra laptop 
and of course it did not work. And then, after checking several things, 
downloading this and that, checking some other things, sacrificing a 
fatted calf and so on and so forth, thinking about making this work just 
starting to sound like Beelzebub howling in my head. Really.


I installed maven, got Hugi's settings.xml file and it just f-ing 
worked. Arg! Damn his eyes! :-)


I just thought I should admit, publicly and with appropriate humility, 
my interest in making wonder build with ant just vanished. Sorry. Life 
is just too short.


Now, figuring out the whole getting my projects to work with it, we'll 
see. But I am tired of finding myself messing with deployment scripts. 
So who knows.


-ray


On 5/12/17 3:39 AM, Hugi Thordarson wrote:
Thanks Hugi for the links! I’m definitely going to be looking into 
this soon-ish. Goodbye fluffy bunny.


The wiki is semi-useful, but some of it is stale and unhelpful. As 
far as migration of existing projects goes, follow Hugi’s recipe:


https://gist.github.com/hugith/e9a49e91fbcebe204e0feb4989f55631

but also take a look at my fork of that:

https://gist.github.com/paulhoadley/cd15b90c94eb8c640fddd9ac3fbbc6dc

They cover some slightly different areas. Hugi—we really should merge 
them.


Ah, yes. Most importantly, you mention updating the “woproject”-folder 
which I forgot to include.



I also think Hugi’s being modest—once you’ve done a few, you can 
probably migrate a project in under 20 minutes.


In fact I originally wrote “10 minutes” there, but I felt an hour 
would sound more believable :).



To "dependency management" and "third party library integration", I 
would add "simplified interaction with Jenkins” as a huge benefit. 
Throw out all those workspace setup scripts: just point Jenkins at 
your repo and you’re pretty much done. We’ve been using Maven for 
about 6 months, and haven’t looked back.


Not to mention all the other goodies you get by using maven, stuff 
like automatic test running, "mvn 
versions:display-dependency-updates”, "mvn dependency:tree” etc.



If you want to live-blog your experience here on the list, Hugi and I 
would be happy to help troubleshoot if you run into any issues


Indeed!

- hugi


  ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/ray%40ganymede.org

This email sent to r...@ganymede.org


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Esoteric issue with automatic property validation and validationFailedWithException()

2017-05-19 Thread Paul Hoadley
Hi Chuck,

On 20 May 2017, at 2:22 am, Chuck Hill  wrote:

> Looking at the code, it looks like it should work.  
> WOKeyValueAssociation.setValue() does the validation and calls that method.  
> Is it calling it on a different component than in the first example?

It’s not calling validationFailedWithException() on any of:

* MyText
* Page
* Session
* Application

Change it back to caret-notation, it gets called on Page. Bizarre.


-- 
Paul Hoadley
http://logicsquad.net/
https://www.linkedin.com/company/logic-squad/



 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Looking for a 64 bit WOAdaptor for Apache 2.4

2017-05-19 Thread Paul Hoadley
On 19 May 2017, at 9:54 pm, Soles, James T  wrote:

> I’ve read a number of comments on the list about WOAdaptor for Apache 2.4 and 
> saw some with a link to a binary but that link is no longer valid.  Does 
> anyone have a 64 bit WOAdaptor for Apache 2.4 that I can get?

Which operating system?


-- 
Paul Hoadley
http://logicsquad.net/
https://www.linkedin.com/company/logic-squad/



 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Esoteric issue with automatic property validation and validationFailedWithException()

2017-05-19 Thread Paul Hoadley
On 20 May 2017, at 9:35 am, Paul Hoadley  wrote:

> On 20 May 2017, at 2:22 am, Chuck Hill  > wrote:
> 
>> Looking at the code, it looks like it should work.  
>> WOKeyValueAssociation.setValue() does the validation and calls that method.  
>> Is it calling it on a different component than in the first example?
> 
> It’s not calling validationFailedWithException() on any of:
> 
> * MyText
> * Page
> * Session
> * Application
> 
> Change it back to caret-notation, it gets called on Page. Bizarre.

Here’s another clue. Recall that the page looks like this, in part:



What I hadn’t noticed was relevant was that Item.content (the attribute with 
allowsNull = N) is initially null—it comes to that page and is rendered with 
nothing in that textfield. So when MyText looks like this:



and I just submit the form, the value of Item.content has not changed, and so 
setValue() isn’t called. Hence WOKeyValueAssociation.setValue() isn’t called, 
and so on—there’s now no surprise that none of those 
validationFailedWithException() methods gets hit. If I put something in 
Item.content before the page is rendered, then delete it from the textfield, 
submit: boom. MyText.setValue() is called, Page.validateTakeValueForKeyPath() 
and then Page.validationFailedWithException(), which is just what we want.

Why does this all matter? (Bear with me—I said it was esoteric. Chuck, you 
still here?) Because it’s inconsistent. Say what I’ve _actually_ got on the 
page is more like this:




Item.summary and Item.content are both allowsNull = N. If those attributes are 
both null on page load, and present with empty text fields, when I submit the 
form I get only a single exception (on item.summary) via automatic property 
validation. If I’m checking for those exceptions prior to calling 
saveChanges(), the user can get this sub-optimal experience:

1. User submits blank form.
2. Form returned with “You must enter a summary” (because 
validationFailedWithException() was hit by automatic property validation).
3. User submits form with summary.
4. Now form returned with “You must enter content” (because saveChanges() threw 
a ValidationException).

In this trivial example, yes I could just ignore these automatic property 
validation exceptions altogether and call saveChanges() and get the expected 
two ValidationExceptions. But let’s just say I don’t want to do that. (Or, 
let’s ask why we even have automatic property validation if we can’t rely on 
it.) Clearly this isn’t a bug, as such. But is there an alternate idiom to 
avoid the inconsistency? (Am I imagining the inconsistency because I’m doing 
something stupid?)


-- 
Paul Hoadley
http://logicsquad.net/
https://www.linkedin.com/company/logic-squad/



 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com