Display warning message while opening a form for editing.

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

Display warning message while opening a form for editing.

spanithi
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

Alessandro  Vernet
Administrator
Hi Satish,

You should be able to do this by writing your own XForms logic, in a custom
model, which on `xforms-ready`, if in edit mode and if the status is
"submitted" shows that dialog.

You can use the `oxf.fr.detail.model.custom.*.*` property to "inject" that
logic into your form. However, doing the same for the dialog itself requires
`oxf.fr.detail.dialogs.custom.*.*` which will come in 2017.2. In the
meantime, I imagine that you can prototype this by adding the dialog to the
source of the form, editing the source in Form Builder.

https://doc.orbeon.com/form-runner/advanced/custom.html

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
Hello Alex,

Thank you for your inputs as mentioned created a XForms logic, in a custom
model, which on `xforms-ready` showing the dialog box.

By default it is showing only close button in the dialog box.
Is there a way to add custom buttons to this dialog box like I want to give choice to user YES or NO.
Yes would edit the form No will revert back to summary page.

Any inputs would be really helpful.

Once again thanks for your inputs

Satish

On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
Alex , In short I would like to add confirm kind of message with Yes or No options .
I am trying to add a dialog but that is not working.

Thanks,
Satish

On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

Alessandro  Vernet
Administrator
Hi Satish,

How are you showing that dialog with the "close" button you are referring
to?

Once 2017.2 is out, I'd recommend you define that dialog in your own file,
and point to that file with `oxf.fr.detail.dialogs.custom.*.*`. This way,
you'll be able to do whatever you want in the dialog. Until then, for
testing, I imagine that you could add the code for the dialog to the source
of the form, by using Edit Source in Form Builder.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
Hi Alex,

This is what I am doing now, created a new custom model xforms with the below

<xf:model xmlns:xf="http://www.w3.org/2002/xforms">
<xf:message event="xforms-ready">
Editing this form will revert the Status to In Progress, are you sure you want to proceed?
<xf:output  value="concat('Yes No, ', instance()//Status, '!')"/>                  
</xf:message>
</xf:model>

The above is displaying an message while opening the form , but it a plain message which has a close button displayed.
Instead I want to display an message or alert or dialog with Yes or No buttons like inform users of something that happened, or ask a question which can be answered by a yes or a no .

Hope I am making sense.






On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

Alessandro  Vernet
Administrator
Got it Satish. Indeed `<xf:message>` just shows a message. For this, you'll
need to declare a real `<xxf:dialog>`. You can find some hints on how to do
this with 2017.2:

https://gist.github.com/avernet/ab887bccf7f366d56a0cca3182ee760b

I imagine you could do something similar with 2017.1 by putting the dialog
in the form, but since 2017.2 is just around the corner, I'd recommend you
wait for that release.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
Hello Alex,

I did tried doing this using a dialog  by editing the form itself instead of custom Xforms
Below is the dialog .
<xxf:dialog id="my-dialog-id" appearance="full | minimal" level="modeless" close="true"
                            draggable="true"
                            visible="true">

                Editing this form will revert the Status to In Progress, are you sure you want to proceed?

                                <xh:div class="fr-dialog-buttons">
                        <xf:group>
                            <xxf:show event="DOMActivate" dialog="my-dialog-id"/>
                           
                            <xf:trigger>
                                <xf:label>Yes</xf:label>
                                <xxf:show event="DOMActivate" dialog="my-dialog-id"/>                
                            </xf:trigger>
                           
                            <xf:trigger>
                                <xf:label>No</xf:label>
                                <xxf:hide event="DOMActivate" dialog="my-dialog-id"/>
                            </xf:trigger>
                         
                        </xf:group>
                    </xh:div>
                </xxf:dialog>

Could you please help me in how can I trigger some action or bind some actions to Yes and No buttons on the dialog box
1. Click 'Yes' I would like to update my hidden field
2. Click 'No' it should close the form and redirect to summary page.

Any inputs would be really helpful.

-Satish

On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

Alessandro  Vernet
Administrator
First Satish, is your dialog showing? Once it does, inside the dialog, inside
the relevant trigger (yes or no), you would put the XForms actions
performing what you need to do. If you're unfamiliar with XForms actions, or
XForms in general, a good way to familiarize yourself with it is to go
through the XForms tutorial. You'll find the different sections of the
tutorial linked from the sidebar of the documentation:
https://doc.orbeon.com/.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
Alex, the dialog is appearing without any issues. When I click on Yes I was able to change the status from submitted to in-progress.This is perfectly fine

My only concern is to display this dialog box in form -edit mode only and when status is 'Submitted'. only
Right now the dialog is visible when I am trying to create new form also but I want to restrict this for edit mode only. Could you please let me know how to check the form is in edit or new and also how to check the status.
For managing the status I am using an hidden field 'Status'

Any inputs?

Thanks,
Satish

On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
And also one more thing, can I use xf:send or xf:submission to navigate between the pages i.e if No is clicked then I want to navigate to summary page for this which event I need to use? I am bit confused on xf:send or xf:submission . In first place can I use these xforms actions to navigate?

satish

On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
I was able to navigate using the below. When I clicked No option in the dialog message

  <xf:trigger xxf:modal="true">
                                                    <xf:label>No</xf:label>
                                                    <xf:action event="DOMActivate">
                                                             <xf:load event="xforms-submit-done" resource="/fr/orbeon/SHFProductProfile/summary"
                                                             show="replace"/>
                                                     
                                                    </xf:action>
                                                </xf:trigger>

But my other issue is still outstanding where I am trying to display or restrict the dialog only while form is in edit mode and when status is Submitted/Approved.
Any help please?

Thanks,
Satish

On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
Alex ,

Below is the full form xml


<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: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"
         fr:data-format-version="4.0.0">
    <xh:head>
        <xh:title>SHFProductProfileForm</xh:title>
        <xf:model id="fr-form-model" xxf:expose-xpath-types="true">
           
            <!-- Main instance -->
            <xf:instance id="fr-form-instance" xxf:exclude-result-prefixes="#all" xxf:index="id">
                <form>
                    <section-1>
                        <SHFCategory/>
                        <Status>In Progress</Status>
                        <Comments/>
                    </section-1>
                </form>
            </xf:instance>

            <!-- Bindings -->
            <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="SHFCategory-bind" name="SHFCategory" ref="SHFCategory"
                             xxf:whitespace="trim"/>
                    <xf:bind id="Status-bind" ref="Status" name="Status" xxf:whitespace="trim"
                             relevant="visibility=false()"/>
                    <xf:bind id="Comments-bind" ref="Comments" name="Comments"
                             readonly="xxf:user-roles() = 'shf-owner'"/>
                </xf:bind>
            </xf:bind>

            <!-- Metadata -->
            <xf:instance xxf:readonly="true" id="fr-form-metadata" xxf:exclude-result-prefixes="#all">
                <metadata>
                    <application-name>orbeon</application-name>
                    <form-name>SHFProductProfile</form-name>
                    <title xml:lang="en">SHFProductProfileForm</title>
                    <description xml:lang="en">SHFProductProfileForm Description</description>
                </metadata>
            </xf:instance>

            <!-- Attachments -->
            <xf:instance id="fr-form-attachments" xxf:exclude-result-prefixes="#all">
                <attachments>
                    <css mediatype="text/css" filename="" size=""/>
                    <pdf mediatype="application/pdf" filename="" size=""/>
                </attachments>
            </xf:instance>

            <!-- All form resources -->
            <xf:instance xxf:readonly="true" id="fr-form-resources" xxf:exclude-result-prefixes="#all">
                <resources>
                    <resource xml:lang="en">
                        <section-1>
                            <label>SHF Product Profile </label>
                        </section-1>
                        <SHFCategory>
                            <label>SHF Category</label>
                            <hint/>
                           
                        </SHFCategory>
                        <Status>
                            <label>Status</label>
                            <hint/>
                        </Status>
                        <Comments>
                            <label>Review Comments</label>
                            <hint/>
                        </Comments>
                    </resource>
                </resources>
            </xf:instance>        
            
             
           
        </xf:model>
    </xh:head>
    <xh:body>   
        <fr:view>
            <fr:body xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xbl="http://www.w3.org/ns/xbl"
                     xmlns:oxf="http://www.orbeon.com/oxf/processors">                  
                        
                      
                <fr:section id="section-1-control" bind="section-1-bind">
                    <xf:label ref="$form-resources/section-1/label"/>
                    <fr:grid>
                        <xh:tr>
                            <xh:td>
                                <xf:input id="SHFCategory-control" bind="SHFCategory-bind">
                                    <xf:label ref="$form-resources/SHFCategory/label"/>
                                    <xf:hint ref="$form-resources/SHFCategory/hint"/>
                                    <xf:alert ref="$fr-resources/detail/labels/alert"/>
                                   
                                </xf:input>
                            </xh:td>
                            <xh:td>
                                <xf:input id="Status-control" bind="Status-bind" class="fr-summary">
                                    <xf:label ref="$form-resources/Status/label"/>
                                    <xf:hint ref="$form-resources/Status/hint"/>
                                    <xf:alert ref="$fr-resources/detail/labels/alert"/>                      
                       
                                </xf:input>
                            </xh:td>
                           <xh:td>
                              
                                <xxf:dialog id="my-dialog-id" appearance="minimal" level="modal" close="true"
                                            draggable="true"
                                            visible="true">
                                           
                                                                                              
Editing this form will revert the Status to In Progress, are you sure you want to proceed?
                                    <xh:div class="fr-dialog-buttons">
                                            <xf:group> 
                                               
                                                <xf:trigger>
                                                    <xf:label>Yes</xf:label>
                                                     <xf:action event="DOMActivate">
                                                        <xf:setvalue event="DOMActivate" ref="//Status" value="'In Progress'"/>  
                                                    </xf:action>                                         
                                                    <xxf:hide event="DOMActivate" dialog="my-dialog-id"/>
                                                   
                                                </xf:trigger>
                           
                                                <xf:trigger xxf:modal="true">
                                                    <xf:label>No</xf:label>
                                                    <xf:action event="DOMActivate">
                                                             <xf:load event="xforms-submit-done" resource="/fr/orbeon/SHFProductProfile/summary"
                                                             show="replace"/>                                                     
                                                    </xf:action>
                                                </xf:trigger>                         
                         
                                            </xf:group>
                                        </xh:div>
                                    </xxf:dialog>                    
                            </xh:td>
                        </xh:tr>
                        <xh:tr>
                            <xh:td>
                                <fr:tinymce xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
                                            xmlns:f="http://orbeon.org/oxf/xml/formatting"
                                            id="Comments-control"
                                            bind="Comments-bind">
                                    <xf:label ref="$form-resources/Comments/label"/>
                                    <xf:hint ref="$form-resources/Comments/hint"/>
                                    <xf:alert ref="$fr-resources/detail/labels/alert"/>
                       
                       
                                </fr:tinymce>
                            </xh:td>
                            <xh:td/>
                        </xh:tr>
                    </fr:grid>
                </fr:section>
            </fr:body>
        </fr:view>
    </xh:body>
</xh:html>

Any inputs on how to show this dialog only in form edit mode  and when status is Submitted/Approved ?


Thanks,
Satish

On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

Alessandro  Vernet
Administrator
Hi Satish,

About only showing the dialog when you're in edit mode, in XPath you should
be able to use `fr:mode() = 'edit'`. About `xf:send` vs. `xf:submission`, in
general both are needed: you declare a submission with `xf:submission` in
the mode, and you "execute" it with the `xf:send` action.

https://doc.orbeon.com/xforms/xpath/extension-form-runner.html#frmode

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
Alex,

Thank you for your response.
I am aware of fr-mode='edit' but could you please let me know where should I declare this XPATH i mean in which part of the code i need to add `fr:mode() = 'edit'` ?

Regards,
Satish


On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

Alessandro  Vernet
Administrator
Hi Satish,

You should add the test in the same place you are triggering the dialog to
displayed. Where are you doing this? Is it part of a process? In which case,
you'll want to use a condition (`if`) in your process.

https://doc.orbeon.com/form-runner/advanced/buttons-and-processes/syntax.html

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
Hello Alex,

I am not doing this in the process

Below is the form xml and the dialog . I added the dialog under the <fr:body> element , how can i write the test here?

<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: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"
         fr:data-format-version="4.0.0">
    <xh:head>
        <xh:title>SHFProductProfileForm</xh:title>
        <xf:model id="fr-form-model" xxf:expose-xpath-types="true">
           
            <!-- Main instance -->
            <xf:instance id="fr-form-instance" xxf:exclude-result-prefixes="#all" xxf:index="id">
                <form>
                    <section-1>
                        <SHFCategory/>
                        <Status>In Progress</Status>
                        <Comments/>
                    </section-1>
                </form>
            </xf:instance>

            <!-- Bindings -->
            <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="SHFCategory-bind" name="SHFCategory" ref="SHFCategory"
                             xxf:whitespace="trim"/>
                    <xf:bind id="Status-bind" ref="Status" name="Status" xxf:whitespace="trim"
                             relevant="visibility=false()"/>
                    <xf:bind id="Comments-bind" ref="Comments" name="Comments"
                             readonly="xxf:user-roles() = 'shf-owner'"/>                   
                </xf:bind>
            </xf:bind>

            <!-- Metadata -->
            <xf:instance xxf:readonly="true" id="fr-form-metadata" xxf:exclude-result-prefixes="#all">
                <metadata>
                    <application-name>orbeon</application-name>
                    <form-name>SHFProductProfile</form-name>
                    <title xml:lang="en">SHFProductProfileForm</title>
                    <description xml:lang="en">SHFProductProfileForm Description</description>
                </metadata>
            </xf:instance>

            <!-- Attachments -->
            <xf:instance id="fr-form-attachments" xxf:exclude-result-prefixes="#all">
                <attachments>
                    <css mediatype="text/css" filename="" size=""/>
                    <pdf mediatype="application/pdf" filename="" size=""/>
                </attachments>
            </xf:instance>

            <!-- All form resources -->
            <xf:instance xxf:readonly="true" id="fr-form-resources" xxf:exclude-result-prefixes="#all">
                <resources>
                    <resource xml:lang="en">
                        <section-1>
                            <label>SHF Product Profile </label>
                        </section-1>
                        <SHFCategory>
                            <label>SHF Category</label>
                            <hint/>
                           
                        </SHFCategory>
                        <Status>
                            <label>Status</label>
                            <hint/>
                        </Status>
                        <Comments>
                            <label>Review Comments</label>
                            <hint/>
                        </Comments>
                    </resource>
                </resources>
            </xf:instance>        
            
             
           
        </xf:model>
    </xh:head>
    <xh:body>   
        <fr:view>
            <fr:body xmlns:xbl="http://www.w3.org/ns/xbl" xmlns:p="http://www.orbeon.com/oxf/pipeline"
                     xmlns:oxf="http://www.orbeon.com/oxf/processors">                  
                        
                      
                <fr:section id="section-1-control" bind="section-1-bind">
                    <xf:label ref="$form-resources/section-1/label"/>
                    <fr:grid>
                        <xh:tr>
                            <xh:td>
                                <xf:input id="SHFCategory-control" bind="SHFCategory-bind">
                                    <xf:label ref="$form-resources/SHFCategory/label"/>
                                    <xf:hint ref="$form-resources/SHFCategory/hint"/>
                                    <xf:alert ref="$fr-resources/detail/labels/alert"/>
                                   
                                </xf:input>
                            </xh:td>
                            <xh:td>
                                <xf:input id="Status-control" bind="Status-bind" class="fr-summary">
                                    <xf:label ref="$form-resources/Status/label"/>
                                    <xf:hint ref="$form-resources/Status/hint"/>
                                    <xf:alert ref="$fr-resources/detail/labels/alert"/>                      
                       
                                </xf:input>
                            </xh:td>
                           <xh:td>
                            
                                    <xxf:dialog id="my-dialog-id" appearance="minimal" level="modal" close="true"
                                            draggable="true"
                                            visible="true">
                                                                                                                                           
                                                <xh:div>                                                                                         
Editing this form will revert the Status to In Progress, are you sure you want to proceed?
                                                </xh:div>
                                               
                                    <xh:div class="fr-dialog-buttons">                                       
                                            <xf:group> 
                                              
                                                <xf:trigger>
                                                    <xf:label>Yes</xf:label>                                                    
                                                     <xf:action event="DOMActivate">
                                                        <xf:setvalue event="DOMActivate" ref="//Status" value="'In Progress'"/>  
                                                    </xf:action>                                         
                                                    <xxf:hide event="DOMActivate" dialog="my-dialog-id"/>
                                                   
                                                </xf:trigger>
                           
                                                <xf:trigger xxf:modal="true">
                                                    <xf:label>No</xf:label>
                                                    <xf:action event="DOMActivate">
                                                             <xf:load event="xforms-submit-done" resource="/fr/orbeon/SHFProductProfile/summary"
                                                             show="replace"/>                                                     
                                                    </xf:action>
                                                </xf:trigger>                                        
                                            </xf:group>
                                        </xh:div>                                        
                                    </xxf:dialog>

                              
                            </xh:td>
                           
                        </xh:tr>
                        <xh:tr>
                            <xh:td>
                                <fr:tinymce xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
                                            xmlns:f="http://orbeon.org/oxf/xml/formatting"
                                            id="Comments-control"
                                            bind="Comments-bind">
                                    <xf:label ref="$form-resources/Comments/label"/>
                                    <xf:hint ref="$form-resources/Comments/hint"/>
                                    <xf:alert ref="$fr-resources/detail/labels/alert"/>
                       
                       
                                </fr:tinymce>
                            </xh:td>
                            <xh:td/>
                        </xh:tr>
                    </fr:grid>
                </fr:section>
            </fr:body>
        </fr:view>
    </xh:body>
</xh:html>

On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
I mean to say this is not part of process. I edited the form source and added the xxf:dialog

Satish
 

On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

spanithi
In reply to this post by spanithi
Alex, Any hints on how we handle this ?

Thanks,
Satish

On Tuesday, November 28, 2017 at 11:01:35 AM UTC+5:30, Satish Panithi wrote:
Hello Team,

I am trying to do the below
  • An user opens an form they have previously submitted(saved).
  • While opening the form created above and immediately views a warning dialog "Editing this form will revert the Status to In Progress, are you sure you want to proceed?"
    • Clicks No and views the listing of forms on summary page.
    • Clicks Yes and views the previously saved form to edit.

Can we do this with edit process or do I need to do anything out of the box.


Thanks for your help in advance.


Regards,

Satish


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Display warning message while opening a form for editing.

Alessandro  Vernet
Administrator
Hi Satish,

I see, I missed you had a `visible="true"` on the dialog. Instead of relying
on that attribute to show the dialog, run the `<xxf:show>` action on
`xforms-ready`. This allows you to add a `if="…"` on the action that
controls when it runs, so the dialog is only shown as needed. You'll let me
know if this works for you.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
12