Embed HTML Component on dynamically created Dialog

Dear All

We currently create a dialog using javascript, i.e. :

// Open a dialog to copy the enrollment URL
var switch_apps = journey.dialog.input({
    title: "Copy Enrollment Link",
    message: "If your app loses internet connectivity while switching apps you may be logged out. Please copy the enrollment link should you need to manually re-enroll.",
    inputLabel: "Select and copy link",
    inputType: "text",
    inputValue: url,
    saveButton: "Switch Now"
});

Is it possible to inject an html component into the dialog? We can do it on a single page in the XML as follows :

<dialog id="copy_link" title="Copy Enrollment Link" auto-hide="false">
    <body>
        <info align-text="center">
            If your app loses internet connectivity 
            while switching apps you may be logged out. 
            Please copy the enrollment link 
            should you need to manually re-enroll.
        </info>
        <info></info>
        <html id="copy_link_html" src="html/copy_to_clipboard.html" height="85px" />
    </body>
    <button-group>
        <button label="Cancel" on-press="$:closeDialog('copy_link')" style="outline" validate="false" />
        <button label="Switch Now" on-press="$:closeDialog('copy_link')" validate="false" />
    </button-group>
</dialog>

The challenge is we want to make this particular dialog available across multiple views.

Kind regards
Matthew Lucas

Hi Matthew,

We are working on a feature that will allow developers to put XML components like this dialog example into a template, and then reference this template in multiple views (we announced it at the end of this blog post). It sounds like that fits your use case exactly.
We will be releasing this feature into beta soon (in the next week or two) - let me know if you’d like access to it :slight_smile: It would be great to get your feedback.

Dear Benita

Yes please that would be great if we could get access to the new feature.

Kind regards
Matthew

We’ve just released the beta - I’ve emailed you the details :slight_smile: