how to send the parameter to page?

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

t4nu
Ebase User
Posts: 305
Joined: Thu Jul 02, 2015 8:32 am
Location: Indonesia

how to send the parameter to page?

#1

Postby t4nu » Thu Jan 14, 2016 11:24 pm

Hi,
As the subject stated, how to do it?
What I want is to give 2 links to user' email, both of them will direct the user to the same certain page within a form, the different is one link will give a parameter which will trigger approval action and the other will trigger the rejection action. In this case the action sign is sent as parameter.
How to do it?
Thanks in advance for the help.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Fri Jan 15, 2016 8:51 am

You set up a field in your form and make it a URL Parameter - this is an option in the field's properties. This means that you can pass this field's value on the URL that invokes the form. Then you check this value in a before form event and go to the appropriate page. So if the parameter field is p1, the URL (in V5) will be something like:

http://hostname:port/webapp/myForm.eb?p1=page2

..and your code in the before form event will be something like:

Code: Select all

var pageName = fields.p1.value;
if (pageName)
{
  form.gotoPage(pages.getPage(pageName));
}
0 x

t4nu
Ebase User
Posts: 305
Joined: Thu Jul 02, 2015 8:32 am
Location: Indonesia

#3

Postby t4nu » Fri Jan 15, 2016 5:28 pm

Thanks for the explanation.
Is it applicable to the page too? What I mean is I need to send the page within the form that parameter (to be processed by that page).

Jon wrote:You set up a field in your form and make it a URL Parameter - this is an option in the field's properties. This means that you can pass this field's value on the URL that invokes the form. Then you check this value in a before form event and go to the appropriate page. So if the parameter field is p1, the URL (in V5) will be something like:

http://hostname:port/webapp/myForm.eb?p1=page2

..and your code in the before form event will be something like:

Code: Select all

var pageName = fields.p1.value;
if (pageName)
{
  form.gotoPage(pages.getPage(pageName));
}
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Fri Jan 15, 2016 6:20 pm

Is it applicable to the page too? What I mean is I need to send the page within the form that parameter (to be processed by that page).
This question doesn't apply in Ebase - field values are stored at form level and are automatically available to all pages within a form, you don't need to (and you can't) pass parameters to individual pages.

You can pass any number of parameters into a form when the form is started from a URL and these are then saved as form fields. You can use these if you want to route control to any specific page. If you want to do any processing before a page is displayed, you do this by adding a before page event - to do this, right click on a page in the Pages View and select events. Or alternatively you could do this processing in a before form event.
0 x

t4nu
Ebase User
Posts: 305
Joined: Thu Jul 02, 2015 8:32 am
Location: Indonesia

#5

Postby t4nu » Sat Jan 16, 2016 12:45 pm

Thanks a lot Jon,
It clear now, so I can take another approach to get what I want.
Jon wrote:
Is it applicable to the page too? What I mean is I need to send the page within the form that parameter (to be processed by that page).
This question doesn't apply in Ebase - field values are stored at form level and are automatically available to all pages within a form, you don't need to (and you can't) pass parameters to individual pages.

You can pass any number of parameters into a form when the form is started from a URL and these are then saved as form fields. You can use these if you want to route control to any specific page. If you want to do any processing before a page is displayed, you do this by adding a before page event - to do this, right click on a page in the Pages View and select events. Or alternatively you could do this processing in a before form event.
0 x


Who is online

Users browsing this forum: No registered users and 19 guests