Ok so I investigated a bit more, and it seems this is happening because the 
INPUT.validated rule is coming before the TR.row-set-end rule (priority 26 
vs 43).

Anyone already had issue with behaviour rules execution order, any way to 
change this easily? I've tried changing the order using the debugger tool 
and that works fine if I move the TR.row-set-end (which as a reminder is 
the one setting the ref/refName relationship for blocks), before the 
validators. That way the first validation can use ref/refName and relative 
path are resolved correctly.

Thanks for your help.

Le jeudi 4 août 2016 22:58:25 UTC+2, Guillaume Delory a écrit :
>
> Hi,
>
> I'm trying to use validation on a field with a form a bit unusual because 
> it's using a lot of radioBlock and I need relative path. So I set up my 
> validation method like that:
>
> public FormValidation doCheckIdcmsInputFile(@QueryParameter("value") final 
> String value, @RelativePath("../..") @QueryParameter final String 
> fileOrManual, @RelativePath("..") @QueryParameter final String inputtype)
>
> It does create the correct checkUrl and checkDependsOn attributes 
> dynamically, the problem is that checker function (hudson-behavior.js:444) 
> is called once on the field before applyNameRef is called. As you may know, 
> this function is setting the ref/nameRef relation ship between radio button 
> and their corresponding block. Therefore the first time it's running, it's 
> failing to resolve the path and causes a javascript error preventing my 
> form to load (because the ../.. go way to high without the ref/nameRef). If 
> I stop in debug the first run and change the relative path to make it work 
> without ref/nameRef, then after ref/nameRef did it job my relative path 
> work perfectly fine.
>
> I'm using Jenkins 1.638. Any of you already encountered this 
> checke/nameRef condition race when using relative path? How did you solve 
> it?
>
> Here is my form for your information, I removed all unnecessary parts to 
> make it clearer for this question:
>
> <f:radioBlock name="fileOrManual" value="dcsfile" id="dcsfile" title="Use 
> an existing DCS Build File">
>   <f:nested>
>       <div name="dcsfileinput" id="dcsfileinput">
>         <input name="file" type="file" jsonAware="true" />
>       </div>
>    </f:nested>
> </f:radioBlock>
>
> <f:radioBlock name="fileOrManual" checked="true" value="manualinput" 
> id="manualinput" title="Build a DCS Build File">
>   <f:nested>
>       <f:section title="Sources">
>        <f:radioBlock name="inputtype" value="gsa" checked="true" 
> title="GSA"><f:nested>
>           <f:entry field="inputfile" title="Ditamap's path in the zip">
>             <f:textbox />
>           </f:entry>
>           <f:entry name="inputpath" title="Zip's path in GSA">
>             <f:textbox/>
>           </f:entry>
>         </f:nested></f:radioBlock>
>         <f:radioBlock name="inputtype" value="filenet" 
> title="IDCMS"><f:nested>
>           <f:entry field="idcmsInputFile" title="Ditamap's path in IDCMS">
>             <f:textbox autocomplete="on"/>
>           </f:entry>
>         </f:nested></f:radioBlock>
>       </f:section>
>   </f:nested>
> </f:radioBlock>
>
> Thanks for your help and I hope I was in the right group to ask that, not 
> sure if I should open a bug in the JIRA as well, I thought I would rather 
> ask in the group first.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/899c5263-c7fd-4807-8499-3d86b39536a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to