Page 1 of 1

show all

PostPosted: Wed Jun 18, 2008 10:10 am
by fantomasdm
Hi I have a question about showall button.
If I press it when see a records on a relative table, return to view all records of table and not only relative records. Is possible to view only relative records? Or to catch showAll event for redirect on other url/action?

My English is very bed! I wish that is understable!!

PostPosted: Wed Jun 18, 2008 7:46 pm
by shannah
So you want a "Show All" for related records. The Show All button does something slightly different than what you are thinking here. It clears all search and find queries so that the entire table becomes the "found set".

With related records (until recently) you couldn't filter the related records or do finds on them. (in 1.0 you can do keyword searches by clicking the little magnifying glass above the related list - but you clear the searches a different way).

Hence I think perhaps you are looking for a way to increase the number of related records per page to show all of the records -- the default is 30 records per page.

Am I correct?

-Steve

PostPosted: Thu Jun 19, 2008 6:16 am
by fantomasdm
I whant to disable Show All, becose in conf.ini I have to see only one table, and from here, by relationship, other relative records on other tables, but only from parents table!

Sorry for my very bad english...
Thanks for help!

PostPosted: Thu Jun 19, 2008 8:33 am
by shannah
Add an empty section to your application's actions.ini file (create it if it doesn't already exist):

Code: Select all
[show_all]


What this does is create a new show_all actions that is empty that overwrites the default action.

This will get rid of it.

-Steve

PostPosted: Thu Jun 19, 2008 11:51 pm
by fantomasdm
Hi, thanks for hlep,
Is possible to do something like this:

Code: Select all
[show_all]
url = "{$this->url('-action=related_records_list&assistitoID=$_SESSION[\"idanagrafica\"]&-relationship=Autopsia')}"


I try to add this but ShowAll fade away!

PostPosted: Fri Jun 20, 2008 7:08 am
by shannah
You have the right idea, but just need a couple more pieces of info.

If you define an action [show_all] in your actions.ini file it overwrites the previous action named [show_all] that was defined in the dataface actions.ini file. What you want to do is extend and override the action.

You do that with the following:

[show_all > show_all]

That way it keeps all of the definitions from the dataface actions.ini file and allows you to add your own parameters.

e.g.

Code: Select all
[show_all > show_all]
url = "{$this->url('-action=related_records_list&assistitoID=$_SESSION[\"idanagrafica\"]&-relationship=Autopsia')}"


You may have to tinker with the url you specified too to make it work that way you want.

-Steve

PostPosted: Mon Jun 23, 2008 11:59 pm
by fantomasdm
Hi,before all, thanks for your help!
If I use this:
Code: Select all
[show_all > show_all]
url = "{$this->url('-action=related_records_list&assistitoID=$_SESSION[\"idanagrafica\"]&-relationship=Autopsia')}"


I get this error:
Fatal error: ActionTool::getAction() requires 'name' parameter to be specified. in C:\xampp\htdocs\xataface-1.0-beta-3\Dataface\ActionTool.php on line 94
the link is: http://inmilss007/GestPatologia/index.p ... =istologia

so I prefer to create my own ShowAll Action like this:

Code: Select all
class actions_myShowAll  {
    function handle(&$params)
    {
      $app =& Dataface_Application::getInstance();
      $record =& $app->getRecord();
      $relation= ucfirst($record->_tablename);
      $url =  '?-action=related_records_list&assistitoID='.$record->val('idanagrafica')."&-relationship=".$relation;
      header ('Location: '.$url);
      exit;
    }
}


and using it on action.ini:
Code: Select all
[show_all > show_all]
url = "{$this->url('-action=myShowAll')}"


but if there is a better way to do it please give it to me!
Very sorry for my English!!

PostPosted: Tue Jun 24, 2008 10:04 am
by shannah
I get this error:
Fatal error: ActionTool::getAction() requires 'name' parameter to be specified. in C:\xampp\htdocs\xataface-1.0-beta-3\Dataface\ActionTool.php on line 94
the link is: http://inmilss007/GestPatologia/index.p ... =istologia

Do you get this after you click on your show_all button, or before.


-Steve

PostPosted: Tue Jun 24, 2008 11:38 pm
by fantomasdm
after click on mine show_all button!