Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,560,334
Community Members
 
Community Events
185
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