ValidateButton without descriptor

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

ValidateButton without descriptor

b8565524
Hi,

I would like to use f:validateButton control to validate my plugin config. The problem is that I haven't got any Descriptor - I use class which extends Plugin.

This code:
<f:validateButton title="Test" progress="Wait..." with="param1,param2" method="testConfig"/>

returns 404.

I was trying to 'hack' method url:
<f:validateButton title="Test" progress="Wait..." with="param1,param2" method="${rootURL}/plugin/myplugin/testConfig"/>

It does not work... It tries to invoke http://localhost:8081/descriptorByName/jenkins.model.GlobalPluginConfiguration//plugin/myplugin/testConfig :(

How can I use validateButton when I haven't got any descriptor?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ValidateButton without descriptor

Kohsuke Kawaguchi
Administrator
The trick is to make your class implement Describable, then define a
nested Descriptor.

Various classes in the core do just that, such as ProxyConfiguration, I believe.

2012/2/22 b8565524 <[hidden email]>:

> Hi,
>
> I would like to use f:validateButton control to validate my plugin config.
> The problem is that I haven't got any Descriptor - I use class which extends
> Plugin.
>
> This code:
> <f:validateButton title="Test" progress="Wait..." with="param1,param2"
> method="testConfig"/>
>
> returns 404.
>
> I was trying to 'hack' method url:
> <f:validateButton title="Test" progress="Wait..." with="param1,param2"
> method="${rootURL}/plugin/myplugin/testConfig"/>
>
> It does not work... It tries to invoke
> http://localhost:8081/descriptorByName/jenkins.model.GlobalPluginConfiguration//plugin/myplugin/testConfig
> :(
>
> How can I use validateButton when I haven't got any descriptor?
>
> --
> View this message in context: http://jenkins.361315.n4.nabble.com/ValidateButton-without-descriptor-tp4409633p4409633.html
> Sent from the Jenkins dev mailing list archive at Nabble.com.



--
Kohsuke Kawaguchi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ValidateButton without descriptor

b8565524
Thank you!
Loading...