You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Linden H van der (MI)" <H....@MI.unimaas.nl> on 2005/04/15 14:41:01 UTC

[CForms] conditional "required" attribute needed or a "better" solution

Guys,

can someone with in-depth knowledge of the CForms widgets help me out
here? I want to build a form that can be used to enter an HL7v3
TelecomAddress[1]. The final XML result looks like this:

<telecomAddress use="HP" nullFlavor="OTH"/>

or

<telecomAddress use="HP" value="tel:+3112345678"/>

I've managed to build the appropriate widget structure for it, but I
have a problem: either 'nullFlavor' or 'value' should be used. If
'nullFlavor' is empty, then 'value' is required and consists of two
required parts: 'scheme' (= tel:, selection list) and the actual number.
So I defined 'value' as an aggregateField.

Is it possible to define the two parts of 'value' to be required, while
the aggregateField itself is not?

Or is there a different solution to solve this problem?


[1] HL7 = a US standards organisation in the field of Medical
Informatics. HL7v3 is their 3rd version of standards, primarily defined
for standardized communication of medical and personal information
between (medical) systems.


Thanks.

Bye,

Helma van der Linden
Medical Informatics
University Maastricht
POBOX 616
6200 MD Maastricht
The Netherlands
h.vanderlinden@mi.unimaas.nl 

Re: [CForms] conditional "required" attribute needed or a "better" solution

Posted by Sylvain Wallez <sy...@apache.org>.
Linden H van der (MI) wrote:

>Guys,
>
>can someone with in-depth knowledge of the CForms widgets help me out
>here? I want to build a form that can be used to enter an HL7v3
>TelecomAddress[1]. The final XML result looks like this:
>
><telecomAddress use="HP" nullFlavor="OTH"/>
>
>or
>
><telecomAddress use="HP" value="tel:+3112345678"/>
>
>I've managed to build the appropriate widget structure for it, but I
>have a problem: either 'nullFlavor' or 'value' should be used. If
>'nullFlavor' is empty, then 'value' is required and consists of two
>required parts: 'scheme' (= tel:, selection list) and the actual number.
>So I defined 'value' as an aggregateField.
>
>Is it possible to define the two parts of 'value' to be required, while
>the aggregateField itself is not?
>
>Or is there a different solution to solve this problem?
>  
>

What about an assert validation on "value"?

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: [CForms] conditional "required" attribute needed or a "better" solution

Posted by Reinhard Poetz <re...@apache.org>.
Linden H van der (MI) wrote:
> Guys,
> 
> can someone with in-depth knowledge of the CForms widgets help me out
> here? I want to build a form that can be used to enter an HL7v3
> TelecomAddress[1]. The final XML result looks like this:
> 
> <telecomAddress use="HP" nullFlavor="OTH"/>
> 
> or
> 
> <telecomAddress use="HP" value="tel:+3112345678"/>
> 
> I've managed to build the appropriate widget structure for it, but I
> have a problem: either 'nullFlavor' or 'value' should be used. If
> 'nullFlavor' is empty, then 'value' is required and consists of two
> required parts: 'scheme' (= tel:, selection list) and the actual number.
> So I defined 'value' as an aggregateField.
> 
> Is it possible to define the two parts of 'value' to be required, while
> the aggregateField itself is not?
> 
> Or is there a different solution to solve this problem?
> 
> 
> [1] HL7 = a US standards organisation in the field of Medical
> Informatics. HL7v3 is their 3rd version of standards, primarily defined
> for standardized communication of medical and personal information
> between (medical) systems.

What about a custom validator?

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------