Re: D2W Question
Re: D2W Question
- Subject: Re: D2W Question
- From: Mark Wardle <email@hidden>
- Date: Tue, 08 Mar 2011 06:57:30 +0000
The hack is to set a rule that looks up the value of a key. See ERDDelayedKeyValueAssignment. Then set excelFileName to that.
As a last resort (it seems a bit ugly) but you can set a property in the object and set the rule as object.excelFileName (urrrgghh)
Instead, you could store the value in your session and access it from the rules. This still seems a bit hacky to me. I guess I would wonder about creating a default assignment class and allowing that to derive the filename in a more sophisticated way.
I didn't know you could add extra properties in the d2wcontext in code so not sure why Anjo Krank's suggestion hasn't worked for you.
My only thought is that you've not used the correct d2w context.
-- Dr. Mark Wardle Specialist registrar, Neurology (Sent from my mobile)
On 7 Mar 2011, at 19:56, Markus Ruggiero < email@hidden> wrote:
Anjo,
That's what I already tried but it does not work :-(
I found that the app always fires the rule: 100: (pageConfiguration = 'ListExcelTextblock') => excelFileName = "Textblock.xls" [com.webobjects.directtoweb.Assignment]
when it is there. When I remove this rule I always get the default excel file name results.xls. It looks as if the binding in EGWrapper always goes to the rule system and when there is no rule it uses the default. Rule tracing show this clearly.
ERExcelListPage.wo uses EGWrapper as its page wrapper and passes the following binding to it
fileName = d2wContext.excelFileName;
Even doing copy/paste to make sure there is no typo in the word excelFileName does obviously not properly set that particular key in d2wContext. Could it be that the d2wContext is not the same when I set the key?
Confused ---markus----
On 07.03.2011, at 19:50, Anjo Krank wrote:
This works and is almost generic (ExcelDownload component is). However for being truly generic it would be great if I could specify excelFileName and displayNameForSectionKey dynamically with the entity name instead of hard coding those into the rules as above. So what I want is a rule like
Add: d2wContext.takeValueForKey(d2wContext.valueForKey(" entity.name") + ".xls", "excelFileName");
in your link method. Cheers, Anjo _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ( email@hidden)
This email sent to email@hidden
_______________________________________________Do not post admin requests to the list. They will be ignored.Webobjects-dev mailing list (email@hidden)
This email sent to email@hidden
|
_______________________________________________
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