On 2011-12-08, at 2:30 PM, Ramsey Gurley wrote:
>
> On Dec 8, 2011, at 2:36 PM, James Cicenia wrote:
>
>>
>> However, the one snag is that I can't have phantom non eo keys.
>
> Oh, but you can :-)
>
> http://developer.apple.com/legacy/mac/library/documentation/InternetWeb/Reference/WO542Reference/com/webobjects/foundation/NSKeyValueCoding.ErrorHandling.html
>
> Specifically when valueForKey or takeValueForKey are called,
> handleQueryForUnboundKey and handleTakeValueForUnboundKey (respectively) are
> called on the EO if the key doesn't exist. The default behavior is to just
> throw an UnknownKeyException, but you can override those methods and handle a
> key yourself. When you do, it is as if the EO really had that key.
Oh no! What have you started?
This took me SO LONG to figure out. Not that I've figured it out.
BugTracker goes crazy with this stuff.
>
> Ramsey
>
>
>>
>> So I created some attributes in the EO.... rptCol01 ... rptColXX
>>
>> And then map those properties to a customComponent.
>>
>> Seems to be working as clean as I could design it.
>>
>> James
>>
>>
>> On Dec 8, 2011, at 12:23 PM, David Holt wrote:
>>
>>>
>>> On 2011-12-08, at 9:17 AM, James Cicenia wrote:
>>>
>>>> That all makes sense now and works perfectly. This conversion might go
>>>> better than I originally planned.
>>>>
>>>> Thank you very much.
>>>> James
>>>>
>>>> ps: now I can make a nice generalized custom reporting engine!
>>>
>>> It would be nice if you had time to share how you went about it. It sounds
>>> good!
>>>
>>> David
>>>
>>>
>>>>
>>>> On Dec 8, 2011, at 10:25 AM, Ramsey Gurley wrote:
>>>>
>>>>> Instead of using rules
>>>>>
>>>>>
>>>>> (entity.name = 'PortfolioProject' and propertyKey = 'primaryGroup')
>>>>> componentName = "D2WCustomComponent"
>>>>>
>>>>> (entity.name = 'PortfolioProject' and propertyKey = 'primaryGroup')
>>>>> customComponentName = "D2WPrimaryAlignmentMetricByKey"
>>>>>
>>>>> use
>>>>>
>>>>> (entity.name = 'PortfolioProject' and propertyKey = 'primaryGroup')
>>>>> componentName = "D2WPrimaryAlignmentMetricByKey"
>>>>>
>>>>> Since you are extending ERDCustomComponent, you shouldn't need the
>>>>> wrapper. Then you can just call valueForBinding to get whatever you need
>>>>> from the d2wContext.
>>>>>
>>>>> public String value(){
>>>>> return
>>>>> ((PortfolioProject)object).metricListValueByMetric(valueForBinding("lookupString"));
>>>>> }
>>>>>
>>>>> Ramsey
>>>>>
>>>>> On Dec 8, 2011, at 6:19 AM, James Cicenia wrote:
>>>>>
>>>>>> OK -
>>>>>>
>>>>>>
>>>>>> I spent a lot of hours last night converting a test version of this
>>>>>> application to extend ERXApplication.... etc. I would be doing it the
>>>>>> first of the year anyway.
>>>>>>
>>>>>> Now I have a little D2W rendering component. I want the rule to change
>>>>>> an attribute of it. But I can't seem to make it happen.
>>>>>>
>>>>>> here is my simple component:
>>>>>>
>>>>>> public class D2WPrimaryAlignmentMetricByKey extends ERDCustomComponent {
>>>>>> public EOEnterpriseObject object;
>>>>>> public String key;
>>>>>> public String lookupString;
>>>>>>
>>>>>> public D2WPrimaryAlignmentMetricByKey(WOContext context) {
>>>>>> super(context);
>>>>>> }
>>>>>>
>>>>>>
>>>>>> public String value(){
>>>>>> return
>>>>>> ((PortfolioProject)object).metricListValueByMetric(lookupString);
>>>>>> }
>>>>>> }
>>>>>>
>>>>>>
>>>>>> What can I do to get lookupString to be supplied by a rule??
>>>>>>
>>>>>> Here is my rule:
>>>>>>
>>>>>> (entity.name = 'PortfolioProject' and propertyKey = 'primaryGroup') ==>
>>>>>> lookupString com.webobjects.directtoweb.Assignment "Primary Group"
>>>>>>
>>>>>> lookupString is always null when I run my report and debug my component.
>>>>>>
>>>>>> What am I missing.
>>>>>>
>>>>>>
>>>>>> James Cicenia
>>>>>> cell: 773.398.4649
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> 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/rgurley%40smarthealth.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/programmingosx%40mac.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/rgurley%40smarthealth.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/programmingosx%40mac.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/archive%40mail-archive.com
This email sent to [email protected]