Skip to content
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

Multiple elements with id="xforms-select-full-template" and id="xforms-select1-full-template" #6224

Closed
avernet opened this issue Mar 12, 2024 · 4 comments

Comments

@avernet
Copy link
Collaborator

avernet commented Mar 12, 2024

This occurs when embedding multiple forms on the same page. We should either:

  1. Add a prefix to those IDs, e.g., o0xforms-select-full-template.
  2. Use a class instead of an ID to locate those elements.
  3. Eliminate those elements and dynamically generate the markup when needed.

I prefer option 2 or 3, with 2 likely being the less extensive change.

+1 from customer

@avernet
Copy link
Collaborator Author

avernet commented Mar 13, 2024

For item 3, @ebruchez suggests we could use ScalaTags, which we already utilize elsewhere in our Scala.js code to generate markup.

@ebruchez
Copy link
Collaborator

The two templates:

<span id="xforms-select-full-template" class="xforms-template">
    <span class="xforms-deselected">
        <label class="checkbox">
            <input id="$xforms-item-id-select$" type="checkbox" name="$xforms-item-name$" value="$xforms-template-value$">
            <span class="xforms-hint-region">$xforms-template-label$</span>
            <span class="xforms-help">$xforms-template-help$</span>
            <span class="xforms-hint">$xforms-template-hint$</span>
        </label>
    </span>
</span>

<span id="xforms-select1-full-template" class="xforms-template">
    <span class="xforms-deselected">
        <label class="radio">
        <input id="$xforms-item-id-select1$" type="radio" name="$xforms-item-name$" value="$xforms-template-value$">
            <span class="xforms-hint-region">$xforms-template-label$</span>
            <span class="xforms-help">$xforms-template-help$</span>
            <span class="xforms-hint">$xforms-template-hint$</span>
        </label>
    </span>
</span>

@ebruchez
Copy link
Collaborator

ebruchez commented Mar 23, 2024

  • might cause Form Builder issue, check
  • cp on user branch

@ebruchez
Copy link
Collaborator

Confirmed that this is what is causing Form Builder not to show.

ebruchez added a commit that referenced this issue Mar 24, 2024
…ate"` and `id="xforms-select1-full-template"`"
@ebruchez ebruchez added this to Done in Orbeon Forms 2024.1 Mar 24, 2024
@ebruchez ebruchez added this to To do in Orbeon Forms 2022.1.7 via automation Mar 29, 2024
@ebruchez ebruchez moved this from To do to Done in Orbeon Forms 2022.1.7 Mar 29, 2024
ebruchez added a commit that referenced this issue Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants