example of @DataBoundConstructor using a collection or array

488 views
Skip to first unread message

domi

unread,
Oct 25, 2011, 11:16:52 AM10/25/11
to Jenkins Developers
is there any example using @DataBoundConstructor on a constructor which takes a collection e.g.:


@DataBoundConstructor
public MyClass(String id, String name, List<String> args) {
   ...
}


/Domi

nicolas de loof

unread,
Oct 25, 2011, 11:46:52 AM10/25/11
to jenkin...@googlegroups.com
I also had this issue and didn't find a solution, so had to create a wrapper class for list elements with the adequate @DataBoundConstructor

2011/10/25 domi <do...@fortysix.ch>

domi

unread,
Oct 25, 2011, 1:48:33 PM10/25/11
to jenkin...@googlegroups.com
sad i have to go the same path :(
…thanks!

Christopher Orr

unread,
Oct 25, 2011, 5:51:38 PM10/25/11
to jenkin...@googlegroups.com

I have an <f:repeatable> tag in jelly that is passed into my
DataBoundConstructor as an array. I vague recall trying it with a List,
but it didn't work unless I specified an array.

Regards,
Chris

Sebastian Schuberth

unread,
Jan 30, 2015, 4:00:04 AM1/30/15
to jenkin...@googlegroups.com

Jesse Glick

unread,
Jan 30, 2015, 10:28:09 AM1/30/15
to Jenkins Dev
That is a different case: State is a Describable. repeatableProperty
works easily with these (in either Jelly or Groovy).

The question was about binding a List<String>.
Reply all
Reply to author
Forward
0 new messages