-
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add jr:choice-name() demo form * Update to latest enketo * Patch enketo to fix jr:choice-name() issue Closes #3487 Closes #3804
- Loading branch information
Showing
18 changed files
with
1,192 additions
and
351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0"?> | ||
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
|
||
<!-- | ||
This form is taken from https://github.com/enketo/enketo-core/issues/412 and | ||
demonstrates how jr:choice-name() can create problems with property updates. | ||
--> | ||
|
||
<h:head> | ||
<h:title>Test Issue 3281</h:title> | ||
<model> | ||
<instance> | ||
<issue-3281 delimiter="#" id="issue_3281" prefix="J1!issue_3281!" version="2017-03-24"> | ||
<input>Default Value</input> | ||
<translator>clinic</translator><output/><debug/> | ||
<note/> | ||
<meta> | ||
<instanceID/> | ||
</meta> | ||
</issue-3281> | ||
</instance> | ||
<bind nodeset="/issue-3281/input" type="string"/> | ||
<bind nodeset="/issue-3281/translator" type="select1"/> | ||
<bind calculate="jr:choice-name( /issue-3281/translator ,' /issue-3281/translator ')" nodeset="/issue-3281/output" type="string"/> | ||
<bind nodeset="/issue-3281/debug" readonly="true()" type="string"/> | ||
<bind nodeset="/issue-3281/note" readonly="true()" type="string"/> | ||
<bind calculate="concat('uuid:', uuid())" nodeset="/issue-3281/meta/instanceID" readonly="true()" type="string"/> | ||
</model> | ||
</h:head> | ||
<h:body> | ||
<input ref="/issue-3281/input"> | ||
<label>Input</label> | ||
</input> | ||
<select1 ref="/issue-3281/translator"> | ||
<label>Translator</label> | ||
<item> | ||
<label>[<output value=" /issue-3281/input "/>] District</label> | ||
<value>district_hospital</value> | ||
</item> | ||
<item> | ||
<label>[<output value=" /issue-3281/input "/>] Health Center</label> | ||
<value>health_center</value> | ||
</item> | ||
<item> | ||
<label>[<output value=" /issue-3281/input "/>] Area</label> | ||
<value>clinic</value> | ||
</item> | ||
</select1> | ||
<input ref="/issue-3281/debug"> | ||
<label>jr:choice-name($ {translator},'$ {translator}') = **<output value=" /issue-3281/output "/>**</label> | ||
</input> | ||
<input ref="/issue-3281/note"> | ||
<label>The value above is stale if _Input_ is changed and you leave the textbox since it modifies the choice label for _Translator_ but not the value. The choice-name function gets updated if the choice value is modified, but should also update if the choice label changes.</label> | ||
</input> | ||
</h:body> | ||
</h:html> |
Oops, something went wrong.