hint not being rendered when field becomes non relevant

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

hint not being rendered when field becomes non relevant

masha.knezevic
I have a date field in my form which has a visibility condition.
I've added appearance="minimal" to the hint, but when the field becomes relevant, the hint isn't displayed.
It is displayed upon refreshing the form because of the fact that the field was visible (and autosaved).

Is there a way to avoid this? To render the placeholder when the visibility condition evaluates to true?

Thanks in advance!

--
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: hint not being rendered when field becomes non relevant

Alessandro  Vernet
Administrator
Hi Masha,

What version of Orbeon Forms are you seeing this with? And if with 2017.1,
would you be able to create a minimal example that reproduces the problem,
that we can run here, and attach it a response so we can look into it?

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: hint not being rendered when field becomes non relevant

masha.knezevic
Hi Alex, 

thanks for your reply.
I am having issues both on 4.8 and 2016.3. Unfortunately, I'm not able to upgrade to 2017.1 at this point but I'd need a solution if there is one.

I've noticed that I can add the placeholder attribute in <xxf:script ev:event="xforms-enabled">, but the only problem is that I don't know how to get the label of the hint from resources for this field.
I have multiple languages so I can't hard code it.

An additional thing I've noticed is that with appearance="full", the hint is visible. But I need it as a placeholder.

I've created a basic example:

<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
         xmlns:ev="http://www.w3.org/2001/xml-events"
         xmlns:exf="http://www.exforms.org/exf/1-0"
         xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
         xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
         xmlns:saxon="http://saxon.sf.net/"
         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:sql="http://orbeon.org/oxf/xml/sql"
         xmlns:xf="http://www.w3.org/2002/xforms"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
         xmlns:xxi="http://orbeon.org/oxf/xml/xinclude">
    <xh:head>
        <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>
                        <my-radio-btn/>
                        <my-date/>
                        
                    </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="my-radio-btn-bind" ref="my-radio-btn" name="my-radio-btn"/>
                    <xf:bind id="my-date-bind" ref="my-date" name="my-date" type="xf:date"
                             relevant="$my-radio-btn = '1'"/>
                    
                </xf:bind>
            </xf:bind>
            <!-- Metadata -->
            <xf:instance xxf:readonly="true" id="fr-form-metadata" xxf:exclude-result-prefixes="#all">
                <metadata>
                    <application-name>insurance</application-name>
                    <form-name>test</form-name>
                    <title xml:lang="en"/>
                    <description xml:lang="en"/>
                </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 -->
            <!-- Don't make readonly by default in case a service modifies the resources -->
            <xf:instance id="fr-form-resources" xxf:readonly="false" xxf:exclude-result-prefixes="#all">
                <resources>
                    <resource xml:lang="en">
                        <my-radio-btn>
                            <label>Display or hide date?</label>
                            <hint/>
                            <item>
                                <label>Display date</label>
                                <hint/>
                                <value>1</value>
                            </item>
                            <item>
                                <label>Hide date</label>
                                <hint/>
                                <value>2</value>
                            </item>
                        </my-radio-btn>
                        <my-date>
                            <label/>
                            <hint>DD.MM.YYYY</hint>
                        </my-date>
                        <section-1>
                            <label>Untitled Section</label>
                        </section-1>
                        
                    </resource>
                </resources>
            </xf:instance>
            <!-- Utility instances for services -->
            <xf:instance id="fr-service-request-instance" xxf:exclude-result-prefixes="#all">
                <request/>
            </xf:instance>
            <xf:instance id="fr-service-response-instance" xxf:exclude-result-prefixes="#all">
                <response/>
            </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:select1 id="my-radio-btn-control" appearance="full" bind="my-radio-btn-bind">
                                    <xf:label ref="$form-resources/my-radio-btn/label"/>
                                    <xf:hint ref="$form-resources/my-radio-btn/hint"/>
                                    <xf:alert ref="$fr-resources/detail/labels/alert"/>
                        
                        
                                    <xf:itemset ref="$form-resources/my-radio-btn/item">
                                        <xf:label ref="label"/>
                                        <xf:value ref="value"/>
                                        <xf:hint ref="hint"/>
                                    </xf:itemset>
                                </xf:select1>
                                
                            </xh:td>
                            <xh:td>
                                <xf:input id="my-date-control" bind="my-date-bind">
                                    <xf:label ref="$form-resources/my-date/label"/>
                                    <xf:hint ref="$form-resources/my-date/hint" appearance="minimal"/>
                                    <xf:alert ref="$fr-resources/detail/labels/alert"/>
                        
                        
                                </xf:input>
                            </xh:td>
                        </xh:tr>
                    </fr:grid>
                </fr:section>
            </fr:body>
        </fr:view>
    </xh:body>
</xh:html>


Thanks, 
Masha

On Wednesday, December 20, 2017 at 11:18:00 PM UTC+1, Alessandro Vernet wrote:
Hi Masha,

What version of Orbeon Forms are you seeing this with? And if with 2017.1,
would you be able to create a minimal example that reproduces the problem,
that we can run here, and attach it a response so we can look into it?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">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].
Reply | Threaded
Open this post in threaded view
|

Re: hint not being rendered when field becomes non relevant

Alessandro  Vernet
Administrator
Hi Masha,

Thank you for the test case; indeed, this was a bug. I created an issue to
track this, and pushed a fix. Since we're too close to the release, I'm not
going to include it in 2017.2, and it will instead most likely go in the
next release (2018.1). (For those reading this and with a PE Gold, feel free
to contact us through Basecamp for a hot fix.)

https://github.com/orbeon/orbeon-forms/issues/3419

Was there anything else related to this?

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: hint not being rendered when field becomes non relevant

masha.knezevic
Hi Alex,

Thanks for your reply. 

I haven't noticed anything else. I've managed to achieve adding the placeholder with xxf:script and appearance="full".

Kind regards,
Masa

On Friday, December 22, 2017 at 6:28:45 AM UTC+1, Alessandro Vernet wrote:
Hi Masha,

Thank you for the test case; indeed, this was a bug. I created an issue to
track this, and pushed a fix. Since we're too close to the release, I'm not
going to include it in 2017.2, and it will instead most likely go in the
next release (2018.1). (For those reading this and with a PE Gold, feel free
to contact us through Basecamp for a hot fix.)

<a href="https://github.com/orbeon/orbeon-forms/issues/3419" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Forbeon%2Forbeon-forms%2Fissues%2F3419\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGYY0PxhLOlL7x4VaNQKvMUS7B6Xg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Forbeon%2Forbeon-forms%2Fissues%2F3419\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGYY0PxhLOlL7x4VaNQKvMUS7B6Xg&#39;;return true;">https://github.com/orbeon/orbeon-forms/issues/3419

Was there anything else related to this?

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">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].
Reply | Threaded
Open this post in threaded view
|

Re: hint not being rendered when field becomes non relevant

Alessandro  Vernet
Administrator
I'm glad you also have a workaround, Masha, and again thank you for letting
us know about this issue; it is sometimes hard for us to test all the
possible combinations in which the features in the product can be used, so
I'm glad you caught this one, and we got a chance to fix it.

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