开发者

Forms Runner form - warning displayed when navigating to another page, tick and save buttons appear automatically

I have a form which I created using Forms Builder - this form displays a tick mark and a floppy icon (for save) at the bottom. I do not want those displayed since there is no persistence being performed using those buttons in my code. How to achieve this (no display of those icons) - I have already done

<property as="xs:string" name="oxf.fr.detail.buttons.*.*" value="" />

and

<property as="xs:string" name="oxf.fr.detail.buttons.view.*.*" value="back pdf" />

in my local properties file

Also, I direct the user to another page using the xforms:load action - that results in the floppy icon being shown (detection that instance has changed perhaps) and also shows an alert confirming if I really want to navigate away from the page. How do I disable this warning (instance data will change, but I do not want the floppy/save icon in the first place)...

[edit1] Based on sugg开发者_StackOverflow社区estions:

Since what I want is no button at all (on the initial form, actions are taken based on what the user selected in select1), I did:

...</fr:body><fr:buttons /></fr:view>... 

but that does not help (tick and floppy icons still appear). I also did

<xforms:action ev:event="xforms-select" target="XMLOptions-control"
                   if="event('xxforms:item-value')='RETRIEVE'">
        <!-- workaround to stop showing the alert asking the user if they really want to move away from the page -->
        <xforms:setvalue ref="xxforms:instance('fr-persistence-instance')/data-safe">true</xforms:setvalue>
        <xforms:load show="replace" resource="/fr/prototype/retrieval/new"/>
    </xforms:action>  

That does not help either (the alert dialog continues to be shown). I cannot see any instance named 'fr-persistence-instance' in my xforms source.


Your first property is the correct one to remove all the buttons in the detail page:

<property as="xs:string"  name="oxf.fr.detail.buttons.*.*" value=""/>

But it looks to me that what you want to do is to add your own custom buttons, instead of using the default ones. Instead of changing the oxf.fr.detail.buttons.*.* property, you can edit the form source and place your own buttons there in <fr:buttons>. See the section "Including standard buttons" on Create a wizard or multi-page form with Form Builder.

To avoid the message asking users if they really want to navigate away from the current page, before the <xforms:load>, do:

<xforms:setvalue ref="xxforms:instance('fr-persistence-instance')/data-safe-override">true</xforms:setvalue>

For instance, you would put this in your own button:

<fr:buttons>
    <fr:button>
        <xforms:label>Go to Orbeon</xforms:label>
        <xforms:action ev:event="DOMActivate">
            <xforms:setvalue ref="xxforms:instance('fr-persistence-instance')/data-safe-override">true</xforms:setvalue>
            <xforms:load resource="http://www.orbeon.com/"/>
        </xforms:action>
    </fr:button>
</fr:buttons>

To hide the status icons telling you if the data is valid, you can use the following CSS (and see styling for more information on how to add your own CSS):

.fr-status-icons { display: none }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜