Hi!

That's normal. What you must define in the WO component is the key you want to access, not the method name. If you use getters without "get", the key happens to be the same as the getter method, but it's a coincidence.

Check the key/value access rules to know how your methods and variables can be named.

  Yours

Miguel Arroz


On 2009/04/30, at 20:19, Simon McLean wrote:

hopefully this post will avoid someone else wasting needless hours ...

we use the "get" and "set" convention across all of our projects.

Today I put together the classic way of handling checkboxes in an
WORepetition using the following "get" and "set" methods:

        public boolean getGroupSelected() {
                return selectedEmployeeGroups.contains(anEmployeeGroup);
        }

        public void setGroupSelected(boolean b) {
                if (b) {
                        if 
(!selectedEmployeeGroups.containsObject(anEmployeeGroup)) {
                                
selectedEmployeeGroups.addObject(anEmployeeGroup);
                        }
                } else if 
(selectedEmployeeGroups.containsObject(anEmployeeGroup)) {
                        selectedEmployeeGroups.removeObject(anEmployeeGroup);
                }
        }

I then binded up my checkbox like this:

<wo:checkbox checked = "$getGroupSelected"/>

However, when the code runs WO was giving me the classic exception
"the component [insert component name] does not have a method with the
name getGroupSelected .... blah blah blah"

So, you check your class, check your bindings and begin to bang your
head on the desk shouting "yes it f$!&% well does !!!"

Anyway, change the component binding to this:

<wo:checkbox checked = "$groupSelected"/>

and WO is happy again.

I think what is happening is that during the RR loop WO looks for
"setGetGroupSelected" rather than plain "setGroupSelected" and hence
decides it's not going to play game.

Simon
_______________________________________________
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/arroz%40guiamac.com

This email sent to [email protected]

...........................
http://www.survs.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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