On Aug 20, 2008, at 2:34 PM, Pascal Robert wrote:

"protected int dayIndex;" should be "public int dayIndex;". You get this warning because if you're using packages (I guess you're not, for now) your code wouldn't work. Better fix those warnings right now so that you can use packages later on.

One of the first conversion steps I performed was to add package statements to all class files. All of the java files for the application are in the same package - com.xeotech.xeomed. This code did work on WO 5.3. If a variable was only used in the WOD file, I would generally create a protected iVar but omit the public accessors and let key value coding work its magic. That technique no longer seems to work. I'm not sure what other surprises I will uncover.

I disagree with making my data public. Instead, I created public accessors for the protected iVars. That seems to have cleared up the problem with the bindings. On to the next challenge.

Roger


It took a lot of work, but I have completed most of the transition of my project from Xcode 2.x (WO 5.3) to Eclipse 3.3.2 / WOLips 3.3.5385 (WO 5.4.2). The java files are error from but still have some warnings, mostly due to generics. The problem I am running into is with the WO components. I get error messages (from Eclipse) in the HTML/WOD files stating there is no key 'keyName' in MiniMonthCalendar. It is unable to find inherited iVars. If I define the iVar locally, it works. All java files are in the same package. Note that all of this was working code prior to the migration.

Here are the simplified relevant pieces to the classes / components involved:

BaseComponent extends WOComponent
{
// valueForKey() was overridden here to provide some custom behavior. // I found a thread that indicated that could be the cause problems so I
        // removed it for testing. The errors persisted.
}

CalendarBase extends BaseComponent
{
        protected int dayIndex; // No accessor methods provided for dayIndex
}

MiniMonthCalendar extends CalendarBase
{
        protected  GregorianCalendar  gcMiniCalendar;

        public AppointmentCalendar dayViewForDate()
        {
AppointmentCalendar nextPage = (AppointmentCalendar) pageWithName ( AppointmentCalendar.class.getName() );
                . . .
                return nextPage;
        }

        public NSTimestamp calendarDate()
        {
                NSTimestamp tsTemp = new NSTimestamp( gcMiniCalendar.getTime() 
);
                gcMiniCalendar.add( GregorianCalendar.DAY_OF_MONTH, 1 );
                return tsTemp;
        }

        public NSMutableDictionary<String, String> dateDict()
        {
return NSMutableDictionary containing the date information as a String for the clicked date
        }
}

MiniMonthCalendar.html

                <webobject name="dayLoop">
                        <webobject name="dayLink">
                                <webobject name="theDate"></webobject>
                        </webobject>
                </webobject>


MiniMonthCalendar.wod

dayLoop: WORepetition
{
        count = 7;
index = dayIndex; // Cannot find -- iVar defined in CalendarBase.java
}

dayLink:  WOHyperlink
{
action = dayViewForDate; // Can find -- method defined in MiniMonthCalendar.java queryDictionary = dateDict; // Can find -- method defined in MiniMonthCalendar.java
}

theDate: WOString
{
value = calendarDate; // Can find -- method defined in MiniMonthCalendar.java
        dateformat = "%d";
}

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/probert% 40macti.ca

This email sent to [EMAIL PROTECTED]


-------------------------------------------------------
Pascal Robert

http://www.macti.ca
http://www.linkedin.com/in/macti

Skype: MacTICanada
AIM/iChat : MacTICanada



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
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