W3C home > Mailing lists > Public > www-forms@w3.org > July 2006

recalculate in response to a changed input

From: Flinton Adam <Adam.Flinton@cfh.nhs.uk>
Date: Fri, 28 Jul 2006 11:46:08 +0100
Message-ID: <595299DD7F30014BBCE48B93DCB60652045A22AB@EXCHAQ2.nhsia.nhs.uk>
To: <www-forms@w3.org>

Dear All,

I am using chiba so possibly the below is some chiba bug but....

We have 2 fields which are concatenated together to form the value of a
3'rd.

i.e

<xforms:bind nodeset="comp_OID" type="oid" calculate="if(../OID_key !=
0, concat(../ISO_Root/text(),'.', ../OID_suffix/text()), text())" />

I have ISO_Root as a drop down e.g.

    <xforms:select1 ref="ISO_Root/text()" appearance="minimal"
class="xfSelect60">
        <xforms:label>ISO Root :</xforms:label>
        <xforms:hint>Where the ISO Root goes</xforms:hint>
        <xforms:item>
            <xforms:label>1.2.826.0.1285.0</xforms:label>
            <xforms:value>1.2.826.0.1285.0</xforms:value>
        </xforms:item>
        <xforms:item>
            <xforms:label>2.16.840.1.113883.2.1</xforms:label>
            <xforms:value>2.16.840.1.113883.2.1</xforms:value>
        </xforms:item>
    </xforms:select1>


& when I change the ISO_Root choice using the drop down the comp_OID
changes /recalculates.

The second field is a simple input & I can not seem to get it to also
call recalculate/calculate when somebody types in a new value.

e.g.

    <xforms:input bind="OID_suffix_id" incremental="true" id="OIDSUFF"
        class="xfInput_60">
        <xforms:label>OID Suffix :</xforms:label>
        <xforms:hint>Where the OID Suffix goes</xforms:hint>
        <xforms:help>Put a valid OID suffix here</xforms:help>
        <xforms:alert>An OID may only consist of numbers separated by
periods (.) and must be unique </xforms:alert>
        <xforms:recalculate ev:event="DOMFocusOut"/>
    </xforms:input>


I have tried

<xforms:recalculate ev:event="xforms-value-changed"/>

& equally nothing happens when I change the value in the input.

does a recalculate event in an input as above just apply to that input &
if so, how do I make it act like the select i.e. a change causes the
form to recalculate?

Also as a side issues.....

Does anyone know how to ensure in a select that only the items in the
select are in the choice list as I always get a blank choice in addition
to the items in the select ?



TIA

Adam

This e-mail is confidential and privileged. If you are not the intended recipient please accept our apologies; please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation.
Received on Friday, 28 July 2006 10:46:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:05 GMT