Hi Jason,
On 04/18/2012 01:17 AM, Jason Zhang wrote:
> Hi,
>
> I'm working on a Jenkins plugin to display the build statuses of each
> view. In the index.jelly, I have a form to let users select views they
> want to show in the dashboard, like
>
> <f:form>
> <j:forEach var="view" items="${viewsArray}">
> <div>
> <f:checkbox name="${view.displayName}" title="$
> {view.displayName}"/>
> </div>
> </j:forEach>
> <div>
> <button type="submit" value="submit" class="save"
> onclick="">
> <span>Save</span>
> </button>
> </div>
> </f:form>
>
> How could I hooks the submission action to a Java method?
>
> Thanks for your help in advance.
>
> Jason
Hi Jason,
I'm using something like that:
<f:form method="post" action="save" name="Save">
...
<f:entry title="">
<input type="submit" name="Submit'" value="${%Save}"
class="submit-button" />
</f:entry>
This will call the following method:
/**
* Saves the configured values. Subclasses need to implement the
actual persistence.
*
* @param request
* Stapler request
* @param response
* Stapler response
*/
public void doSave(final StaplerRequest request, final
StaplerResponse response) {
Ulli