• 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: D2W displayPropertyKeys indirection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: D2W displayPropertyKeys indirection


  • Subject: Re: D2W displayPropertyKeys indirection
  • From: Theodore Petrosky <email@hidden>
  • Date: Tue, 25 Jun 2013 22:57:21 -0400

yes of course, an array of strings

BTW, would it not be better to place the key for the array in the context? in the method that creates the array instead of sending it to the session, do something like:

d2wContext().takeValueForKey(theReportArray, "theReportKeys");

then your rule would look like:

100 : pageConfiguration like 'List*' => displayPropertyKeys = "theReportKeys" [ERDDelayedKeyValueAssignment]

I'm not sure 100% that it would work, but I though I would ask, especially since I am trying to keep things out of my session.

Ted

On Jun 25, 2013, at 11:58 AM, James Cicenia <email@hidden> wrote:


NSArray of strings.

On Jun 25, 2013, at 10:52 AM, Theodore Petrosky <email@hidden> wrote:

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@hidden> 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@hidden> wrote:


On 25.06.2013, at 09:37, Theodore Petrosky <email@hidden> 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@hidden> 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@hidden
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@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >D2W displayPropertyKeys indirection (From: Markus Ruggiero <email@hidden>)
 >Re: D2W displayPropertyKeys indirection (From: Theodore Petrosky <email@hidden>)
 >Re: D2W displayPropertyKeys indirection (From: Markus Ruggiero <email@hidden>)
 >Re: D2W displayPropertyKeys indirection (From: James Cicenia <email@hidden>)
 >Re: D2W displayPropertyKeys indirection (From: Theodore Petrosky <email@hidden>)
 >Re: D2W displayPropertyKeys indirection (From: James Cicenia <email@hidden>)

  • Prev by Date: Re: D2W displayPropertyKeys indirection
  • Next by Date: WO + MQ
  • Previous by thread: Re: D2W displayPropertyKeys indirection
  • Next by thread: Re: D2W displayPropertyKeys indirection
  • Index(es):
    • Date
    • Thread