2

I am creating a Jira plugin which provides a version tab panel. In the velocity of this version tab panel i am providing a select list . the code of select list is as below

                    <form name="input" action="AddParent" method="post">
        <select name="parentVersion">
        <option value="-1">--select Parent--</option>
        #foreach($version in $versions )
            <option value="$version" selected="true">$version</option>
        <input type="submit" value="Add Parent"/>
        </form>

Now in my plugin i have included a webwork module to handle this action . when i click the "Add Parent" button nothing is happening. I need the value which i have selected in my java action class . I am surely missing something . can someone please help me with this ? Thanks in advance .

Mizan
  • 450
  • 1
  • 5
  • 28

2 Answers2

1

As an alternative, you can declare a local variable named same as your select list, create getter and setter and the variable will get the selected value. Also, yo can specify the form action as action="YourClass!yourMethod.jspa"

private String parentVersion;

public String getParentVersion() {
    return parentVersion;
}
public void setParentVersion(String parentVersion) {
    this.parentVersion = parentVersion;
}
biegleux
  • 13,179
  • 11
  • 45
  • 52
LeonardoX
  • 1,113
  • 14
  • 31
0

I'm not sure what's missing in your code, but the WebWork Sample Plugin has more information about this.

mdoar
  • 6,758
  • 1
  • 21
  • 20
  • Hi Matt ,i referred Webwork sample and was able to get the values by using the request.getParameter("parentVersion") method i made these changes in the velocity template
    . The tutorials helped alot . Thanx :)
    – Mizan Mar 13 '12 at 09:19
  • @mdoar: Could you link to that WebWork Sample Plugin? –  Feb 14 '13 at 23:21