• 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
Re: binding validation problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binding validation problem


  • Subject: Re: binding validation problem
  • From: Johann Werner <email@hidden>
  • Date: Tue, 1 Apr 2008 10:24:17 +0200


Am 01.04.2008 um 05:26 schrieb Archibald Singleton:

On 01 Apr 2008, at 00:16, Mike Schrag wrote:
<wo:WOImage alt = "~\"Order a \" + $currentItem" border = "0" filename = "~$currentItem + \".gif\""/>
OGNL doesn't use $, it just uses the binding name, so "~ $currentItem + \".gif\"" is invalid, it should be "~currentItem + '.gif'" (single tick instead of quote is a lot easier with OGNL, too -- a lot less escaping).

Ooops, so the error message was actually pretty straight on, missed the '$' in the keyname %-).
Thanks! (also for pointing out the use single quote).


Now for another one:

Application.java has the following accessor method

	public NSArray<Entree> entrees() {
		return _entrees;
	}

	public void setEntrees(NSArray<Entree> entrees) {
		_entrees = entrees;

	}

And Main.html has the following subcomponent for which I'm getting the following error message "There is no key 'entrees' for the keypath 'application' in Main"


<wo:loop list = "$application.entrees" item = "$currentItem">

I'm sure it's something obvious again, but I can see what.

That warning is normal when you use the default method application() from WOComponent. That method returns an object of type WOApplication that does not have your ivar declared. That ivar is in your Application object. So it is absolutely correct that the component editor displays en error message.
To make it disappear you have to either put in a //VALID so the editor ignores that part in the validation process or put the method


@Override
public Application application() {
	return (Application) super.application();
}

to typecast your application object into your component or better put it in a superclass for all your components.

jw





= tmk =

_______________________________________________
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

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

This email sent to email@hidden

  • Follow-Ups:
    • Re: binding validation problem
      • From: Mike Schrag <email@hidden>
    • Re: binding validation problem
      • From: Alexander Spohr <email@hidden>
  • Prev by Date: Re: Hyperlinks and action methods
  • Next by Date: Re: [OT] Limiting File Upload Sizes
  • Previous by thread: Re: Hyperlinks and action methods
  • Next by thread: Re: binding validation problem
  • Index(es):
    • Date
    • Thread