Fill the config into a repeatable list

52 views
Skip to first unread message

Stefan Krismann

unread,
Sep 2, 2015, 12:03:39 PM9/2/15
to jenkin...@googlegroups.com
Hey,

So i am trying to get the configured values, that were previously configured to be displayed on the configuration page of the plugin.

config.jelly:

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
    <f:entry title="Project File Location" field="projectLoc">
        <f:textbox />
    </f:entry>
    <f:entry title="Results File Directory" field="resultDir">
        <f:textbox />
    </f:entry>
    <f:entry title="Success Criterias:">
        <f:repeatable var="successCriteria" items="successCriteria" add="Add Success Criteria">
            <table width="100%">
                <f:entry field="userType" title="User Type:">
                    <f:select />
                </f:entry>
                <f:entry field="transactionName" title="Transaction Name:">
                    <f:select />
                </f:entry>  
                <f:entry field="measureName" title="Measure Name:">
                    <f:select />
                </f:entry>
                <f:entry field="valueType" title="Value Type:">
                    <f:select />
                </f:entry>
                <f:entry field="operatorType" title="Operator Type:">
                    <f:select />
                </f:entry>
                <f:entry field="chosenValue" title="Value:">
                    <f:textbox />
                </f:entry>  
            </table>
            <f:repeatableDeleteButton/>
        </f:repeatable>
    </f:entry>
</j:jelly>


So what I have seen so far, you have to write a getter in the class that has this jelly file. So I tried with a a field name in the repeatable but then it wouldn't fill the select, so I removed that. So I am not sure how I would get the previously configured entries inside the repeatable, in a manner that every entry gets its own five selects with the correct option already selected.

Best regards
Stefan

Jesse Glick

unread,
Sep 2, 2015, 12:34:05 PM9/2/15
to Jenkins Dev

Do not use raw `f:repeatable`. Define a nested `Describable` with its own `config.jelly` and use `f:repeatableProperty` or `f:repeatableHeteroProperty`.

stkr...@gmail.com

unread,
Sep 3, 2015, 10:07:20 AM9/3/15
to Jenkins Developers
Thanks. This worked.
Reply all
Reply to author
Forward
0 new messages