Repeat Grid Refreshing Data

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Repeat Grid Refreshing Data

Joel Oates
Hello all!

I am currently having an issue with a repeating grid that is populating from
data inside my form that gets replaced by a submission. I have some form
data called <workflow-data>  in the main fr-form-instance and inside it I
have data that I am populating my repeating grid.

I am referencing the data for my repeating grid by using the following (from
within my xbl component 'workflow-notes-list')

 <xf:bind id="notes-list-bind"
ref="xxf:binding-context('workflow-notes-list')/root()//*[name() =
'workflow-data']/referral/notes">
   <xf:bind id="note-object-iteration-bind" ref="note">
        <xf:bind id="date-time-bind" ref="date-time"/>
        <xf:bind id="note-bind" ref="content"/>
        <xf:bind id="user-bind" ref="user"/>
    </xf:bind>
 </xf:bind>

And then I am using this binding in the repeating grid

<fr:grid id="activity-list-grid" ref="bind('notes-list-bind')"
repeat="content" min="0" appearance="minimal" readonly="true">

This all works fine. Now my issue is that I am repopulating the
*workflow-data* object with new data, however the repeating grid does not
reflect the changes to the workflow-data.


I have tried using fr:synchronize-repeated-content without any success, My
attempt:

<fr:synchronize-repeated-content left="activity-list-grid"
                               
right="xxf:binding-context('workflow-notes-list')/root()//*[name() =
'workflow-data']/referral/notes"
                                 version="2018.2">
    <fr:map left="content" right="content"/>
    <fr:map left="flag" right="flag"/>
</fr:synchronize-repeated-content>

Any clues on how do solve this issue?

Thanks for your time!
Joel.




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

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574838413273-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Repeat Grid Refreshing Data

Erik Bruchez
Administrator
Joel,

I would compare the XML of the data before and after the submission. Does
the structure look the same? Can you share the before/after data?

`fr:synchronize-repeated-content` will only work to synchronize repeated
grids and sections using control names (so `xxf:binding()` will certainly
not work here). In any case, I don't think that
`fr:synchronize-repeated-content` is relevant to this issue.

-Erik

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

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574898055511-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Repeat Grid Refreshing Data

Joel Oates
Hello Erik,

I had compared the data before and after, here is my spinet (As its quite a
large structure) of the notes object in question.


Here it shows the initial notes (that already existed)
<http://discuss.orbeon.com/file/t375722/display-exsisting-note.png>


I do an update and refresh all the data in the page (removing it and
inserting the updated data back in), and the repeating grid is not showing
the updated data.
<http://discuss.orbeon.com/file/t375722/no-update-from-exsisting-note.png>

To show that its displaying multiple entries properly, I refreash the page
when the twoo notes are already there, and it displays both of them
correctly.
<http://discuss.orbeon.com/file/t375722/after-reload-snows-correctly.png>

The display of these notes are in their own xbl, and the binding and grid
are in the above post.

Thanks for your time, just a little lost why these bindings are not being
refreshed(?)..

Joel.






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

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574982120756-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Repeat Grid Refreshing Data

Erik Bruchez
Administrator
Joel,

Unfortunately I don't have an idea. The best would be for us to be able to
to have reproducible case we can run locally.

-Erik

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

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1575312393766-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Repeat Grid Refreshing Data

Joel Oates
Hello Erik,

I have reproduced it in a small test case.


I have the following XBL

test-repeat.xbl <http://discuss.orbeon.com/file/t375722/test-repeat.xbl>  

So here I have a *binding* to a list of data in the main form.

<xf:bind id="list-bind"
ref="xxf:binding-context('workflow-test-repeat')/root()//*[name() =
'form-data']/list">
    <xf:bind id="tmp-iteration-bind" ref="node">
        <xf:bind id="data-bind" ref="data"/>
    </xf:bind>
</xf:bind>

and I have the trigger in my xbl that changes the data in the main form with
delete and insert.. (Here I noticed that even deleting the data had no
effect to the repeating grid)

<xf:trigger id="replace-form-data">
    <xf:label value="'Replace List'"/>
    <xf:action event="DOMActivate">
        <xf:delete
ref="xxf:binding-context('workflow-test-repeat')/root()//*[name() =
'form-data']/*"/>
        <xf:insert
context="xxf:binding-context('workflow-test-repeat')/root()//*[name() =
'form-data']" origin="instance('template-data')/*"/>
    </xf:action>
</xf:trigger>

Using this xbl I have the following form.


<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:ev="http://www.w3.org/2001/xml-events"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
         xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
         xmlns:map="http://www.w3.org/2005/xpath-functions/map"
         xmlns:array="http://www.w3.org/2005/xpath-functions/array"
         xmlns:exf="http://www.exforms.org/exf/1-0"
         xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
         xmlns:saxon="http://saxon.sf.net/"
         xmlns:sql="http://orbeon.org/oxf/xml/sql"
         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
    <xh:head>
        <xh:title>Test Repeater</xh:title>
        <xf:model id="fr-form-model" xxf:expose-xpath-types="true"
xxf:analysis.calculate="true">

           
            <xf:instance id="fr-form-instance"
xxf:exclude-result-prefixes="#all" xxf:index="id">
                <form>
                    <section-1>
                        <test-repeating-control/>
                       
                        <form-data>
                            <list>
                                <node>
                                    <data>node1</data>
                                </node>
                                <node>
                                    <data>node2</data>
                                </node>
                                <node>
                                    <data>node3</data>
                                </node>
                            </list>
                        </form-data>
                    </section-1>
                </form>
            </xf:instance>

           
            <xf:bind id="fr-form-binds" ref="instance('fr-form-instance')">
                <xf:bind id="section-1-bind" name="section-1"
ref="section-1">
                    <xf:bind id="test-repeating-control-bind"
ref="test-repeating-control"
                             name="test-repeating-control"/>
                   
                   
                </xf:bind>
            </xf:bind>

           
            <xf:instance id="fr-form-metadata" xxf:readonly="true"
xxf:exclude-result-prefixes="#all">
                <metadata>
                    <application-name>test-repeater</application-name>
                    <form-name>test-repeater</form-name>
                    <title xml:lang="en">Test Repeater</title>
                    <description xml:lang="en"/>
                    <created-with-version>2018.2.2.201903012338
PE</created-with-version>
                </metadata>
            </xf:instance>

           
            <xf:instance id="fr-form-attachments"
xxf:exclude-result-prefixes="#all">
                <attachments/>
            </xf:instance>

           
            <xf:instance xxf:readonly="true" id="fr-form-resources"
xxf:exclude-result-prefixes="#all">
                <resources>
                    <resource xml:lang="en">
                        <test-repeating-control>
                            <label/>
                            <hint/>
                        </test-repeating-control>
                        <section-1>
                            <label>Test Repeating Grid</label>
                        </section-1>
                       
                       
                    </resource>
                </resources>
            </xf:instance>

        </xf:model>
    </xh:head>
    <xh:body>
        <fr:view>
            <fr:body xmlns:p="http://www.orbeon.com/oxf/pipeline"
                     xmlns:oxf="http://www.orbeon.com/oxf/processors"
                     xmlns:xbl="http://www.w3.org/ns/xbl">
                <fr:section id="section-1-section" bind="section-1-bind">
                    <xf:label ref="$form-resources/section-1/label"/>
                    <fr:grid id="grid-1-grid">
                        <fr:c y="1" x="1" w="12">
                            <workflow:test-repeat
xmlns:workflow="http://www.infomedix.com.au/workflow"
                                                 
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
                                                 
xmlns:frext="http://orbeon.org/oxf/xml/form-runner/extended"
                                                 
id="test-repeating-control-control"
                                                 
bind="test-repeating-control-bind"
                                                 
class="common_css_class_for_xbl">
                                <xf:label
ref="$form-resources/test-repeating-control/label"/>
                                <xf:hint
ref="$form-resources/test-repeating-control/hint"/>
                                <xf:alert
ref="$fr-resources/detail/labels/alert"/>
                   
                               
                            </workflow:test-repeat>
                               
                            </fr:c>
                       
                    </fr:grid>
                </fr:section>
                         <fr:xforms-inspector/>
            </fr:body>
        </fr:view>
    </xh:body>
</xh:html>


When I do this the repeating grid does not change with the data.


Now I have found a way around this issue which is not that desirable. I use
xxbl:mirror and i make the binding of my xbl control to the data that gets
inserted into the form, and then create my repeating grid of the mirror
instance.

Thanks again for your time, Hope that all makes sense, if not can clarify.

Joel.

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

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1575418006377-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Repeat Grid Refreshing Data

Joel Oates
I'll post my work around as well


Here is the xbl

test-repeat.xbl <http://discuss.orbeon.com/file/t375722/test-repeat.xbl>  

Here is the form

<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:ev="http://www.w3.org/2001/xml-events"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
         xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
         xmlns:map="http://www.w3.org/2005/xpath-functions/map"
         xmlns:array="http://www.w3.org/2005/xpath-functions/array"
         xmlns:exf="http://www.exforms.org/exf/1-0"
         xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
         xmlns:saxon="http://saxon.sf.net/"
         xmlns:sql="http://orbeon.org/oxf/xml/sql"
         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
    <xh:head>
        <xh:title>Test Repeater</xh:title>
        <xf:model id="fr-form-model" xxf:expose-xpath-types="true"
xxf:analysis.calculate="true">

           
            <xf:instance id="fr-form-instance"
xxf:exclude-result-prefixes="#all" xxf:index="id">
                <form>
                    <section-1>
                        <test-repeating-control/>
                       
                        <form-data>
                            <list>
                                <node>
                                    <data>node1</data>
                                </node>
                                <node>
                                    <data>node2</data>
                                </node>
                                <node>
                                    <data>node3</data>
                                </node>
                            </list>
                        </form-data>
                    </section-1>
                </form>
            </xf:instance>

           
            <xf:bind id="fr-form-binds" ref="instance('fr-form-instance')">
                <xf:bind id="section-1-bind" name="section-1"
ref="section-1">
                    <xf:bind id="test-repeating-control-bind"
ref="form-data" name="test-repeating-control"/>
                   
                   
                </xf:bind>
            </xf:bind>

           
            <xf:instance id="fr-form-metadata" xxf:readonly="true"
xxf:exclude-result-prefixes="#all">
                <metadata>
                    <application-name>test-repeater</application-name>
                    <form-name>test-repeater</form-name>
                    <title xml:lang="en">Test Repeater</title>
                    <description xml:lang="en"/>
                    <created-with-version>2018.2.2.201903012338
PE</created-with-version>
                </metadata>
            </xf:instance>

           
            <xf:instance id="fr-form-attachments"
xxf:exclude-result-prefixes="#all">
                <attachments/>
            </xf:instance>

           
            <xf:instance xxf:readonly="true" id="fr-form-resources"
xxf:exclude-result-prefixes="#all">
                <resources>
                    <resource xml:lang="en">
                        <test-repeating-control>
                            <label/>
                            <hint/>
                        </test-repeating-control>
                        <section-1>
                            <label>Test Repeating Grid</label>
                        </section-1>
                       
                       
                    </resource>
                </resources>
            </xf:instance>

        </xf:model>
    </xh:head>
    <xh:body>
        <fr:view>
            <fr:body xmlns:p="http://www.orbeon.com/oxf/pipeline"
                     xmlns:oxf="http://www.orbeon.com/oxf/processors"
                     xmlns:xbl="http://www.w3.org/ns/xbl">
                <fr:section id="section-1-section" bind="section-1-bind">
                    <xf:label ref="$form-resources/section-1/label"/>
                    <fr:grid id="grid-1-grid">
                        <fr:c y="1" x="1" w="12">
                            <workflow:test-repeat
xmlns:workflow="http://www.infomedix.com.au/workflow"
                                                 
xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
                                                 
xmlns:frext="http://orbeon.org/oxf/xml/form-runner/extended"
                                                 
id="test-repeating-control-control"
                                                 
bind="test-repeating-control-bind"
                                                 
class="common_css_class_for_xbl">
                                <xf:label
ref="$form-resources/test-repeating-control/label"/>
                                <xf:hint
ref="$form-resources/test-repeating-control/hint"/>
                                <xf:alert
ref="$fr-resources/detail/labels/alert"/>
                   
                               
                            </workflow:test-repeat>
                               
                            </fr:c>
                       
                    </fr:grid>
                </fr:section>
                         <fr:xforms-inspector/>
            </fr:body>
        </fr:view>
    </xh:body>
</xh:html>


Hope this helps ;)

Joel

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

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1575418479799-0.post%40n4.nabble.com.