tdmcginley

Listing.java

May 13th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. package actions.survey;
  2.  
  3. import data.*;
  4.  
  5. import java.util.HashMap;
  6. import java.util.List;
  7. import java.util.Map;
  8.  
  9. import com.opensymphony.xwork2.ActionContext;
  10.  
  11. import actions.base.BaseAction;
  12.  
  13. public class Listing extends BaseAction {
  14.  
  15. /**
  16. *
  17. */
  18. private static final long serialVersionUID = -7954410790927568904L;
  19. private List<Forms> forms;
  20. private Forms selectedForm;
  21. private Long yourForm;
  22.  
  23. public Listing() {
  24. }
  25.  
  26. public String execute() {
  27. selectedForm = services.getFormsById(yourForm);
  28. return SUCCESS;
  29. }
  30.  
  31. public String display() {
  32. forms = services.getForms();
  33. return NONE;
  34. }
  35.  
  36. public String beginQuestions() {
  37. // Map<String, Object> context = new HashMap<String, Object>();
  38. // context.put("formId", getYourForm());
  39. // context.put("yourForm", yourForm);
  40. ActionContext.getContext().getValueStack().set("yourForm", getYourForm());
  41. return "redirect";
  42. }
  43.  
  44. public List<Forms> getForms() {
  45. return forms;
  46. }
  47.  
  48. /**
  49. * @param yourForm the yourForm to set
  50. */
  51. public void setYourForm(Long yourForm) {
  52. this.yourForm = yourForm;
  53. }
  54.  
  55. /**
  56. * @return the yourForm
  57. */
  58. public Long getYourForm() {
  59. return yourForm;
  60. }
  61.  
  62. /**
  63. * @param selectedForm the selectedForm to set
  64. */
  65. public void setSelectedForm(Forms selectedForm) {
  66. this.selectedForm = selectedForm;
  67. }
  68.  
  69. /**
  70. * @return the selectedForm
  71. */
  72. public Forms getSelectedForm() {
  73. return selectedForm;
  74. }
  75.  
  76. }
Advertisement
Add Comment
Please, Sign In to add comment