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 protected]> 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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mailinglists%40kataputt.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:
http://lists.apple.com/mailman/options/webobjects-dev/mark%40wardle.org

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

This email sent to [email protected]

Reply via email to