You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
I have an Atlassian SDK webwork1 module with its view:
<webwork1 key="ai-config" name="AI Config" i18n-name-key="ai-config.name">
<description key="ai-config.description">The AI Config Plugin</description>
<actions>
<action name="com.softgile.jira.webwork.AIConfigAction" alias="AIConfigAction">
<view name="success">/templates/ai-config/success.vm</view>
</action>
</actions>
</webwork1>
In the view I have several forms:
<form class="aui" id="configForm" method="post" action="AIConfigAction!saveIp.jspa">
...
</form>
<form class="aui" id="serviceName" method="post" action="AIConfigAction!saveService.jspa">
...
</form>
Also I have a button there, which is controlled with JS:
<div class="field-group">
<label for="authenticate">
<span class="aui-icon aui-icon-large aui-iconfont-app-access">Insert meaningful text here for accessibility</span>
</label>
<div class="buttons">
<button class="aui-button aui-button-primary" id="authenticate">Authenticate</button>
</div>
</div>
In JS file I have something like this:
AJS.toInit(function(){
AJS.$(document).on('click', '#authenticate', function(e) {
e.preventDefault();
alert("authenticate");
});
});
Both forms work okay, and JS works when I click the button. But JS stops working when I submit one of the forms, it works only before submitting forms. I see that URL is changing from AIConfigAction.jspa to AIConfigAction!saveService.jspa and in that case JS not working. How can I make JS work?
I have found the solution myself. So, the problem in my case was that I was including web-resources inside doExecute() method of the Webwork. That is why after calling other methods like doSave() web-resources stopped working.
Solution - move web-resources inclusion to Webwork constructor:
@Inject
public AIConfigAction(WebResourceManager webResourceManager) {
webResourceManager.requireResourcesForContext("myPlugin");
}
Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.