block__ methods not called for child tables?

A place for users and developers of the Xataface to discuss and receive support.

block__ methods not called for child tables?

Postby rugcutter » Tue Mar 02, 2010 1:31 pm

Going from a previous example, I have two tables in my application. The project_mstr table is a parent table, and project_agreements is a child table that has a foreign key column "pa_project_id" that links back to the project_mstr table.

I set up the relationships.ini for project_mstr as follows:

Code: Select all
[Agreements]
project_agreements.pa_project_id = "$pm_project_id"



What is curious is, when I implement certain block__ methods within the delegate class for the child table (in this case, project_agreements) - they don't seem to be invoked. However when I implement them for the parent table (in this case, project_mstr), it works as designed.

Specifically, I'm trying to set up the block__custom_javascripts() block. Some sample code:

Code: Select all
    function block__custom_javascripts()
   {
      echo '<script src="js/myjavascript.js" type="text/javascript" language="javascript"></script>';
      echo 'STOPPING THE RESPONSE NOW';
      exit;
   }


For the parent table, the browser shows "STOPPING THE RESPONSE NOW" but for the child table the browser paints the page as if the method was not implemented at all.

Is there another way I should be including my child-table specific javascripts?
rugcutter
 
Posts: 11
Joined: Thu Apr 23, 2009 9:43 pm

Re: block__ methods not called for child tables?

Postby shannah » Wed Mar 03, 2010 3:38 pm

Did you implement this block in your application delegate class or one of your table's delegate classes?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: block__ methods not called for child tables?

Postby rugcutter » Thu Mar 04, 2010 8:03 am

Hi Steve -

There are three places where I tried implementing the block:

* Application Delegate Class = Works
* Parent Table Delegate Class = Works
* Child Table Delegate Class = Does not work


Thanks in advance!
rugcutter
 
Posts: 11
Joined: Thu Apr 23, 2009 9:43 pm

Re: block__ methods not called for child tables?

Postby shannah » Thu Mar 04, 2010 5:46 pm

Actually that is the correct behavior. Blocks defined in delegate classes generally only apply if the the current table (i.e. the table specified by -table) is for that delegate class.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 24 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved