Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript is not triggered in Wizard post-render

Miroslav Kralik
Contributor
March 16, 2018

Hello, I am creating a plugin for new page template and I want to pass some javascript into wizard screen, but for some reason it is not triggered. 

Below is the piece of code which should do the trick also based on official documentation: 

https://developer.atlassian.com/server/confluence/javascript-api-for-blueprint-wizards/

 

alert1 - works just fine and is triggered

alert2 - is not triggered as expected (the wizard page is visible just fine)

Confluence.Blueprint.setWizard('com.msd.devops.addons.confluence.sdlc-templates:sdlc-template', function(wizard) {
alert("aler1");
wizard.on('post-render.page1Form', function (e, state) {
alert("alert2");
});
}); 

 sdlc-templates.soy

{namespace MyPlugin.Blueprints.Simple}

/**
* A form that accepts a person's name
*/
{template .page1Form}
<h3>Planning</h3>
{/template}

 

app attributes:

<groupId>com.msd.devops.addons.confluence</groupId>
<artifactId>sdlc-templates</artifactId>

 

atlassian-plugin.xml

<!-- SDLC Template Blueprint -->
<blueprint key="sdlc-template-blueprint" index-key="my-index" i18n-name-key="sdlc.create-link.title">
<content-template ref="rs-template" />
<content-template ref="qap-template" />
<dialog-wizard key="sdlc-templates-wizard">
<dialog-page id="page1Id" template-key="MyPlugin.Blueprints.Simple.page1Form" title-key="my.blueprint.wizard.page1.title" last="true"/>
</dialog-wizard>
</blueprint>

<!-- Add to the Create Menu -->
<web-item key="sdlc-template" i18n-name-key="sdlc.create-link.title" section="system.create.dialog/content">
<description key="sdlc.create-link.description" />
<resource name="icon" type="download" location="/images/icon.png" />
<param name="blueprintKey" value="sdlc-template-blueprint" />
</web-item>

Any idea, why the alert2 is not triggered (no javascript code I put there is triggered)? 

Thank you, Miroslav

1 answer

1 accepted

0 votes
Answer accepted
Miroslav Kralik
Contributor
March 16, 2018

I was using soy template name instead of the dialog-page id. Fixed.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events