Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8598057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:04:04+00:00 2026-06-12T01:04:04+00:00

I am having problems filtering items using Orbeon XForms. The situation is that I

  • 0

I am having problems filtering items using Orbeon XForms. The situation is that I have a checkbox bound to an instance, the instance is defined as:

<xf:instance id="Include-model">
    <data>
        <value type="xs:string">true</value>
    </data>
</xf:instance>

and the checkbox is declared as:

<xf:select ref="instance('Include-model')/value" selection="closed" appearance="full" >
    <xf:item>
        <xf:label>Include all</xf:label>
        <xf:value>true</xf:value>
    </xf:item>
</xf:select>

So the checkbox is initially checked.

Now I have a list of items in another instance defined as:

<xf:instance id="items-model">
    <Items>
        <Item>
           <value>1</value>
           <status>Show</status>    
        </Item>
        <Item>
           <value>2</value>
           <status>Show</status>    
        </Item>
        <Item>
           <value>3</value>
           <status>Hide</status>    
        </Item>
    </Items>
</xf:instance>

and an associated bind:

<xforms:bind id="items-bind" nodeset="instance('items-model')Items/Item">

These items are displayed in a repeater

<xforms:repeat bind="items-bind" appearance="xxforms:internal">
    .....

What I need is to to be able to filter the items based on the state of the checkbox. If it’s checked then the bind should include all items, if it’s unchecked the bind should contain only the items which have ‘Show’ as a values if their status element.

Please help, and save me what little hair I have left.

TIA

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:04:04+00:00Added an answer on June 12, 2026 at 1:04 am

    First, let’s get rid of a few issues:

    <xforms:bind id="items-bind" nodeset="instance('items-model')Items/Item">
    

    is not a correct XPath expression. Use instead:

    <xforms:bind id="items-bind" nodeset="instance('items-model')/Item">
    

    This points to all items. That’s because instance('items-model') already points to the root element of the instance, so instance('items-model') points to the Items element.

    A second, minor thing: you probably don’t want appearance="xxforms:internal" on the repeat. That is an extension used to tell the XForms engine not to generate HTML markup for a given XForms control. It is not supported on xforms:repeat but it’s better to to clutter the code with it anyway.

    A third thing, also minor: you probably don’t need the type="xs:string" annotation, as by default values are considered as strings.

    Finally, I would not use ids ending with -model for instances. I would use -instance instead. Another minor thing, but it can be a bit confusing. So let’s call them ‘main-instance’ and ‘items-instance’ instead.

    This said, the key is to write an XPath expression to filter the items. Now one issue is that your bind points to all items. So if you refer to your bind with the bind attribute, which just refers to the bind by id, you can’t filter.

    One solution is to use the Orbeon extension function xxf:bind() which allows you to refer to binds from XPath expressions:

    xxf:bind('items-bind')[instance('main-instance')/value = 'true' or status = 'Show']
    

    Your repeat then becomes:

    <xf:repeat ref="xxf:bind('items-bind')[instance('main-instance')/value = 'true' or status = 'Show']">
    

    Here is a complete example that works:

    <xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
            xmlns:xf="http://www.w3.org/2002/xforms"
            xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
            xmlns:ev="http://www.w3.org/2001/xml-events"
            xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xh:head>
            <xf:model>
                <xf:instance id="main-instance">
                    <data>
                        <value>true</value>
                    </data>
                </xf:instance>
                <xf:instance id="items-instance">
                    <Items>
                        <Item>
                            <value>1</value>
                            <status>Show</status>
                        </Item>
                        <Item>
                            <value>2</value>
                            <status>Show</status>
                        </Item>
                        <Item>
                            <value>3</value>
                            <status>Hide</status>
                        </Item>
                    </Items>
                </xf:instance>
                <xf:bind id="items-bind" nodeset="instance('items-instance')/Item"/>
            </xf:model>
        </xh:head>
        <xh:body>
            <xf:select ref="instance('main-instance')/value" appearance="full">
                <xf:item>
                    <xf:label>Include all</xf:label>
                    <xf:value>true</xf:value>
                </xf:item>
            </xf:select>
            <xf:repeat ref="xxf:bind('items-bind')[instance('main-instance')/value = 'true' or status = 'Show']">
                <xh:div>
                    <xf:output value="concat('Value: ', value, ', status: ', status)"/>
                </xh:div>
            </xf:repeat>
        </xh:body>
    </xh:html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've having problems with resource filtering using m2eclipse Maven support in Eclipse. It seems
I'm using jQueryUI AutoComplete but am having a small problem in that no filtering
I'm having problem filtering an NSScrollViews contents using it's date column. I have an
I am having a few problems with Dojo Filtering Selects when using the Zend
I'm having a performance problem with filtering a large NSArray (19k items) for interactive
Im having problems with classpaths. I have used them before with import but I'm
im having problems starting a codeigniter project, the problem is that when i do
I have various database fields that are decrypted using the to_python method. The problem
I am having problem filtering the mousePressEvent with installEventFilter MyTestxEdit is a widget that
I have a Django website that basically just displays a bunch of items from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.