NilovSerge
Posts: 16
|
| Posted: 11/26/2006, 1:30 AM |
|
Hallo!
In my CCS/PHP app I try before deleting of a row(Button_OnDelete_OnClick) verify if it is referenced
using xAjax library:
function Button_OnDelete_OnClick () {
...
xajax_ifCanDeleteRow( id, type );
// it means that in server php-function xajax_ifCanDeleteRow I verified if I can delete row
I set isCanDeleteRow equels 'Y' using method $objResponse->addAssign( 'isCanDeleteRow', "value", 'Y' );
...
var isCanDeleteRow= document.getElementById( "isCanDeleteRow" ).value;
if ( isCanDeleteRow== 'N' ) return;
return confirm('Delete Row?');
Problem is that in this case isCanDeleteRow(hidden input actually) does not see change in xajax_ifCanDeleteRow
In my prior php/JavaScript apps I made verification before deleting of a row like so:
function isCanDeleteDoc() { // called by "Delete" button
var cn;
cn= Trim(document.getElementById( "cn" ).value);
xajax_iscandeleterow( "LOV", cn ); // call server ajax-function if doc can be deleted
} // function isCanDeleteDoc() {
and if in xajax_iscandeleterow I verified that row can be deleted I run JavaScript with confirmation
and deleting of a row
function run_deleterow(cn) { // if server function "xajax_iscandeleterow" didn\'t found any restrictions then it calls
if ( !confirm("'.$DeletingCap.' ?") ) return false; // run_deleterow(cn) to confirm deletion of a doc
xajax_deleterow( "LOV", cn ); // call sever function to delete that doc
}
And that works fine as I can separate all routine in several JavaScipt/PHP functions!
And it is not working in CCS/PHP as all deleting routine is made in event function Button_OnDelete_OnClick.
What can I do here?
Maybe there is a better way to do verification?
_________________
With respect,
Nilov Serge. |
 |
 |
|