Display detail view only?
-
- Posts: 8
- Joined: 2013-04-05 09:23
Display detail view only?
I have a Settings table which has only one record, and will never have more than one record.
I would like the user to see the detail view immediately, without having to click on the record. I've looked at the hooks, but there doesn't seem to be any obvious way to do it.
a) Is there any way to display only the detail view and not the browse view for this table?
b) If not, is there a way to automatically select the record and display both views immediately when the user goes to that table?
Many thanks!
I would like the user to see the detail view immediately, without having to click on the record. I've looked at the hooks, but there doesn't seem to be any obvious way to do it.
a) Is there any way to display only the detail view and not the browse view for this table?
b) If not, is there a way to automatically select the record and display both views immediately when the user goes to that table?
Many thanks!
Re: Display detail view only?
Welcome to the forum. It's gone a bit quiet over the Easter break but maybe your post will wake a few people up
Have you tried using "Don't show in Detail View" or Don't show in Table View"? I have no idea how the screen will display because I'm moving house and answering from my Netbook that doesn't have Appgini installed. I have a similar one-liner in End of financial year. I fill this in as admin and show it as a display field on a form.
Regards,
John
Have you tried using "Don't show in Detail View" or Don't show in Table View"? I have no idea how the screen will display because I'm moving house and answering from my Netbook that doesn't have Appgini installed. I have a similar one-liner in End of financial year. I fill this in as admin and show it as a display field on a form.
Regards,
John
-
- Posts: 8
- Joined: 2013-04-05 09:23
Re: Display detail view only?
Thanks for your reply, John. I've tried that but it doesn't work.
What I really need is an easy way to change the link from the home page, so that it goes directly to the detail view. And then also remove the 'Back' button from the detail view.
What I really need is an easy way to change the link from the home page, so that it goes directly to the detail view. And then also remove the 'Back' button from the detail view.
-
- Posts: 8
- Joined: 2013-04-05 09:23
Re: Display detail view only?
Ok - worked out how to do it:
1. Hide table in Home Page and Nav Menu
2. Insert links in links-home.php and links-nav.php pointing to table_view.php?SelectedID=1
3. Detail view on separate page
4. Comment out 'Back' button in table_dml.php
1. Hide table in Home Page and Nav Menu
2. Insert links in links-home.php and links-nav.php pointing to table_view.php?SelectedID=1
3. Detail view on separate page
4. Comment out 'Back' button in table_dml.php
Re: Display detail view only?
Thanks for the reply and thanks for sharing your solution. it's amazing how many people don't. Forums are all about helping each other and that's just what you've done. Just one quick question to tie it altogether though. Can you supply the full line(s) of code you entered in each of the files in step 2 or is that it? It could help someone else - including muggins
John
John
-
- Posts: 8
- Joined: 2013-04-05 09:23
Re: Display detail view only?
Here is the code in step 2 - it's very simple:Johnk wrote:Thanks for the reply and thanks for sharing your solution. it's amazing how many people don't. Forums are all about helping each other and that's just what you've done. Just one quick question to tie it altogether though. Can you supply the full line(s) of code you entered in each of the files in step 2 or is that it? It could help someone else - including muggins
John
In links-home.php I put
Code: Select all
$homeLinks[] = array(
'url' => 'settings_view.php?SelectedID=1',
'title' => 'Settings',
'description' => '<br/>Global settings',
'groups' => array('*')
);
Code: Select all
$navLinks[] = array(
'url' => settings_view.php?SelectedID=1',
'title' => 'Settings',
'groups' => array('*')
);
Re: Display detail view only?
Or you could apply a default filter as per this tutorial:
http://bigprof.com/appgini/tips-and-tut ... ult-filter
http://bigprof.com/appgini/tips-and-tut ... ult-filter
-
- Posts: 8
- Joined: 2013-04-05 09:23
Re: Display detail view only?
No, a filter won't work. I don't want the user to see the table view at all, only the detail view.peebee wrote:Or you could apply a default filter as per this tutorial:
http://bigprof.com/appgini/tips-and-tut ... ult-filter
-
- Posts: 3
- Joined: 2014-05-01 20:40
Re: Display detail view only?
I've been scouring the web for this exact issue. I saw that the OP has a workaround, but that also assumes that the record has been created before creating the hook. For example, if SelectedID=2 does not exist, then nothing will show on this page.
Surely there's a "proper" way to handle "Settings" type pages, no? I have criteria needed to save to ONE record per registered user. I don't want the user to create more than 1 record, I just want them to update one record. Does that make sense?
Surely there's a "proper" way to handle "Settings" type pages, no? I have criteria needed to save to ONE record per registered user. I don't want the user to create more than 1 record, I just want them to update one record. Does that make sense?
-
- AppGini Super Hero
- Posts: 54
- Joined: 2014-03-09 20:20
Re: Display detail view only?
Yes, this does make sense - For example, a record of a patient's death should occur once and once only!
-
- Posts: 26
- Joined: 2014-05-01 12:57
Re: Display detail view only?
How are you guys handling the SelectID? Doesn't the detail view require an ID to view? Is everybody being sent to the same record or what? Though I could see this being useful for settings and configurations tables in AppGini applications. A table where you may only have a single record that can be viewed or modified but no extra records can be created.
-
- Posts: 26
- Joined: 2014-05-01 12:57
Re: Display detail view only?
"Postby sethnewton » 01 May 2014, 15:46
I've been scouring the web for this exact issue. I saw that the OP has a workaround, but that also assumes that the record has been created before creating the hook. For example, if SelectedID=2 does not exist, then nothing will show on this page.
Surely there's a "proper" way to handle "Settings" type pages, no? I have criteria needed to save to ONE record per registered user. I don't want the user to create more than 1 record, I just want them to update one record. Does that make sense?"
I have used similar systems to this. That is easily accomplished by letting the user only view/modify but not delete THEIR record in the table through member group permissions. As an admin you can create a default record for the user and assign ownership to that user. Again, they cannot create new records so they should only see the one record that is available to them. You can use this menulinks method to show direct link to that record to top it all off.
I've been scouring the web for this exact issue. I saw that the OP has a workaround, but that also assumes that the record has been created before creating the hook. For example, if SelectedID=2 does not exist, then nothing will show on this page.
Surely there's a "proper" way to handle "Settings" type pages, no? I have criteria needed to save to ONE record per registered user. I don't want the user to create more than 1 record, I just want them to update one record. Does that make sense?"
I have used similar systems to this. That is easily accomplished by letting the user only view/modify but not delete THEIR record in the table through member group permissions. As an admin you can create a default record for the user and assign ownership to that user. Again, they cannot create new records so they should only see the one record that is available to them. You can use this menulinks method to show direct link to that record to top it all off.
Re: Display detail view only?
I think your problem is very simple.
Try this, if it fulfils your requirement.
in file tablename_view,php, find this line
$x->SeparateDV = 1;
change this to
$x->SeparateDV = 0;
this will show detail view just below the table view.
also if you are sure that this table will never have more than 1 record, you can find the line
$x->RecordsPerPage = 10;
change this to
$x->RecordsPerPage = 2;
Please confirm, if this fulfils your requirement.
Try this, if it fulfils your requirement.
in file tablename_view,php, find this line
$x->SeparateDV = 1;
change this to
$x->SeparateDV = 0;
this will show detail view just below the table view.
also if you are sure that this table will never have more than 1 record, you can find the line
$x->RecordsPerPage = 10;
change this to
$x->RecordsPerPage = 2;
Please confirm, if this fulfils your requirement.
-
- AppGini Super Hero
- Posts: 121
- Joined: 2020-02-16 16:29
Re: Display detail view only?
Has anyone found a solution for this?
Re: Display detail view only?
Just redirect the user in the hooks/TABLENAME.php -> _init function to the detail view.
To do so, check if the request contains already a SelectedID, if so no action required, otherwise, retrieve the correct PK for the user and redirect to the
TABLENAME_view.php?SelectedID=ID_FOR_THIS_USER
To do so, check if the request contains already a SelectedID, if so no action required, otherwise, retrieve the correct PK for the user and redirect to the
TABLENAME_view.php?SelectedID=ID_FOR_THIS_USER
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Display detail view only?
Hi,
I admit not reading everything from above. Can't you use in AG: "Detailview in seperate page" AND in the hooks/tablename.php -> _init function this:
This way I am showing some program settings to the user without any tableview.
In the hooks/tablename.php -> before_insert function I also set a)
and in the before_delete function b)
This a) disables adding a new record and b) removing the current (only) record.
Olaf
I admit not reading everything from above. Can't you use in AG: "Detailview in seperate page" AND in the hooks/tablename.php -> _init function this:
Code: Select all
$options->SeparateDV = 1; // 1= seperate DV, 0= TV+DV on one page
In the hooks/tablename.php -> before_insert function I also set a)
Code: Select all
return false
and in the before_delete function b)
Code: Select all
return false
This a) disables adding a new record and b) removing the current (only) record.
Olaf
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view