Right, this is not polymorphic, it's simple composition. I'll experiment with 
setting 'descriptor' directly in the Jelly code before calling st:include, and 
I'll also look into possibly using Groovy instead, since this will be a new 
plugin. Thanks!

----- Original Message -----
From: jenkinsci-dev@googlegroups.com
To: jenkinsci-dev@googlegroups.com
At: Jul 12 2013 10:47:28

On 07/12/2013 09:53 AM, Kevin Fleming (BLOOMBERG/ 731 LEXIN) wrote:
> Interesting idea, but I'm not sure that will work when 'connector' is null 
> because the object is being created by the user of the config form.

Usually in this context ${descriptor} is already set by the control that lets 
the user add an item to configuration (<f:optionalProperty> for example). If 
that is not 
true in your case because you are doing something special, and you know that 
you are adding an SSHConnector specifically (i.e. this is not polymorphic), 
then you can use

Descriptor<?> d = Jenkins.getInstance().getDescriptorOrDie(SSHConnector.class);

and bind that to ${descriptor} in your Jelly. (For such cases it would be a bit 
easier to use a Groovy view.)

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


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


Reply via email to