Append a value to the dropdown

11 views
Skip to first unread message

Mani

unread,
Apr 17, 2020, 3:48:59 AM4/17/20
to Orbeon Forms
Hi Alex - I'm using a rest api to populate a drop-down and would like to append an additional static value. Did not want pollute the original dataset. Can you please suggest a solution to append on the orbeon fr side?

Json returned by the rest service

{
  "success": true,
  "message": "Retrieved 251 countries.",
  "countryList": {
    "countries": [
      {
        "code": "AF",
        "name": "Afghanistan"
      },
      {
        "code": "AL",
        "name": "Albania"
      },
      {
        "code": "DZ",
        "name": "Algeria"
      }
    ]
  }
}

Need to append the below value 

 {
        "code": "OT",
        "name": "Other"
      }

Joel Oates

unread,
Apr 17, 2020, 9:49:19 PM4/17/20
to orb...@googlegroups.com
Hi mbojja,

I've had a similar issue where I wanted a default or 'other' inside my
databound-select1, I Achieved it by adding an additional itemset inside the
databound-select1.

Here is my example:

<fr:databound-select1 xmlns="http://orbeon.org/oxf/xml/form-builder"
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
id="control-2-control"
appearance="minimal"
resource="http://localhost:8080/somelistofstuff"
bind="control-2-bind">
<xf:label ref="$form-resources/control-2/label"/>
<xf:hint ref="$form-resources/control-2/hint"/>
<xf:alert ref="$fr-resources/detail/labels/alert"/>
<xf:itemset ref="list-summary">
<xf:label ref="list-name"/>
<xf:value ref="list-value"/>
</xf:itemset>
<xf:itemset ref="'othervalue'">
<xf:label ref="'other'"/>
<xf:value ref="'other'"/>
</xf:itemset>
</fr:databound-select1>

I hope this helps!

Joel.

--
Sent from: http://discuss.orbeon.com/

durk polish

unread,
Apr 22, 2020, 1:48:48 AM4/22/20
to Orbeon Forms
there is alot of application in which they get alot of memory in your mobile so here is an getting unlimited coins for you any games with in very small memory so if you want to download click this link GameCIH APK

Reply all
Reply to author
Forward
0 new messages