kobotoolbox / enketo-express

We've moved! Please use the new repository 🠊 https://github.com/enketo/enketo-express
Apache License 2.0
102 stars 90 forks source link

Incorrect behavior with Pages Theme form that only has one page #842

Closed pbowen-oc closed 7 years ago

pbowen-oc commented 7 years ago

I have a test form that only has one element (inside a non-repeating group) and is defined to use Pages Theme. Opening the form in Edit or View mode shows page navigation buttons (Next, Return to Beginning, Go to End) that should not be there. Note that they don't do anything. Also, the form should have a Complete button in Edit mode, but it is not appearing.

I thought we had addressed this issue before, but this might be a different case.

widgets_on_pages_TEST 2.xlsx

MartijnR commented 7 years ago
curl --user enketorules: -d "server_url=https://api.ona.io/enketo&form_id=widgets_on_pages_TEST&instance=<widgets_on_pages_TEST/>&instance_id=a" http://localhost:8005/ai/v2/instance/view/iframe

curl --user enketorules: -d "server_url=https://api.ona.io/enketo&form_id=widgets_on_pages_TEST&instance=<widgets_on_pages_TEST/>&instance_id=a" http://localhost:8005/ai/v2/instance/fieldsubmission/iframe

The First/Last buttons are by design always visible in pages mode. They only have disabled and enabled states.

I don't see the Next button with the test XLSForm. My guess is that this is related to how dn questions are inserted (there is some hidden second page or something). Probably same issue with Complete button. So I'd need the XForm to reproduce.

pbowen-oc commented 7 years ago
<?xml version="1.0" encoding="UTF-8" standalone="no"?><h:html xmlns="http://www.w3.org/2002/xforms" xmlns:enk="http://enketo.org/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:oc="http://openclinica.org/xforms" xmlns:orx="http://openrosa.org/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<h:head>
<h:title>Widgets on Pages</h:title>
<model>
<instance>
<widgets_on_pages_TEST_2 id="widgets_on_pages" version="1">
<display_widgets>
<eSignature/>
<eSignature_comment oc:queryParent="eSignature"/></display_widgets>
<meta>
<instanceID/>
<instanceID_comment oc:queryParent="instanceID"/></meta>
</widgets_on_pages_TEST_2>
</instance>
<bind nodeset="/widgets_on_pages_TEST_2/display_widgets/eSignature" oc:itemgroup="group1" type="binary"/>
<bind calculate="concat('uuid:', uuid())" nodeset="/widgets_on_pages_TEST_2/meta/instanceID" readonly="true()" type="string"/>
<bind enk:for="/widgets_on_pages_TEST_2/display_widgets/eSignature" nodeset="/widgets_on_pages_TEST_2/display_widgets/eSignature_comment" type="string"/><instance id="_users" src="jr://file-csv/users.xml"/></model>
</h:head>
<h:body class="pages">
<group ref="/widgets_on_pages_TEST_2/display_widgets">
<label>Display widgets</label>
<upload appearance="signature" mediatype="image/*" ref="/widgets_on_pages_TEST_2/display_widgets/eSignature">
<label>Testing eSignature</label>
</upload>
<input appearance="dn w1" ref="/widgets_on_pages_TEST_2/display_widgets/eSignature_comment"><label>Comment:</label></input></group>
</h:body>
</h:html>
MartijnR commented 7 years ago
http://localhost:8005/view/i/::e9809c9a1192bcd6a0262b03296b2d4e?instance_id=a
curl --user enketorules: -d "server_url=https://enketo-aggregate.appspot.com&form_id=widgets_on_pages&instance=<widgets_on_pages_TEST_2/>&instance_id=a" http://localhos:8005/api/v2/survey/single/fieldsubmission/iframe

For some reason the dn widget gets initialized after the pages module

MartijnR commented 7 years ago

Turns out another "pages" fix made in Enketo Core last week fixed this too. I upgraded EE-oc slightly.

fd14d5ef25876a29e5157dba7faebee740bd24bc