In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Help us give Edit and Delete Option in this project.

xaWeb forum (English / Spanish)
Responder
Milan Mehta
Mensajes: 150
Registrado: Dom Dic 27, 2009 9:54 am

Help us give Edit and Delete Option in this project.

Mensaje por Milan Mehta »

Dear Sir,

We are trying to follow the sample project given by you on this link : https://xaweb.ozs.es/cgi-bin/tablescrud.xaweb.
We tried to replicate the same with Maria data source (Backup of the same is there in the attached project).
Append facility is working fine. But Edit and Delete is not working.

Kindly help us to kick start the process of development in xaWeb.
TIA
Milan Mehta.
Adjuntos
xaweb_Bansel.rar
(492.62 KiB) Descargado 28 veces
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9472
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Help us give Edit and Delete Option in this project.

Mensaje por ignacio »

Hi,

//:OnSubmit := :SubmitToService( "Srv_TableEdit", .T. )

With this code commented is impossible to edit.

Regards,
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Milan Mehta
Mensajes: 150
Registrado: Dom Dic 27, 2009 9:54 am

Re: Help us give Edit and Delete Option in this project.

Mensaje por Milan Mehta »

We get error while we try to delete. It deletes the record in the database. But failes to refresh the screen, giving out following error :

Error on D:\Project\xaweb_Bansel\Bansal.xaweb: Argument error / + - BASE [1081]

Called from:
WDOCMAIN:RENDER(500)
WENGINE:RENDER(471)
(b)ZENGINE(121)
WENGINE:END(0)
WAPP:END(139)
(b)ZAPP(90)
WAPP:RUN(0)
MAIN(13)
Execute time in milliseconds: 22
Adjuntos
xaweb_Bansel.rar
(491.75 KiB) Descargado 33 veces
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9472
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Help us give Edit and Delete Option in this project.

Mensaje por ignacio »

Hi,

Sorry for the delay. Please confirm you are using the latest version 1.0.3 of xaWeb since the line 500 on zDoc.prg module is not on Render() method and is impossible to trace the error.

BTW, I highly appreciate if you can do a very little sample showing the problem. In any case I will try to create a version of the sample 73 using MariaDB.

Regards,
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Milan Mehta
Mensajes: 150
Registrado: Dom Dic 27, 2009 9:54 am

Re: Help us give Edit and Delete Option in this project.

Mensaje por Milan Mehta »

We are using version 1.0.3.
Please find attached a small self-contained example.
The database dump is also there in the attached file.
Kindly help us out.

TIA
Milan
Adjuntos
xaweb_Bansel.rar
(296.92 KiB) Descargado 18 veces
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9472
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Help us give Edit and Delete Option in this project.

Mensaje por ignacio »

Hello,
2025-08-28 18 20 26.png
2025-08-28 18 20 26.png (21.07 KiB) Visto 2707 veces
IMPORTANT NOTE: xaWeb services only return JSON strings.

Try this:

Código: Seleccionar todo

METHOD Srv_TableDelete( hPost ) CLASS WDocMain
   LOCAL hData := Engine:hCargo
   LOCAL nId := 0, cSql
   LOCAL hResult := {=>}

   IF HB_HHasKey( hData, "Vou. No." )
      nId := Val( hData[ "Vou. No." ] )
      IF nId > 0
         cSql := "DELETE FROM do WHERE vno = " + HB_ValToExp(nId)
         IF ::oDs:Execute(cSql)
            HB_HSet( hResult, "pass", .T. )
         ENDIF
      ENDIF
   ENDIF

RETURN HB_JsonEncode( hResult )
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Milan Mehta
Mensajes: 150
Registrado: Dom Dic 27, 2009 9:54 am

Re: Help us give Edit and Delete Option in this project.

Mensaje por Milan Mehta »

Thanks a lot. The problem is solved!
Just help a bit more. It did delete the record from the database.
However, browse still shows the record. How to refresh the screen ?

TIA
Milan.
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9472
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Help us give Edit and Delete Option in this project.

Mensaje por ignacio »



You need a TRUE web server. This video is done with XAMPP+Windows.

Regards

NOTE: Xailer IDE navigator does not support FETCH operations.
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Milan Mehta
Mensajes: 150
Registrado: Dom Dic 27, 2009 9:54 am

Re: Help us give Edit and Delete Option in this project.

Mensaje por Milan Mehta »

We are taking the same project forward.
Please find attached the self contained small example, where we are able to browse the records.
But when we click on Edit button, nothing happens.
Please help us out.

TIA

Milan Mehta.
Adjuntos
xaweb_Bansel.rar
(298.63 KiB) Descargado 13 veces
Milan Mehta
Mensajes: 150
Registrado: Dom Dic 27, 2009 9:54 am

Re: Help us give Edit and Delete Option in this project.

Mensaje por Milan Mehta »

gentle reminder to reply to the above query. thank you
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9472
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Help us give Edit and Delete Option in this project.

Mensaje por ignacio »

Hi,

Sorry for the delay. Could you try to update this JS file and tell me your results?

Regards,
xa_backpack.zip
(6.76 KiB) Descargado 4 veces
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Milan Mehta
Mensajes: 150
Registrado: Dom Dic 27, 2009 9:54 am

Re: Help us give Edit and Delete Option in this project.

Mensaje por Milan Mehta »

Yes, we did put this file into xaweb\source\js folder. But the problem still persists.

Please help us out. We are eagerly awaiting for your guidance.

TIA
Milan.
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9472
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: Help us give Edit and Delete Option in this project.

Mensaje por ignacio »

Hi,

- please pulse on the navigator: Shift+F5 serveral times.
- Push F12 and see if there is any error on the console. In case yes, send a screeen shoot
- Confirm on the navigator Dev tools this function source code:

Código: Seleccionar todo

function xa_disableTableControl(btn, value) {
   if (btn) {
      if (btn.nodeName == "BUTTON") {
         btn.disabled = value;
      } else {
         btn.classList.remove("disabled");
      }
      const syncro = document.getElementById(btn.dataset.syncro);
      if (syncro) {
         syncro.classList.remove("disabled");
      }
   }
}
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Milan Mehta
Mensajes: 150
Registrado: Dom Dic 27, 2009 9:54 am

Re: Help us give Edit and Delete Option in this project.

Mensaje por Milan Mehta »

Please see the attachment. This is the error we are getting.
Please help

TIA
Milan.
Adjuntos
Screenshot 2025-09-15 110714.png
Screenshot 2025-09-15 110714.png (125.7 KiB) Visto 16 veces
Responder