Re: Binding values for Required & Optional

Mike Schrag <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Just to expand, if you have two required fields it would be:

	<validation message="&apos;key&apos; and &apos;value&apos; are  
required bindings">
		<or>
			<unbound name="key"/>
			<unbound name="value"/>
		</or>
	</validation>

if one of two fields is required:

	<validation message="At least one of &apos;key&apos; or  
&apos;value&apos; must be set">
		<and>
			<unbound name="key"/>
			<unbound name="value"/>
		</and>
	</validation>

So if the logic inside the <validation> tag evaluates to true, then  
the validation message is displayed.  You can also use <bound> in  
addition to <unbound>.  For instance, if you have a field that must  
be set when another field exists, you can have:

	<validation message="&apos;listItemIDKeyPath&apos; must be bound  
when &apos;list&apos; is bound">
		<and>
			<bound name = "list"/>
			<unbound name = "listItemIDKeyPath"/>
		</and>
	</validation>

ms

On Jul 11, 2006, at 6:58 AM, Paul Lynch wrote:

> eg:
>
> <?xml version="1.0" encoding="macintosh" standalone="yes"?>
> <wodefinitions>
> 	<wo class="PLKeyValueConditional" wocomponentcontent="YES">
>
> 		<binding name="key"/>
> 		<binding name="value"/>
> 		<binding name="negate"/>
>
> 		<validation message="&apos;key&apos; is a required binding">
> 			<unbound name="key"/>
> 		</validation>
> 	</wo>
> </wodefinitions>
>
> Paul
>
> On 11 Jul 2006, at 11:45, Cheong Hee (QSS) wrote:
>
>> In previous version (guess Version 4.5), the variable could pass  
>> into component using this binding values defined in .api:
>>     Required = (itemOneRequired, itemTwoRequired);
>>     Optional = (itemOneOptional, itemTwoOptional);
>>
>> In 5.0 version above, the api has changed to xml format.  Could  
>> someone share how do we pass in the Required and Optional binding  
>> values now?
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> <wodefinitions>
>>         <wo wocomponentcontent="false" class="ComponentPageName">
>>
>>         </wo>
>> </wodefinitions>
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.