Validators are not trigerred on JIRA.Dialog form

Gebsun
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2015

Chris Darroch [Atlassian], I'm trying to use validation (standard + custom) )for JIRA.Dialog but unable to make it work.

Validator is being registered with AJS.validator.register() but is not triggered.

 

Check example: https://bitbucket.org/gebsun/form-validation-jira/

More info in readme file

 

5 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Gebsun
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 6, 2015

@Trey Shugart Yes "form-validation" is added as dependency7 to JIRA module you can check example (non-working) https://bitbucket.org/gebsun/form-validation-jira/

0 votes
Gebsun
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 6, 2015

@Chris "Daz" Darroch I'v prepared example please take a look: https://bitbucket.org/gebsun/form-validation-jira/. To be more specific "custom validation" is not working (I've added validator).

It seems that even validator is being registered with AJS.validator.register() but is not triggered.

 

 

 

 

0 votes
Trey Shugart October 6, 2015

If AUI's form validation is being used, you shouldn't have to re-initialise it at all. Simply having the form elements in the document is sufficient for them to validate. Are you experiencing an issue where form validation isn't working within a form that is used inside a dialog? If so: - Ensure AUI's form validation is actually on the page. I'm unsure as to whether or not that's the case from the provided examples. - Can you include exactly what isn't working and any errors you're getting if there are any from the JavaScript console?

0 votes
Gebsun
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 6, 2015

Sorry for non clear explanation. I'll try to explain a little bit:

I'm developing a plugin that has :

  1. "webwork1" module implemented (alias=TestAction).
    1. module has view that is content of a Dialog
  2. "web-item" module section="operations-work"
  3. "web-resource" that is javascript file that:
    1. context for resource is

      <context>atl.general</context>
    2. resource as dependency loads for form validation

      <dependency>com.atlassian.auiplugin:aui-form-validation</dependency>
    3. Javascript (alt.general) overrides click function to (2) (so Custom JavaScript Code is executed on Click)
    4. This custom javascript basically: creates Dialog

     

    JIRA.Dialogs.testDialog = new JIRA.FormDialog(...);
  4. My problem is that form validation is instantiated when alt.general (Issue View) is loaded

  5. After clicking on link (and Dialog is Created) form validation is not working (initialized in other context)

 

p.s. Some similar case as "Log Work" dialog on issue page (Dialog is created) but I want to user "form-validation" (loaded via dependency in web-resource or as AMD module) in that dialog.

 

0 votes
Daz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 6, 2015

Gebsun, what kind of form validation are you using? It is unclear to me. By `form/validation` do you mean the `aui/form-validation` AMD module? It is also unclear to me how Skate is relevant? Can you rewrite your question and perhaps offer some code example to clarify your question?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events