W3C home > Mailing lists > Public > www-forms@w3.org > November 2005

RE: @number attribute on xforms:repeat

From: Robert Bull <rob.bull@blackdog.co.uk>
Date: Tue, 29 Nov 2005 21:25:39 -0000
To: "Peter Nunn" <peter.nunn@vistic.net>
Cc: <www-forms@w3.org>
Message-ID: <HGEBLDGAEJLFJAEBFHFAGEPMCIAA.rob.bull@blackdog.co.uk>


I'm actually using FormsPlayer to display a repeat within a switch, so when
I hit a "lookup" button/trigger, it toggles the repeat into view.

The repeat nodeset is based on another input in the form, of the format

<xf:repeat
nodeset="instance('data')/lookup/item[@filterby=instance('data')/filtervalue
]"

The initial value of instance('data')/filtervalue filters the nodeset based
on the attribute filtervalue, what I hoped to do was change this filtervalue
with an input, so the filtered list reduces as the user types. I suppose
what I need is along the lines of

<xf:repeat nodeset="instance('data')/lookup/item[@filterby *like*
instance('data')/filtervalue*]"

so if filteralue is empty the whole list displays, if the user types (say)
an "s" only the nodes where the @filterby value begins with "s" are
displayed, and so on.

If the values displayed contain the complete value that the user wants, he
or she can click the value in the repeat, and I can use a setvalue to
complete their input and toggle the repeat out of view again. Voila. Problem
is of course that *like* doesn't exist in xPath )c:

I'm sure it can be done somehow, if so I'll find a way, if not I'll have to
find another way (c:

RR


-----Original Message-----
From: www-forms-request@w3.org [mailto:www-forms-request@w3.org]On
Behalf Of Peter Nunn
Sent: 29 November 2005 20:52
To: Robert Bull
Cc: www-forms@w3.org
Subject: Re: @number attribute on xforms:repeat



Robert Bull wrote:
> Excited by this thread (c:, I have been trying to create a form that uses
a
> repeat as a look up list, ie gradually filtering the xPath expression that
> the repeat is based on according to user input.
>
> I'm trying to create a nodeset with an expression similar to a SQL "Like",
> and change the like as the instance data changes during data entry; am I
> going too far out of the xForms box here?
>
> Rob
>
>
No I would say that what you are trying to do is exactly inside the
xforms box.  I assume you are using a relevant on a nodeset so that the
nodes are made not relevant based on your xpath expression.  I know this
should work in the Mozilla world as the xpath support is very good,
other browsers may have trouble with complex xpath expressions,
depending on their level of compliance with the specs.

regards
Received on Tuesday, 29 November 2005 21:25:43 GMT

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