Jump to content

Form with UniURLFrame


TAURO

Recommended Posts

When an form with a UniURLFrame, that load at runtime, is completely loaded and a function scripts js enabled

for execute.??

When execute with a button's click the function exists but  if execute at event FormReady  not exist yet.

This is the example

In Html Code:

        function PonerDireccion(Direccion) {
            document.getElementById("geocomplete").value = Direccion;
                      }

In delphi:

procedure TFAutoGeoReferencia.UniFormShow(Sender: TObject);
begin
  UniSession.AddJS(UniURLFrame1.JSName+'.iframe.contentWindow.PonerDireccion("'+Domicilio+'"); ');

end;
Here the function not exists yet

Here yes exists and execute, work fine!!

procedure TFAutoGeoReferencia.uniBtn1Click(Sender: TObject);
begin
     UniSession.AddJS(UniURLFrame1.JSName+'.iframe.contentWindow.PonerDireccion("26 Nro 1785"); ');

end;
 

 

Link to comment
Share on other sites

Hello,

2 hours ago, TAURO said:

When an form with a UniURLFrame, that load at runtime, is completely loaded and a function scripts js enabled

for execute.??

Sorry, maybe I didn't quite understand your question, but you need use this event I guess:

procedure TMainForm.UniURLFrame1FrameLoaded(Sender: TObject);
begin

end;

 

Link to comment
Share on other sites

Thanks

Yes you understand, but why in this event

procedure TFAutoGeoReferencia.UniURLFrame1FrameLoaded(Sender: TObject);
begin
  UniSession.AddJS(UniURLFrame1.JSName+'.iframe.contentWindow.PonerDireccion("'+Domicilio+'"); ');

end;

occurs the same

Ajax error

O243.iframe.contentWindow.PonerDireccion is not a function

when the function is available for use without button's click???

Why function is only available for button's click but before is not available...???

Link to comment
Share on other sites

Thanks

Yes you understand, but why in this event

procedure TFAutoGeoReferencia.UniURLFrame1FrameLoaded(Sender: TObject);
begin
  UniSession.AddJS(UniURLFrame1.JSName+'.iframe.contentWindow.PonerDireccion("'+Domicilio+'"); ');

end;

occurs the same

Ajax error

O243.iframe.contentWindow.PonerDireccion is not a function

when the function is available for use this without button's click???

 

Hi,

here attach a test, with two buttons, one in the html code and other from the UniGui's palette,

In the event FrameLoaded the function not work, not trigger the message but can be seen with the browser

in debug mode (F12)

(index):37 Uncaught TypeError: O13.iframe.contentWindow.PonerDireccion is not a function

 

Test.rar

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...