• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
A "get..." gotcha!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A "get..." gotcha!


  • Subject: A "get..." gotcha!
  • From: Simon McLean <email@hidden>
  • Date: Thu, 30 Apr 2009 20:19:15 +0100

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: A "get..." gotcha!
      • From: Miguel Arroz <email@hidden>
  • Prev by Date: WOLips migration and WOSortOrder
  • Next by Date: Re: WOLips migration and WOSortOrder
  • Previous by thread: Re: WOLips migration and WOSortOrder
  • Next by thread: Re: A "get..." gotcha!
  • Index(es):
    • Date
    • Thread