but of course in this case, session.theReportKeys is an NSDictionary or NSSet, 
no? Something that has keys, and values. Not just a string

Ted




On Jun 25, 2013, at 11:19 AM, James Cicenia <[email protected]> wrote:

> 
> I don't know but this worked for me:
> 
> 100 : pageConfiguration like 'List*' => displayPropertyKeys = 
> "session.theReportKeys" [ERDDelayedKeyValueAssignment]
> 
> On Jun 25, 2013, at 10:07 AM, Markus Ruggiero <[email protected]> 
> wrote:
> 
>> 
>> On 25.06.2013, at 09:37, Theodore Petrosky <[email protected]> wrote:
>> 
>>> You are trying to override the propertyKeys that the context has for  list 
>>> or edit page?
>>> 
>> 
>> Yes, that's exactly what I want. 
>> Background:
>> On a D2WQueryPage I have one custom query property. The user can create 
>> quite a complex query based on (almost) random selection of query criteria. 
>> I have everything working, query does what it should do and finds the 
>> correct resulting objects. Then these are displayed with a standard 
>> D2WListPage. The customer wants the displayPropertyKeys to reflect the query 
>> criteria. There are way too many combinations so I cannot just have a couple 
>> of rule based ready-made displayPropertyKey arrays. So my  idea was to build 
>> the array dynamically inside the custom property level component, because 
>> that is the only place where I know exactly what properties should be in the 
>> resulting list page. Of course I could create my own custom ListPage and 
>> build the list in code, but I always think D2W and the computer are being 
>> "payed" to work thus they should do the work, not me!
>> 
>> Thanks for any help
>> ---markus---
>> 
>> 
>>> Ted
>>> 
>>> On Jun 25, 2013, at 7:57 AM, Markus Ruggiero <[email protected]> 
>>> wrote:
>>> 
>>>> Folks,
>>>> 
>>>> I need to have a dynamically populated displayPropertyKeys for a list 
>>>> page. I was trying a couple things and eventually got the following tip. 
>>>> Unfortunately it seems not to work
>>>> 
>>>> In Session.java
>>>> 
>>>> private NSArray<String> listElectronicDocumentDisplayPropertyKeys;
>>>> 
>>>> public void setListElectronicDocumentDisplayPropertyKeys(NSArray<String> 
>>>> keyArray) {
>>>>     listElectronicDocumentDisplayPropertyKeys = keyArray
>>>> }
>>>> 
>>>> public NSArray<String> listElectronicDocumentDisplayPropertyKeys() {
>>>>     return listElectronicDocumentDisplayPropertyKeys;
>>>> }
>>>> 
>>>> 
>>>> With the following rule:
>>>> 
>>>> 100 : pageConfiguration = 'ListElectronicDocument' => displayPropertyKeys 
>>>> = session.listElectronicDocumentDisplayPropertyKeys  
>>>> [com.webobjects.directtoweb.DelayedKeyValueAssignment]
>>>> 
>>>> All I get is a nice crash :-(
>>>> 
>>>> Jun 25 10:21:46 ec_admin[12000] DEBUG NSLog  - ****** fire :    100 : 
>>>> (pageConfiguration = 'ListElectronicDocument') => displayPropertyKeys = 
>>>> session.listElectronicDocumentDisplayPropertyKeys 
>>>> [com.webobjects.directtoweb.DelayedKeyValueAssignment] (100501)
>>>> Jun 25 10:21:46 ec_admin[12000] WARN  NSLog  - 
>>>> <er.extensions.appserver.ERXComponentRequestHandler>: Exception occurred 
>>>> while handling request:
>>>> java.lang.ClassCastException: java.lang.String cannot be cast to 
>>>> com.webobjects.foundation.NSArray
>>>> [2013-6-25 10:21:46 CEST] <WorkerThread12> java.lang.ClassCastException: 
>>>> java.lang.String cannot be cast to com.webobjects.foundation.NSArray
>>>>    at 
>>>> er.directtoweb.pages.ERD2WListPage.sortOrderings(ERD2WListPage.java:432)
>>>>    at er.directtoweb.pages.ERD2WListPage.setupPhase(ERD2WListPage.java:563)
>>>>    at 
>>>> er.directtoweb.pages.ERD2WListPage.appendToResponse(ERD2WListPage.java:498)
>>>>    at 
>>>> com.webobjects.appserver.WOSession.appendToResponse(WOSession.java:1385)
>>>>    at 
>>>> er.extensions.appserver.ERXSession.appendToResponse(ERXSession.java:571)
>>>>    at 
>>>> com.webobjects.appserver.WOApplication.appendToResponse(WOApplication.java:1794)
>>>>    at 
>>>> er.extensions.appserver.ERXApplication.appendToResponse(ERXApplication.java:2005)
>>>>    at 
>>>> er.extensions.appserver.ERXComponentRequestHandler._dispatchWithPreparedPage(ERXComponentRequestHandler.java:190)
>>>>    at 
>>>> er.extensions.appserver.ERXComponentRequestHandler._dispatchWithPreparedSession(ERXComponentRequestHandler.java:235)
>>>>    at 
>>>> er.extensions.appserver.ERXComponentRequestHandler._dispatchWithPreparedApplication(ERXComponentRequestHandler.java:268)
>>>>    at 
>>>> er.extensions.appserver.ERXComponentRequestHandler._handleRequest(ERXComponentRequestHandler.java:302)
>>>>    at 
>>>> er.extensions.appserver.ERXComponentRequestHandler.handleRequest(ERXComponentRequestHandler.java:375)
>>>>    at 
>>>> com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
>>>>    at 
>>>> er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:2109)
>>>>    at 
>>>> er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:2074)
>>>>    at com.dsm.ec_admin.Application.dispatchRequest(Application.java:271)
>>>>    at 
>>>> com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
>>>>    at 
>>>> com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
>>>>    at java.lang.Thread.run(Thread.java:680)
>>>> 
>>>> I can sort of understand what is going on: D2W thinks that 
>>>> session.listElectronicDocumentDisplayPropertyKeys is a string instead of 
>>>> evaluating it. But isn't the rule system supposed to recursively resolve 
>>>> this?
>>>> 
>>>> Any other idea? Or would I have to meddle with ER2DWListPage.java?
>>>> 
>>>> Thanks for any quick answer
>>>> 
>>>> ---markus---
>>>> 
>>>> 
>>>> 
>>>> 
>>>> Markus Ruggiero
>>>> [email protected]
>>>> Check out the new book about Project Wonder and WebObjects on 
>>>> http://learningthewonders.com/
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list      ([email protected])
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
>>>> 
>>>> This email sent to [email protected]
>>> 
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/james%40jimijon.com
>> 
>> This email sent to [email protected]
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
> 
> This email sent to [email protected]

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

This email sent to [email protected]

Reply via email to