Delphi For PHP Forums       


Go Back   Delphi-PHP Forums > Delphi4PHP NNTP Newsgroups > embarcadero.public.delphiphp.deployment
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

embarcadero.public.delphiphp.deployment This group is for discussing deployment of applications with Delphi for PHP.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 29th August 2009, 10:15
sherri guthrie
Guest
 
Posts: n/a
Default Trying to access non-existant property Table->Active indbtables.inc.php, l

i'm a new user and am still learning my way around the software. however, this is the one thing that i cannot resolve. as long as i don't select masterfield, my apps run with no problem. once i set the masterfield, for a known primary key, i get the above error message. the only thing that i can find online is the same thing that is in the help files, which is where i started.

i'm attempting to create a master/detail datagrid, with "id" being the primary key in both tables. in the course of testing, i found that even with only one table in my app, if i set the masterfield it won't run and again i get the active error message.

database shows connected, and is registered.
datasource is set as active.
my table is set to active.
all are set to debug.

any help would be appreciated.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 29th August 2009, 13:32
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,273
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

People have problems with that all the time.

IMO the best way is for you to be the master running the details.

Try this demo script and double click on something in the left grid

405hp.net/d4php/tutcompare.php (This was comparing 2 ajax methods for a speed test.)

Double click on left gets a new right, uses basicAjax.
The button does the same uses vcl xajax.

This is the code to make the button click happen. (it also requires a hidden field to hold the selection)
PHP Code:
               function BitBtn1JSClick($sender, $params)
               {

               ?>
               document.getElementById('HFpbSelect').value=dbgpbindex.getTableModel().getValue(2,dbgpbindex.getFocusedRow());
               dbgpricebook.setFocusedCell(0, 0, true);
               dbgpricebook.getSelectionModel().setSelectionInterval(0, 0);
               <?php
                
echo $this->$dbgpbindex->ajaxCall(ajaxIndexclicked,null,array("HFpbSelect","dbgpricebook"));

               }
               function 
ajaxIndexclicked($sender$params)
               {
                
$this->QPricebook->LimitStart=0;
                
$this->QPricebook->LimitCount=100;
                
$sql="SELECT `prod` , `unit` , `size` ,`brand` , `descr` ,  `serving` , `servsize` , `servunit` , `onhand` , `duedate`, `has_2ndlines`, `has_pic`   FROM products  WHERE  prod >=".$this->HFpbSelect->value;
                
$this->QPricebook->SQL=$sql;
                
$this->QPricebook->Refresh();
               }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 8th December 2009, 20:33
D4PHP Newbie
 
Join Date: Oct 2009
Posts: 5
raudelsj is on a distinguished road
Default

Hello 405hp, I would like to see the method code that uses "basicAjax", if possible could show the code in Example tutcompare.php
Greetings and thanks in advance, Raudel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 8th December 2009, 22:19
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,273
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

This thread pretty much covers basicAjax
Basic Ajax for d4php

After you understand it, if you still have questions on how to do something just ask.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 9th December 2009, 18:10
D4PHP Newbie
 
Join Date: Oct 2009
Posts: 5
raudelsj is on a distinguished road
Default First of all thank you very much for your time spent helping the community

405hp
I did a demo application with two methods to update the details of a master table
The first ajaxCall used, works perfectly, using the click event of button "BajaxCall"

Code:
function BajaxCallJSClick($sender, $params)
   {

   ?>
   //Add your javascript code here
    document.getElementById('HFdocSelect').value=dbgdocindex.getTableModel().getValue(0,dbgdocindex.getFocusedRow());
    dbgdocdetails.setFocusedCell(0, 0, true);
    dbgdocdetails.getSelectionModel().setSelectionInterval(0, 0);
   <?php
     echo $this->$dbgdocindex->ajaxCall(updateDetail, null , array("HFdocSelect", "dbgdocdetails"));
   }

  function updateDetail($sender, $params)
   {
      $sql = "SELECT Doc.Id_Doc,  Doc.cMime_type,".
       "Doc.iDocSize,  Doc.cDoc FROM M_Img_Doc AS Doc ".
       "INNER JOIN R_Proyectos_Img_Doc AS Py ON Doc.Id_Doc = Py.Id_Doc ".
       "WHERE Py.IdProyecto = ". $this->HFdocSelect->value;
      $AutthDM = GetDBModule();
      $AutthDM->QDetails->LimitStart = 0;
      $AutthDM->QDetails->LimitCount = 100;
      $AutthDM->QDetails->SQL = $sql;
      $AutthDM->QDetails->Refresh();
   }
and the second used basicAjax, using the click event of button "BbasicAjax"

Code:
function BbasicAjaxJSClick($sender, $params)
   {

   ?>
   //Add your javascript code here
   function BeforeLoad()
    {
        if(xmlHttp.readyState==4)
          {
          if (xmlHttp.status == 200)
            {
           var myarray=xmlHttp.responseText.split(/\s*,\s*/);
           if (myarray[0]==1)  //run Ok
             {
               dbgdocdetails.setFocusedCell(0, 0, true);
               dbgdocdetails.getSelectionModel().setSelectionInterval(0, 0);
               w_wait.close();
              } else
              {
               w_wait.close();
               alert(myarray[1]);      //Show error
              }
            }
           else
            {
             alert("ocurrio un error al procesar la respuesta del servidor, intente de nuevo = "+xmlHttp.statusText);
             w_wait.close();
            }
          }
    }


   var params="1="+dbgdocindex.getTableModel().getValue(0,dbgdocindex.getFocusedRow());
   w_wait.open();//wait window

   basicAjax("ajaxLoadPyDoc.php",params,BeforeLoad);
   <?php

   }
The code "ajaxLoadPyDoc.php" is the next ...

Code:
<?php
require_once("udmAuth.php");
$ret = "";
$np = count($_POST);
if($np < 1)
{
   $ret = "-1,'Error de parámetros en la ejecución de la operación'";
   echo $ret;
   exit;
}
$p1 = $_POST[1];
$sql = "SELECT Doc.Id_Doc,  Doc.cMime_type,".
       "Doc.iDocSize,  Doc.cDoc FROM M_Img_Doc AS Doc ".
       "INNER JOIN R_Proyectos_Img_Doc AS Py ON Doc.Id_Doc = Py.Id_Doc ".
       "WHERE (Py.IdProyecto =$p1)";
$AutthDM = GetDBModule();
$AutthDM->QDetails->LimitStart = 0;
$AutthDM->QDetails->LimitCount = 100;
$AutthDM->QDetails->SQL = $sql;
$AutthDM->QDetails->Refresh();
$ret .= "1,'OK'";
echo $ret;//push data
?>
In this case everything runs well except that the details grid is not updated, it must be missing something, because in the method of ajaxCall

Code:
ajaxCall(updateDetail, null , array("HFdocSelect", "dbgdocdetails"));
controls are updated in the call

now is when I need your help because I do not want to use ajaxCall
grateful for their time, Raudel

excuse my English
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 9th December 2009, 20:45
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,273
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

When you controlling everything then you have to create everything.

So you have to build the grid rows yourself.

Assuming you want a new grid full of rows, this is my code from the test:
PHP Code:
<?php
// Return a reload for catalog dbgrid.
        
include("global.inc.php");
        require(
'tut3connectdb.php');

        
//All edits should only need done in this section -->

        
pt_register('GET','cus','prd');  //incoming information
        
$dbgridName="dbgpricebook";   //name of the dbgrid to load
        
$sql="SELECT `prod` , `unit` , `size` ,`brand` , `descr` ,  `serving` , `servsize` , `servunit` , `onhand` , `duedate`, `has_2ndlines`, `has_pic`   FROM products WHERE  prod >=".$prd." LIMIT 0 , 100";

        
//<--- All edits should only need done in this section


        
$result=mysql_query($sql);
        if (!
$result)
           {
           
sqlErrors($sql);
           echo 
'null';
           exit;
           }
//these next two lines are used with easyGrid mods for formatting 
        
$grid_ajax_off=1;   //turns off no-object errors in layout file
        
if (file_exists($dbgridName.".layout.php")) $gridOPTIONS=include "dbgpricebook.layout.php";


           echo 
'var rowData = [];';
         while(
$rvalues=mysql_fetch_row($result))
               {

?>
rowData.push([<?php
                                        reset
($rvalues);
                                        
$i=0;
                                        while (list(
$k,$v)=each($rvalues))
                                        {

                                                
$v=str_replace("\n\r",'\n',$v);
                                                
$v=str_replace("\n",'\n',$v);
                                                
$v=str_replace("\r",'',$v);
                                                
$v=str_replace('"','\"',$v);
                                                
$v=str_replace("\\",'\\',$v);
                                                
$v=str_replace('<','\<',$v);
                                                
$v=str_replace('>','\>',$v);
                                                if (
$i>0) echo ",";

                                                
$numeric=false;
                                                
$decmal=false;
                                                
$boolean=false;
                                                 if (
$gridOPTIONS && $gridFLAGnumber$numeric=$grid_number[$i];
                                                 if (
$gridOPTIONS && $gridFLAGdecmal$decmal=$grid_decmal[$i];
                                                 if (
$gridOPTIONS && $gridFLAGboolean$boolean=$grid_boolean[$i];
                                                 if (
$boolean)
                                                          {    
//for boolean conversion for javascript
                                                          
if ($v==1$v='true'; else $v='false';
                                                          
$numeric=true//don't wrap it in quotes
                                                          
}
                                                if (!
$numeric) echo '"'.$v.'"';
                                                     else
                                                         {
                                                         if (
$decmal) echo "numberformatAmount.format($v)";
                                                           else echo 
$v;
                                                         }
                                                
$i++;

                                        }
                        
?>]);
<?php
                
}
                echo 
"$dbgridName.getTableModel().setData(rowData);";
?>

This works with the eval version of basicAjax - meaning you would have to add your code to do the w_wait.close(); stuff.

I never include any part of the vcl as that just slows the process down.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11th December 2009, 19:13
D4PHP Newbie
 
Join Date: Oct 2009
Posts: 5
raudelsj is on a distinguished road
Default

Well, now if all goes well, fast and without using the AjaxCall
Grateful and believe me the world need more people like you.
Raudel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 19:21.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use