Syntax for modeless window from JavaScript??

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
RentProperty
Posts: 345
Joined: Mon Nov 12, 2012 9:08 pm
Location: South Africa

Syntax for modeless window from JavaScript??

Post by RentProperty »

Does any one know what the syntax look like to have render option: modeless window, when using awareApp.startProcess from custom html.

I've spent about an hour searching the forum now cause I know it was here somewhere but for the life of me I cannot find it. :-)

So basically I want to be able to do awareApp.startProcess('myProcess', modeless, margins: 0, center: true, scroll:true) or something like that.... Don't know what it should look like.

Thanks in advance!
Hein Hanekom & Werner Hanekom
Sinov8.net
AwareIM Version 5.9 | 6.0 | 7.0 | 7.1 (Windows EC2 R2012 & MySQL)
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Syntax for modeless window from JavaScript??

Post by idpSteve »

Hi all.

I'm looking for this now.. Anyone know where it is?
UnionSystems
Posts: 197
Joined: Fri Jun 17, 2016 7:10 am
Location: Brisbane Australia
Contact:

Re: Syntax for modeless window from JavaScript??

Post by UnionSystems »

This works for AwareApp.startProcess2

Code: Select all

AwareApp.startProcess2('myProcessName', 'myObjectName',  'myObjectID',  {modeless: true, position: {top: 100, right: 100 }  } );
AWS Linux, Windows Server, AIM 8.4 & 8.6
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Syntax for modeless window from JavaScript??

Post by idpSteve »

Awesome, thanks! This is what I was looking for:

{modeless: true, position: {top: 100, right: 100 } }
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Syntax for modeless window from JavaScript??

Post by idpSteve »

Hi All.

Does anyone know if there is a way to use this in a custom query template? I want a button to open a modal window, but using this syntax gives me an error "modeless: true, position: {top: 100} is not a valid attribute name" or whatever the message is when you put something that isn't an attribute name in { } brackets..

Thanks in advance..
UnionSystems
Posts: 197
Joined: Fri Jun 17, 2016 7:10 am
Location: Brisbane Australia
Contact:

Re: Syntax for modeless window from JavaScript??

Post by UnionSystems »

Create an AwareIM Process that calls EXEC_SCRIPT (example below calls javascript function AwareApp.startProcess2 passing the ID of an object in Context)

Code: Select all

EXEC_SCRIPT 'AwareApp.startProcess2(`Person_View`,`Person`,'+AS_STRING(Person.ID)+',{modeless: true, position: {top: 100, right: 100 }}); '
Then add an Operation (button) to your Query that calls that AwareIM Process.
AWS Linux, Windows Server, AIM 8.4 & 8.6
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Syntax for modeless window from JavaScript??

Post by idpSteve »

I would never have thought of that, thanks! I will let you know if I run into any trouble.

+1000 if it works ;)

One more thing, since this is a day of issue resolution, I presume modeless window isn't possible for ENTER NEW actions?
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Syntax for modeless window from JavaScript??

Post by idpSteve »

UnionSystems wrote:Create an AwareIM Process that calls EXEC_SCRIPT (example below calls javascript function AwareApp.startProcess2 passing the ID of an object in Context)

Code: Select all

EXEC_SCRIPT 'AwareApp.startProcess2(`Person_View`,`Person`,'+AS_STRING(Person.ID)+',{modeless: true, position: {top: 100, right: 100 }}); '
Then add an Operation (button) to your Query that calls that AwareIM Process.
This doesn't work for me.. Perhaps I'm doing something wrong? I did pretty much exactly what you said, just changing Person_View to my process name, and Person to my object name. I get a regular popup, not a modal window..

To confirm, I have a process saying "EDIT Object USING form_name" - this process has Object as an input.

I have a second process saying "EXEC_SCRIPT `AwareApp.startProcess2('Process_name','Object',`+AS_STRING(Object.ID)+`,{modeless:true,position:{top:60}}`" - also with Object as an input.

On my custom query I have a button that calls the second process, using:

<button class="..." onclick="AwareApp.startProcess2('second_process_name','Object',{ID},'main');">button_text</button>

Anything I'm missing?
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Syntax for modeless window from JavaScript??

Post by idpSteve »

Ok, so it seems I got something to work.. Not quite how I want but it will do for now.

I've now used html codes for { and }. These are { = &#123; and } = &#125; . I can then use the modal output syntax directly from my custom query. Here's what it looks like:

Code: Select all

AwareApp.startProcess2('Process_name','Object',{ID},&#123;modeless:true,position:&#123;top:60&#125;&#125;);"
I also needed to change my process from EDIT to VIEW. Not sure if this is why what @UnionSystems suggested wasn't working, but probably (I got a popup with the html codes and EDIT, as I did with the EXEC_SCRIPT solution.. so this quite probably was the issue).

For me using &#123; and &#125; seems like a bit less work than having an EXEC_SCRIPT process for this purpose.

Thought I'd post in case anyone else ends up here..

Thanks for the reply, @UnionSystems, and thanks to everyone who took the time to read this without replying too.
Post Reply