![]() |
|
|
|||||||
| embarcadero.public.delphiphp.deployment This group is for discussing deployment of applications with Delphi for PHP. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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. |
| Sponsored Links |
|
|
|
||||
|
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. |
|
|||
|
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();
}
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
}
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
?>
Code:
ajaxCall(updateDetail, null , array("HFdocSelect", "dbgdocdetails"));
now is when I need your help because I do not want to use ajaxCall grateful for their time, Raudel excuse my English |
|
||||
|
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:
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. |