Re: Getting strange KVC error concerning width and ERXSortOrder

2009-12-24 Thread Ramsey Lee Gurley

On Dec 24, 2009, at 8:18 PM, Daniel Beatty wrote:

> Greetings all,
> I was just toying with a D2W example and got a rather weird error.   The 
> error states the following:
> 
> Application:  Forum
> 
> Error:valueForKey()]: lookup of unknown key: 'width'. The WOComponent 
> er.extensions.ERXSortOrder does not have an instance variable of the name 
> width or _width, nor a method of the name width, _width, getWidth, or 
> _getWidth' object '' key 'width'>
> 
> Reason:   [ subcomponents: null > valueForKey()]: lookup of unknown key: 'width'. The 
> WOComponent er.extensions.ERXSortOrder does not have an instance variable of 
> the name width or _width, nor a method of the name width, _width, getWidth, 
> or _getWidth

I'm gonna say clean your project and your ERExtensions framework, because on 
line 157 of ERXSortOrder, I see

public Object width() {
return hasBinding("width") ? valueForBinding("width") : "9";
}

The error message is wrong. In fact, why is it reading 
er.extensions.ERXSortOrder.  That should be 
er.extensions.components.ERXSortOrder unless you are using an ancient copy of 
ERExtensions.

Ramsey


> 
> At the time it was trying to list the elements of a table (Forum type).   
> There is no width property in the forum table, nor should there be.   
> 
> Any ideas?
> 
> Dan Beatty, M.S. CS (B.S. EECS)
> Ph.D. Student 
> Texas Tech University
> dan.bea...@mac.com
> http://venus.cs.ttu.edu/~dabeatty
> http://web.me.com/danielbeatty/My_Home_Page/Welcome.html
> 
> 
> 
> 
> 
> 
> 
> ___
> 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:
> http://lists.apple.com/mailman/options/webobjects-dev/rgurley%40mac.com
> 
> This email sent to rgur...@mac.com



smime.p7s
Description: S/MIME cryptographic signature
 ___
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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Getting strange KVC error concerning width and ERXSortOrder

2009-12-24 Thread Daniel Beatty
Greetings all,
I was just toying with a D2W example and got a rather weird error.   The error 
states the following:

Application:Forum

Error:  valueForKey()]: lookup of unknown key: 'width'. The WOComponent 
er.extensions.ERXSortOrder does not have an instance variable of the name width 
or _width, nor a method of the name width, _width, getWidth, or _getWidth' 
object '' key 'width'>

Reason: [ valueForKey()]: lookup of unknown key: 'width'. The 
WOComponent er.extensions.ERXSortOrder does not have an instance variable of 
the name width or _width, nor a method of the name width, _width, getWidth, or 
_getWidth

At the time it was trying to list the elements of a table (Forum type).   There 
is no width property in the forum table, nor should there be.   

Any ideas?

Dan Beatty, M.S. CS (B.S. EECS)
Ph.D. Student 
Texas Tech University
dan.bea...@mac.com
http://venus.cs.ttu.edu/~dabeatty
http://web.me.com/danielbeatty/My_Home_Page/Welcome.html







 ___
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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Localization problem, hello world too [solved]

2009-12-24 Thread Ramsey Lee Gurley
Hmm, beyond that, I'm not really sure. Maybe someone who does session-less WO 
apps has better advice. 

Since writing that bit of info, I've accepted that attempting to use WO without 
sessions is a practice in masochism.  You lose all the real power of WO without 
sessions.  No component actions, no D2W, no Wonder Ajax, etc.  All the best 
parts of WO depend on a session, and in your case, you're already setting a 
cookie.  Ask yourself, "What difference would it make to set a session cookie 
instead of (or in addition to) a language cookie?"  Is that going to be worth 
the pain of hand crafting pages, battling accidental session creation, and 
managing page state entirely through DAs and cookies?  

Naturally, those questions are rhetorical.  Since I don't know what exactly 
you're trying to accomplish, I'm certainly not saying what you're doing is 
somehow wrong.  I'm just afraid this little exercise in page state management 
is only the tip of the iceberg if you plan on doing much without a session.

Ramsey


On Dec 24, 2009, at 10:16 AM, Johann Werner wrote:

> Hi Ramsey,
> 
> my default language is English. In my performActionNamed method I am already 
> doing this:
> 
> String lang = request().cookieValueForKey("language");
> NSArray languages = null;
> if (lang == null) {
>   languages = request().browserLanguages();
> } else {
>   languages = new NSArray(lang, "English");
> }
> ERXLocalizer.setCurrentLocalizer(ERXLocalizer.localizerForLanguages(languages));
> 
> but when I invoke pageWithName the current localizer is ignored.
> 
> jw
> 
> 
> Am 24.12.2009 um 15:59 schrieb Ramsey Lee Gurley:
> 
>> 
>> On Dec 24, 2009, at 9:20 AM, Johann Werner wrote:
>> 
>>> Hi list,
>>> 
>>> I have the same problem as described in this thread. I have an app that 
>>> uses only direct actions (no sessions) but stores the current language in a 
>>> cookie. By default I check for that language setting and set the current 
>>> ERXLocalizer accordingly. But when calling pageWithName I get every time 
>>> the German component (there is a German and an English component) even if I 
>>> set the localizer to English.
>> 
>> German is your default?  Did you try
>> 
>> http://wiki.objectstyle.org/confluence/display/WO/Web+Applications-Development-Localization+and+Internationalization
>> 
>> Second paragraph from the bottom (under "Direct Actions").  Instead of just 
>> looking at the browserLanguages(), you could check for the cookie value 
>> first.
>> 
>> Ramsey
>> 
>>> 
>>> The setting er.extensions.ERXApplication.fixCachingEnabled=false as 
>>> mentioned by Ramsey didn't show any effect and digging inside the WOContext 
>>> source I found the method _languages() that should return the language(s) 
>>> to be used:
>>> 
>>> If there is no session that method returns a _languagesAction array if 
>>> non-null but this var and its setter are private so I don't see how to 
>>> change its value. If it is null, which is its default value, then the 
>>> browser languages are returned. I think there should be a check, if the 
>>> localization is enabled in the app and return the language of the current 
>>> localizer instead, shouldn't it?
>>> 
>>> Any thoughts? I altered my ERXWOContext for now and could put a patch on 
>>> jira.
>>> 
>>> Happy Christmas,
>>> jw
>>> 
>>> 
>>> Am 02.12.2008 um 23:55 schrieb Ramsey Lee Gurley:
>>> 
 
 On Dec 2, 2008, at 2:53 AM, Anjo Krank wrote:
 
> 
> Am 02.12.2008 um 08:04 schrieb Anjo Krank:
> 
>> If it doesn't, rewrite the method so it re-orders the nsarray so that it 
>> still has all items from _expectedLanguages, but the ones from nsarray 
>> come first and in order and post a patch.
> 
> I checked in an (untested) interim patch. See if the problem persists.
> 
> Cheers, Anjo
 
 Nice patch :-)  Oh, and for the record, what I was saying earlier about 
 needing to return something from session languages() is complete 
 garbage... I see you've already taken care of that in ERXSession's 
 setLanguage().  The problem here was my test app was returning null from 
 the updateLanguage() action instead of a page. [Are you listening to this 
 Mike? :-) ]  I think this must be different from Mike and Chuck's debate 
 though, because even returning context().page() causes the contents of the 
 current page object to be re-rendered instead of refreshing the localized  
 component.  I actually needed to do
 
public WOActionResults updateLang() {
return 
 WOApplication.application().pageWithName(context().page().name(), 
 context());
}
 
 to get the right localized page component when changing languages.  
 Perhaps there's another way to invalidate the page and cause the whole 
 thing to refresh, but I'm satisfied with that for now...
 
 Ramsey



smime.p7s
Description: S/MIME cryptographic signature
 __

Re: Localization problem, hello world too [solved]

2009-12-24 Thread Johann Werner
Hi Ramsey,

my default language is English. In my performActionNamed method I am already 
doing this:

String lang = request().cookieValueForKey("language");
NSArray languages = null;
if (lang == null) {
languages = request().browserLanguages();
} else {
languages = new NSArray(lang, "English");
}
ERXLocalizer.setCurrentLocalizer(ERXLocalizer.localizerForLanguages(languages));

but when I invoke pageWithName the current localizer is ignored.

jw


Am 24.12.2009 um 15:59 schrieb Ramsey Lee Gurley:

> 
> On Dec 24, 2009, at 9:20 AM, Johann Werner wrote:
> 
>> Hi list,
>> 
>> I have the same problem as described in this thread. I have an app that uses 
>> only direct actions (no sessions) but stores the current language in a 
>> cookie. By default I check for that language setting and set the current 
>> ERXLocalizer accordingly. But when calling pageWithName I get every time the 
>> German component (there is a German and an English component) even if I set 
>> the localizer to English.
> 
> German is your default?  Did you try
> 
> http://wiki.objectstyle.org/confluence/display/WO/Web+Applications-Development-Localization+and+Internationalization
> 
> Second paragraph from the bottom (under "Direct Actions").  Instead of just 
> looking at the browserLanguages(), you could check for the cookie value first.
> 
> Ramsey
> 
>> 
>> The setting er.extensions.ERXApplication.fixCachingEnabled=false as 
>> mentioned by Ramsey didn't show any effect and digging inside the WOContext 
>> source I found the method _languages() that should return the language(s) to 
>> be used:
>> 
>> If there is no session that method returns a _languagesAction array if 
>> non-null but this var and its setter are private so I don't see how to 
>> change its value. If it is null, which is its default value, then the 
>> browser languages are returned. I think there should be a check, if the 
>> localization is enabled in the app and return the language of the current 
>> localizer instead, shouldn't it?
>> 
>> Any thoughts? I altered my ERXWOContext for now and could put a patch on 
>> jira.
>> 
>> Happy Christmas,
>> jw
>> 
>> 
>> Am 02.12.2008 um 23:55 schrieb Ramsey Lee Gurley:
>> 
>>> 
>>> On Dec 2, 2008, at 2:53 AM, Anjo Krank wrote:
>>> 
 
 Am 02.12.2008 um 08:04 schrieb Anjo Krank:
 
> If it doesn't, rewrite the method so it re-orders the nsarray so that it 
> still has all items from _expectedLanguages, but the ones from nsarray 
> come first and in order and post a patch.
 
 I checked in an (untested) interim patch. See if the problem persists.
 
 Cheers, Anjo
>>> 
>>> Nice patch :-)  Oh, and for the record, what I was saying earlier about 
>>> needing to return something from session languages() is complete garbage... 
>>> I see you've already taken care of that in ERXSession's setLanguage().  The 
>>> problem here was my test app was returning null from the updateLanguage() 
>>> action instead of a page. [Are you listening to this Mike? :-) ]  I think 
>>> this must be different from Mike and Chuck's debate though, because even 
>>> returning context().page() causes the contents of the current page object 
>>> to be re-rendered instead of refreshing the localized  component.  I 
>>> actually needed to do
>>> 
>>> public WOActionResults updateLang() {
>>> return 
>>> WOApplication.application().pageWithName(context().page().name(), 
>>> context());
>>> }
>>> 
>>> to get the right localized page component when changing languages.  Perhaps 
>>> there's another way to invalidate the page and cause the whole thing to 
>>> refresh, but I'm satisfied with that for now...
>>> 
>>> Ramsey


smime.p7s
Description: S/MIME cryptographic signature
 ___
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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

DivaLook ?

2009-12-24 Thread James Cicenia
Hello -

I launched my new WonderD2W application and it came up like a charm.

Now I want to get move my Look to the "new" CSS world of DivaLook.
However, I can't seem to get it configured properly to work.

No matter what I seem to do, I keep getting various Ajax errors? Now
I configured my project to have the WonderAjax frameworks so I now
don't know what I am missing. 

I think the DivaLook pages on the WikiPedia need a very simple how
to make your new D2W app use Diva. What are the frameworks necessary
and what are the rules.

Anyway have success with DivaLook? Oh, and what is DivaLookLite?

Thanks and Merry Christmas
James Cicenia

 ___
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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Localization problem, hello world too [solved]

2009-12-24 Thread Ramsey Lee Gurley

On Dec 24, 2009, at 9:20 AM, Johann Werner wrote:

> Hi list,
> 
> I have the same problem as described in this thread. I have an app that uses 
> only direct actions (no sessions) but stores the current language in a 
> cookie. By default I check for that language setting and set the current 
> ERXLocalizer accordingly. But when calling pageWithName I get every time the 
> German component (there is a German and an English component) even if I set 
> the localizer to English.

German is your default?  Did you try

http://wiki.objectstyle.org/confluence/display/WO/Web+Applications-Development-Localization+and+Internationalization

Second paragraph from the bottom (under "Direct Actions").  Instead of just 
looking at the browserLanguages(), you could check for the cookie value first.

Ramsey

> 
> The setting er.extensions.ERXApplication.fixCachingEnabled=false as mentioned 
> by Ramsey didn't show any effect and digging inside the WOContext source I 
> found the method _languages() that should return the language(s) to be used:
> 
> If there is no session that method returns a _languagesAction array if 
> non-null but this var and its setter are private so I don't see how to change 
> its value. If it is null, which is its default value, then the browser 
> languages are returned. I think there should be a check, if the localization 
> is enabled in the app and return the language of the current localizer 
> instead, shouldn't it?
> 
> Any thoughts? I altered my ERXWOContext for now and could put a patch on jira.
> 
> Happy Christmas,
> jw
> 
> 
> Am 02.12.2008 um 23:55 schrieb Ramsey Lee Gurley:
> 
>> 
>> On Dec 2, 2008, at 2:53 AM, Anjo Krank wrote:
>> 
>>> 
>>> Am 02.12.2008 um 08:04 schrieb Anjo Krank:
>>> 
 If it doesn't, rewrite the method so it re-orders the nsarray so that it 
 still has all items from _expectedLanguages, but the ones from nsarray 
 come first and in order and post a patch.
>>> 
>>> I checked in an (untested) interim patch. See if the problem persists.
>>> 
>>> Cheers, Anjo
>> 
>> Nice patch :-)  Oh, and for the record, what I was saying earlier about 
>> needing to return something from session languages() is complete garbage... 
>> I see you've already taken care of that in ERXSession's setLanguage().  The 
>> problem here was my test app was returning null from the updateLanguage() 
>> action instead of a page. [Are you listening to this Mike? :-) ]  I think 
>> this must be different from Mike and Chuck's debate though, because even 
>> returning context().page() causes the contents of the current page object to 
>> be re-rendered instead of refreshing the localized  component.  I actually 
>> needed to do
>> 
>>  public WOActionResults updateLang() {
>>  return 
>> WOApplication.application().pageWithName(context().page().name(), context());
>>  }
>> 
>> to get the right localized page component when changing languages.  Perhaps 
>> there's another way to invalidate the page and cause the whole thing to 
>> refresh, but I'm satisfied with that for now...
>> 
>> Ramsey
> 
> 
> ___
> 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:
> http://lists.apple.com/mailman/options/webobjects-dev/rgurley%40mac.com
> 
> This email sent to rgur...@mac.com



smime.p7s
Description: S/MIME cryptographic signature
 ___
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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Fwd: Day 24: All PDFs $4.99!

2009-12-24 Thread Kieran Kelleher

FYI, just passing this on. SitePoint PDF books are all 4.99 today.

Begin forwarded message:


From: "sitepoint.com" 
Date: December 24, 2009 3:46:17 AM EST
Subject: Day 24: All PDFs $4.99!

Hello,

It's the final day of our Christmas Countdown and today's
deal is a big one ...

For today only, all our PDFs are just $4.99.

Grab yours now before time runs out!

http://sale.sitepoint.com

There's a limit of 5 per order, but we've included a
handy book finder to help you pick the perfect 5 for you.

Today also marks the end of our Christmas Countdown. So
on behalf of the entire SitePoint team, thanks for a great
2009 and we look forward to a bigger and better 2010.

All the best,

Shayne Tilley
sitepoint.com


PS: If you ever wanted to connect with the team at
SitePoint, be sure to check out our Facebook page:

http://www.facebook.com/sitepoint



 ___
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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: Localization problem, hello world too [solved]

2009-12-24 Thread Johann Werner
Hi list,

I have the same problem as described in this thread. I have an app that uses 
only direct actions (no sessions) but stores the current language in a cookie. 
By default I check for that language setting and set the current ERXLocalizer 
accordingly. But when calling pageWithName I get every time the German 
component (there is a German and an English component) even if I set the 
localizer to English.

The setting er.extensions.ERXApplication.fixCachingEnabled=false as mentioned 
by Ramsey didn't show any effect and digging inside the WOContext source I 
found the method _languages() that should return the language(s) to be used:

If there is no session that method returns a _languagesAction array if non-null 
but this var and its setter are private so I don't see how to change its value. 
If it is null, which is its default value, then the browser languages are 
returned. I think there should be a check, if the localization is enabled in 
the app and return the language of the current localizer instead, shouldn't it?

Any thoughts? I altered my ERXWOContext for now and could put a patch on jira.

Happy Christmas,
jw


Am 02.12.2008 um 23:55 schrieb Ramsey Lee Gurley:

> 
> On Dec 2, 2008, at 2:53 AM, Anjo Krank wrote:
> 
>> 
>> Am 02.12.2008 um 08:04 schrieb Anjo Krank:
>> 
>>> If it doesn't, rewrite the method so it re-orders the nsarray so that it 
>>> still has all items from _expectedLanguages, but the ones from nsarray come 
>>> first and in order and post a patch.
>> 
>> I checked in an (untested) interim patch. See if the problem persists.
>> 
>> Cheers, Anjo
> 
> Nice patch :-)  Oh, and for the record, what I was saying earlier about 
> needing to return something from session languages() is complete garbage... I 
> see you've already taken care of that in ERXSession's setLanguage().  The 
> problem here was my test app was returning null from the updateLanguage() 
> action instead of a page. [Are you listening to this Mike? :-) ]  I think 
> this must be different from Mike and Chuck's debate though, because even 
> returning context().page() causes the contents of the current page object to 
> be re-rendered instead of refreshing the localized  component.  I actually 
> needed to do
> 
>   public WOActionResults updateLang() {
>   return 
> WOApplication.application().pageWithName(context().page().name(), context());
>   }
> 
> to get the right localized page component when changing languages.  Perhaps 
> there's another way to invalidate the page and cause the whole thing to 
> refresh, but I'm satisfied with that for now...
> 
> Ramsey




smime.p7s
Description: S/MIME cryptographic signature
 ___
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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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