Menu

setAction in WebForm

hop top
2002-06-05
2002-08-06
  • hop top

    hop top - 2002-06-05

    hi,

    Is there a way to set "action" in a WebForm object. I saw that
    there is a getAction method but i need to change the action value of a form because of some javascript usage inside the form.
    Thanks

    Ozgur

     
    • Russell Gold

      Russell Gold - 2002-07-24

      form.getScriptableObject().setAction( new action )

       
    • liu

      liu - 2002-08-01

      hi,russgold

      I just did as you said,but the result was not what I hava expected,can you tell me why?
      (actually,I want to change the action of myform,
      then submit it,but after i had changed the action,the form's action changed,the request I got did not change,why?)

      thanks

      below is my code:
      String newAction = "j_task_deny.jsp";
      myform.getScriptableObject().setAction(newAction);
      System.out.println(forms[0].getAction());
      //now the result is j_task_deny.jsp
      request = myform.getRequest();
      System.out.println(request.getURL());
      //now the result is http://localhost:8880/j_task_apply.jsp
      System.out.println(myform.getAction());
      //now the result is still j_task_deny.jsp

       
    • liu

      liu - 2002-08-01

      I made some change on the code just posted

      String newAction = "j_task_deny.jsp";
      myform.getScriptableObject().setAction(newAction);
      System.out.println(myform.getAction());
      //now the result is j_task_deny.jsp
      request = myform.getRequest();
      System.out.println(request.getURL());
      //now the result is http://localhost:8880/j_task_apply.jsp,is not http://localhost:8880/j_task_deny.jsp
      System.out.println(myform.getAction());
      //now the result is still j_task_deny.jsp

       
    • Russell Gold

      Russell Gold - 2002-08-05

      ... and in the Aug 5 build

       
    • liu

      liu - 2002-08-06

      I have tried it,it worked

      Thanks russgold

       

Log in to post a comment.

Auth0 Logo