Jump to content

Form with UniURLFrame


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 post
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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...