Jump to content

Passing control to another unigui application and go back


gesulmino

Recommended Posts

Hi,

From a unigui application (WebA) I should post some data to a url, another unigui application (WebB). WebB shows a form to ask some additional information to the user depending from url parameters, then returns control to the calling session in WebA indicating some return parameters. I hope I was clear.

Any suggestions or examples on this?

Link to comment
Share on other sites

On 6/28/2019 at 1:22 PM, Hayri ASLAN said:

Hi

Please check " HTTP Post Callback - URLFrame - Auto Target" demo

Key point is


Sc:=UniSession.CallbackUrlEx('mycallback', Self, ['RES', 'OK']);
S:=StringReplace(S, '{URL_CALLBACK}', Sc, []);

 

I tried this,

s := 'var f = document.createElement("form"); '+
    'f.action="'+UniServerModule.PIN_EndPoint+'/login"; '+ // the second app url
    'f.method="POST"; ';

  aUrl := UniSession.CallbackUrlEx('mycallback', Self, ['RES', 'OK'], true, false);

  s := s+
    'var i=document.createElement("input"); '+ // url_submit
    'i.type="hidden"; '+
    'i.name="url_submit"; '+
    'i.value="'+TNetEncoding.Url.Encode(Base64Encode(aUrl))+'"; '+
    'f.appendChild(i); ';

  aUrl := UniSession.CallbackUrlEx('mycallback', Self, ['RES', 'CANCEL'], true, false);

  s := s+
    'var i2=document.createElement("input"); '+ // url_cancel
    'i2.type="hidden"; '+
    'i2.name="url_cancel"; '+
    'i2.value="'+TNetEncoding.Url.Encode(Base64Encode(aUrl))+'"; '+
    'f.appendChild(i2); '+

    'document.body.appendChild(f); '+
    'f.submit(); ';

  UniSession.AddJS(s)

 

this show a form with some fields

but I obtain this result when I submit the form

http://localhost:8080/integra/HandleEvent?IsEvent=1&Obj=O0&Ajax=1&Evt=mycallback&RES=OK&_S_ID=5icJiog4CK1042A9E43&__EXCB__=1

Invalid session or session Timeout.

Restart application

what is wrong?

 

Link to comment
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...