Le 2011-09-13 à 12:42, Ramsey Gurley a écrit :

> 
> On Sep 13, 2011, at 7:21 AM, Pascal Robert wrote:
> 
>> I have an EO entity that I use to store the value and the type of a report 
>> parameter. The EO have a couple of EO attributes that is stored in a 
>> database, but the « value » attribute is a non-EO attribute, because I only 
>> need to ship the value to a REST service, I don't need to save the value of 
>> the parameter to the database.
>> 
>> So I did the usual. In the ReportParam class, I have a bunch of methods like 
>> this:
>> 
>> public void setBooleanValue(Boolean booleanValue) {
> 
> super.willChange();
> 
>>   if (booleanValue == null) {
>>     booleanValue = false;
>>   }
>>   this.booleanValue = booleanValue;
>> }
>> 
>> And my component, I have a condition that set the value of all boolean 
>> parameters to true:
>> 
>>     if (isShowAll) {
>>       for (ReportParam param: 
>> printDetailsReport.studentPrintDetailsParametersForDisplay()) {
>>         param.setBooleanValue(true);
>>       }
>>     }
>> 
>> Problem is, right after that condition, all parameters value is set to 
>> "false" even if I set them to true. But I change the value of an attribute 
>> that is part of the model in the same For loop, I get the correct value 
>> after the condition. So I guess EOF is doing some magic when it's attributes 
>> from the model?
>> 
>> BTW, the boolean parameters are also used for WOCheckbox in the component, 
>> and if I set it there, the value stays.
> 
> I suspect that last bit is actually the problem. I'm frequently bitten by 
> component synchronization weirdness.  As a test, have you made the boolean 
> value an actual attribute to see if that changes the behavior you are seeing?

Will try, but for now, I "fixed" my problem by using takeValueForKeyPath:

        if (isShowAll) {
        printDetailsReport.takeValueForKeyPath(true, 
"reportParameters.booleanValue");
      }
 _______________________________________________
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