Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,299,255
Community Members
 
Community Events
165
Community Groups

velocity form : Add row script not working , how we call different methods when we click on buttons

Edited

This is my vm code 

 

 

<html>
<head>
<title> <title>$action.getText('approval-webwork-module.approval.issue')</title></title>
</head>
<body>
<form action="EventActionHandler.jspa" class="aui" id="approval-issue" method="post">
<div class="aui-page-panel">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){$('p input[type="button"]').click(function () {
$('#myTable').append('<tr><td><select name="type"><option value="approval">Approval</option><option value="review">Review</option></select></td><td><input type="text" class="fname" /></td><td><input type="date" data-date-inline-picker="true" /></td><td><select name="Status"><option value="reqork">Rework</option><option value="approved">Approved</option><option value="reject">Rejected</option></select></td><td><input type="button" value="Delete" /></td></tr>')
});
})

$(document).ready(function(){$('#myTable').on('click', 'input[type="button"]', function () {
$(this).closest('tr').remove();
})})
</script>

<table id="myTable" style="border: 1px solid black">
#set ($allList = $action.getAllRec())
#foreach ($currentRec in $allList)
<tr>
<td>
<select name="type" value="$currentRec.type">
<option value="Approval">Approval</option>
<option value="Review">Review</option>
</select>
</td>
<td>
<input name="approvalName" type="text" class="fname" value="$currentRec.approvalName"/>
</td>
<td>
<input name="dueDate" type="date" data-date-inline-picker="true" value="$currentRec.dueDate"/>
</td>
<td>
<select name="status" value="$currentRec.status">
<option value="Rework">Rework</option>
<option value="Rework">Rework</option>
<option value="Rejected">Rejected</option>
<option value="Approved">Approved</option>
</select>
</td>
<td>
<input type="button" value="Delete" />
</td>
</tr>
#end
</table>
<input type="button" id="addrow" value="Add Row">
</div>

<div class="buttons-container form-footer">
<div class="buttons">
<input accesskey="s" class="button" id="approval-issue-submit" name="Approval" title="Press Ctrl+Alt+s to submit this form" type="submit" value="Approval">
<a accesskey="`" class="cancel" href="/browse/${action.issue.key}" id="approval-issue-cancel" title="Press Ctrl+Alt+` to cancel">Cancel</a>
</div>
</div>

</form>
</body>
</html>

 

1) Add row functionality not working .

2) how we call bean methods from button click ?

 

I look forward to positive reply from you ! 

Thanks & Regards,

Amit 

 

 

0 comments

Comment

Log in or Sign up to comment
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you