Ok ... so I think I managed to track down the problem a little more.
Having a look at validateButton.jelly I could see that the url is created
by:

validateButton('${descriptor.descriptorFullUrl}/${method}','${with}',this)

So in my case the first segment seems to be evaluated to the empty string.
I tried several things, but the solution that seems to have worked, was to
add a "getValidationUrl" method to my Action:
    public String getValidationUrl() {
        final String fullUrl = getDescriptor().getDescriptorFullUrl() +
                "/testModuleSelection";
        return fullUrl.substring(1);
    }

Using the descriptor to generate the url, it seems that this url is
portable to multiple installation scenarios.

After this I was able to call a validation method in my Actions descriptor.

Now I have to get the parameters correctly passed to that validation method.

Chris



2013/4/19 Christofer Dutz <[email protected]>

> I am trying to implement some validation functionality.
> For this I wanted to use a f:validateButton and have a validation function
> testModuleSelection
> Unfortunately I allways get "unable to find "/testModuleSelection" as an
> error message.
> Why does Jenkins allways put a "/" in front of the method. This is really
> killing me :-(
> How can I tell Jenkins not to do this?
>
>                                         <f:validateButton
>                                            title="${%Test Modules}"
> progress="${%Validating...}"
>                                            method="testModuleSelection"
> with="minorReleaseSettings"/>
>
> results in:
>
> <input value="Test Modules" onclick="
> validateButton('/testModuleSelection','minorReleaseSettings',this)" class
> ="yui-button validate-button" type="button" />
>
> but all would be good if it just were:
>
> <input value="Test Modules" onclick="
> validateButton('testModuleSelection','minorReleaseSettings',this)" 
> class="yui-button
> validate-button" type="button" />
>
> Help desperately wanted :-(
>
> Chris
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to