<div dir="ltr"><div>Yes, you all right!...I am try it ....my problem :<br></div><div>...for example...I declare >>>>><br></div><div>type</div> gsolicitud : TJSIDBOpenDBRequest; <br> gMyDB : TIDBDatabase;<br><br>function fOpenDB(aEvent: TEventlistenerEvent): Boolean; <br><div>begin</div>(* inside event handler I need get params retorned from request *)<br><div>gMyDB := aEvent.target; <==== but this does not works for me<br> gMyDB := gsolicitud.resultAsDatabase; <==== so I must try this !!! :-( but it is not correct!<br>end;<br><br>begin<br> ......<br> gsolicitud := Window.indexedDB.open(gDBName,4); <<<< I requesting for this event <br> gsolicitud.onsuccess := @fOpenDB; <<< and set this function to handles this event<br> ......<br>end; <br><br>When I go to the event handler function I try get params returned through aEvent.target ( gMyDB := aEvent.target; ) but compiler tells type missmacthed!, then I just try solve it do some thing like this ( gMyDB := gsolicitud.resultAsDatabase; )....it is not just in this case ...it happend to me always that I need recover a param inside of an event handler function...so if some one has an answer about it please illustrate me..THANKS </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El sáb., 21 sept. 2019 a las 12:17, Michael Van Canneyt (<<a href="mailto:michael@freepascal.org">michael@freepascal.org</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On Fri, 20 Sep 2019, Pedro Pablo Oviedo Vera wrote:<br>
<br>
> Hello people!,<br>
> Im facing this problem:<br>
><br>
> var<br>
> fTransPeliculas: TJSIDBTransaction;<br>
> fTransAlmacen : TJSIDBObjectStore;<br>
> fSolicitud : TJSIDBRequest;<br>
> begin<br>
><br>
> (......)<br>
><br>
> fTransPeliculas := gMyDB.transaction(['peliculas'],'readwrite');<br>
> fTransAlmacen := fTransPeliculas.objectStore('peliculas');<br>
><br>
> gInfo.clave := gedtClave.value;<br>
> gInfo.anno := gedtFecha.value;<br>
> gInfo.texto := gedtTexto.value;<br>
><br>
> fSolicitud := fTransAlmacen.add(gInfo,'clave');<br>
><br>
> but from browser consola I recieve the message:<br>
> DataError: Data provided to an operation does not meet requirements.<br>
><br>
> but when use this alternative....<br>
> asm<br>
> fSolicitud =<br>
> fTransAlmacen.add({id:$mod.gInfo.clave,nombre:$mod.gInfo.texto,fecha:$mod.gInfo.anno});<br>
> end;<br>
><br>
> everything works!!!!<br>
> perhaps fSolicitud := fTransAlmacen.add(gInfo,'clave'); is<br>
> incorrepts ...then how it will be OK?<br>
<br>
first of all, you are doing things very differently<br>
- your asm code does not provide a key, your pascal code does.<br>
- the structure of the object you are saving is very different.<br>
<br>
Secondly, to know why it goes wrong, we need to know what is the definition of the<br>
object store.<br>
<br>
Maybe this answers your question:<br>
<a href="https://stackoverflow.com/questions/36016862/indexeddb-dataerror-data-provided-to-an-operation-does-not-meet-requirements" rel="noreferrer" target="_blank">https://stackoverflow.com/questions/36016862/indexeddb-dataerror-data-provided-to-an-operation-does-not-meet-requirements</a><br>
<br>
Michael.<br>
_______________________________________________<br>
Pas2js maillist - <a href="mailto:Pas2js@lists.freepascal.org" target="_blank">Pas2js@lists.freepascal.org</a><br>
<a href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js" rel="noreferrer" target="_blank">https://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><pre style="color:rgb(0,0,0);font-variant:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px">MSc. Ing. Pedro Pablo Oviedo Vera
Dirección Técnica y Desarrollo
Empresa de Proyectos e Ingeniería del
Ministerio de la Agricultura.ENPA.
Boyeros y Conill, Piso 10 Edif MINAG
Telef. 884 7197
SIP:23000116</pre></div></div>