Tables

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

azaleas
Ebase User
Posts: 81
Joined: Thu Jul 30, 2015 12:44 pm

Tables

#1

Postby azaleas » Sun Aug 09, 2015 11:50 am

I want to hyperlink the ID of the table (ID key) to the field in another page.
So, if i click the ID in the table, I go to another page, where all details of that ID are fetched from the DB.

How can I achieve that?
0 x

Hovik
Moderator
Moderator
Posts: 184
Joined: Tue Sep 11, 2007 8:58 am

#2

Postby Hovik » Mon Aug 10, 2015 10:09 am

2 steps:

1) Add the table columns to the 'DETAILS' page as normal fields. i.e. just drag the columns and drop them somewhere on the page.

2) The ID hyperlink needs to run a script which says:

Code: Select all

      form.gotoPage(pages.DETAILS);

      // Note: No need to do another fetch
0 x

azaleas
Ebase User
Posts: 81
Joined: Thu Jul 30, 2015 12:44 pm

#3

Postby azaleas » Wed Aug 12, 2015 7:39 am

Hovik wrote:2 steps:

1) Add the table columns to the 'DETAILS' page as normal fields. i.e. just drag the columns and drop them somewhere on the page.

2) The ID hyperlink needs to run a script which says:

Code: Select all

      form.gotoPage(pages.DETAILS);

      // Note: No need to do another fetch
But, what if I already have the fields? For example, the profile page in Ebase Training Sessions. Suppose I have a table on another page which shows the Users added (So, it's a copy of a Profile Database, connected to Profile table on another page). Now, I've a link ID on the table. All I want is to click to the ID, and the table data (particular row) goes/gets copied to the fields in the Profile page.


Right now all I got is this:

fields.FIELD_NAME.value = tables.TABLE_NAME.COLUMN_NAME.value;
.
.

//for each field on the page.

form.gotoPage(pages.DETAILS);


Can I use something else?
0 x

Hovik
Moderator
Moderator
Posts: 184
Joined: Tue Sep 11, 2007 8:58 am

#4

Postby Hovik » Thu Aug 13, 2015 9:11 am

In this scenario, you have 2 options:

1) Copy the row values into the field values, as you are already doing.
Uses more code but is the most efficient way.

2) Use a single row DB resource which has a where clause ID=&&ID. Map all resource fields to the fields on the DETAILS page, and do a fetch on this resource.
Less code but you're adding a new resource and mappings to the form. Also another DB access.


In both cases, if you later decide you need more fields on the DETAILS page, you will need do some work.
It's a judgement between which approach gives you the quickest development time and/or needs less resource at run time.
0 x


Who is online

Users browsing this forum: Bing [Bot] and 8 guests