New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Builder always using natural field width #3901

Closed
avernet opened this Issue Jan 21, 2019 · 1 comment

Comments

Projects
2 participants
@avernet
Copy link
Collaborator

avernet commented Jan 21, 2019

Create a new form, add a phone number field (to pick a simple one). Notice how the field width is narrow ("natural") instead of taking the full width. Publish the form, open /new: here the field has the fill width as expected. Could it be an issue with our implementation of FormRunnerFunctionLibrary.FRComponentParam that doesn't work properly in Form Builder?

@ebruchez

This comment has been minimized.

Copy link
Collaborator

ebruchez commented Feb 4, 2019

The value evaluated uses the property:

<property
    as="xs:string"
    name="oxf.xforms.xbl.fr.us-phone.field-width"
    value="{if (fr:created-with-or-newer('2018.2')) then 'full' else 'natural'}"/>

It returns 'natural'. This means that fr:created-with-or-newer('2018.2') returned false().

This is the XML metadata as found by fr:component-param-value('field-width'):

<metadata>
    <application-name>a</application-name>
    <form-name>a</form-name>
    <title xml:lang="en">Untitled Form</title>
    <description xml:lang="en"/>
    <created-with-version>2018.2-SNAPSHOT PE</created-with-version>
    <library-versions>
        <orbeon>1</orbeon>
    </library-versions>
</metadata>

It should return true().

However, fr:created-with-or-newer() uses a different function to access metadata:

FormRunner.metadataElemValueOpt(Names.CreatedWithVersion)

This finds the Form Builder metadata instance at design time, which will be incorrect.

We need to change that to use, instead, like ``fr:component-param-value()`:

FRComponentParam.findConstantMetadataRootElem()

@ebruchez ebruchez added this to To review in Orbeon Forms 2019.1 via automation Feb 4, 2019

@ebruchez ebruchez closed this in 2673b66 Feb 4, 2019

Orbeon Forms 2019.1 automation moved this from To review to Done Feb 4, 2019

Orbeon Forms 2018.2.1 automation moved this from To do to Done Feb 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment