1
0
-1

I am loading a form in an userview and i am sending a custom url parameter in this userview link. The first load, the url parameter is coming fine. But if i submit the form and there are any validation errors, the form reloads throwing the validation errors. On this load, the url parameters are missing/removed. How to overcome this ??

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Hi Thejaswi Chinduyes

      Take a look at the attached simple sample app to demonstrate taking the parameter 'id2' and pushing this value into the 'id' field of the Joget Workflow form via hash variable (#requestParam.id2#) in 'default value' property.

      At the same time, there is a hidden field call 'id2' that will store the requestparam value.

      Form validation error will not erase the 'id' value, which you can test by not inputting any value in the TextField and pressing SAVE button.

      Add more records by changing the parameter value of 'abc' in the url manually in the browser and press enter to reload the form (http://localhost:8080/jw/web/userview/paramToId/v/_/ff?_mode=add&id2=abc).

      Hope this helps you (smile).

      APP_Param_To_Id-1.jwa

      1. Thejaswi Chindu

        Thanks Andrew, This works. :)

      CommentAdd your comment...
    2.  
      2
      1
      0

      Hi Thejaswi Chindu

      You can store the value of the parameters into hidden fields in your form on form load. On reload due to validation errors in your form, these fields will retain the parameter values.

          Example: formname?param1=abc&param2=123

      Create 2 hidden fields name 'param1' and 'param2' and these fields will be populated with the value 'abc' and '123' and will be save into your database.

      1. Thejaswi Chindu

        Hey Andrew, Thanks for quick response. I forgot to mention that, the url parameter that i am passing is needed to be stored as the 'id' attribute of the form(because, i need this parameter to be the ID of the table entry of this instance). So, if the hidden field is given the id 'id', it is not retaining the field value on the next load. This is the issue. I request your help on this.

      CommentAdd your comment...