Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Calling a JavaScript function from a POD

7 posts in General Discussion Last posting was on 2005-07-26 23:54:49.0Z
Dave Wilson Posted on 2005-07-19 00:50:44.0Z
From: Dave Wilson <murrgon@hotmail.com>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Calling a JavaScript function from a POD
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: i216-58-64-231.igs.net
Message-ID: <42dc4e60$1@forums-2-dub>
X-Original-Trace: 18 Jul 2005 17:50:40 -0700, i216-58-64-231.igs.net
Lines: 7
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 18 Jul 2005 17:50:41 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 18 Jul 2005 17:50:44 -0700
X-Trace: forums-1-dub 1121734244 10.22.108.75 (18 Jul 2005 17:50:44 -0700)
X-Original-Trace: 18 Jul 2005 17:50:44 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:467
Article PK: 8895

Is it possible to call a JavaScript function from a POD? The
documentation doesn't say anything about it so I am assuming
that it is not possible. However, if anyone knows of any way
to accomplish this, a short example would be greatly appreciated.

Thank You
Dave


Greg Fenton Posted on 2005-07-19 15:39:17.0Z
From: Greg Fenton <greg.fenton_NOSPAM_@ianywhere.com>
Organization: iAnywhere Solutions Inc.
User-Agent: Mozilla Thunderbird 1.6.3.2f (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: Calling a JavaScript function from a POD
References: <42dc4e60$1@forums-2-dub>
In-Reply-To: <42dc4e60$1@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: gfenton-t30.sybase.com
X-Original-NNTP-Posting-Host: gfenton-t30.sybase.com
Message-ID: <42dd1ea5$1@forums-1-dub>
Date: 19 Jul 2005 08:39:17 -0700
X-Trace: forums-1-dub 1121787557 10.25.98.243 (19 Jul 2005 08:39:17 -0700)
X-Original-Trace: 19 Jul 2005 08:39:17 -0700, gfenton-t30.sybase.com
Lines: 21
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:470
Article PK: 8896


Dave Wilson wrote:
> Is it possible to call a JavaScript function from a POD? The
> documentation doesn't say anything about it so I am assuming
> that it is not possible. However, if anyone knows of any way
> to accomplish this, a short example would be greatly appreciated.
>

A POD can use getElementById() on the current document to get a handle
to a given DOM object. So what you can do is put a <form> on your page
(set to invisible if you don't want the user seeing it) and submit the
form. Then have an onSubmit JS function for that form.

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/


Dave Wilson Posted on 2005-07-23 18:12:25.0Z
From: Dave Wilson <murrgon@hotmail.com>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: Calling a JavaScript function from a POD
References: <42dc4e60$1@forums-2-dub> <42dd1ea5$1@forums-1-dub>
In-Reply-To: <42dd1ea5$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: i216-58-65-160.igs.net
Message-ID: <42e28884$1@forums-2-dub>
X-Original-Trace: 23 Jul 2005 11:12:20 -0700, i216-58-65-160.igs.net
Lines: 44
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 23 Jul 2005 11:12:23 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 23 Jul 2005 11:12:25 -0700
X-Trace: forums-1-dub 1122142345 10.22.108.75 (23 Jul 2005 11:12:25 -0700)
X-Original-Trace: 23 Jul 2005 11:12:25 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:482
Article PK: 8907


Greg Fenton wrote:
> A POD can use getElementById() on the current document to get a handle
> to a given DOM object. So what you can do is put a <form> on your page
> (set to invisible if you don't want the user seeing it) and submit the
> form. Then have an onSubmit JS function for that form.

I tried this, but I am having some difficulty getting the DOM of the
current document. This is what I did:

// Get the document manager from the app
PODSDocumentMgr* pDocMgr = PODSgetDocumentMgr(pAvantGo);

// Get the document enumerator from the document manager
PODSDocumentEnumerator* pDocEnumerator =
PODScreateDocumentEnumerator(pDocMgr);

// Get the first document
PODSDocument* pDoc = PODSnextDocument(pDocEnumerator);

// Search for the HTLM document that has our content
while (NULL != pDoc)
{
if (PODS_HTML_TYPE == PODSgetContentType(pDoc) &&
0 == stricmp(TXT("DataTest"), PODSgetTitle(pDoc)))
{
break;
}

pDoc = PODSnextDocument(pDocEnumerator);
}

if (NULL != pDoc)
{
// We found the document, now get the DOM from it
ADOMHTMLDocument* pHTMLDoc = PODSgetDom(pDoc);
if (NULL == pHTMLDoc)
return; // DOM was unavailable

ADOMElement* pElement =
ADOMgetElementById(pHTMLDoc, "DataReceivedForm");
}

The problem I am having is that PODSgetDom() always returns NULL.
Is this the correct way to go about it? Thank you.


Dave Wilson Posted on 2005-07-26 23:54:49.0Z
From: Dave Wilson <murrgon@hotmail.com>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: Calling a JavaScript function from a POD
References: <42dc4e60$1@forums-2-dub> <42dd1ea5$1@forums-1-dub> <42e28884$1@forums-2-dub>
In-Reply-To: <42e28884$1@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: i216-58-90-132.igs.net
Message-ID: <42e6cd45@forums-2-dub>
X-Original-Trace: 26 Jul 2005 16:54:45 -0700, i216-58-90-132.igs.net
Lines: 20
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 26 Jul 2005 16:54:47 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 26 Jul 2005 16:54:49 -0700
X-Trace: forums-1-dub 1122422089 10.22.108.75 (26 Jul 2005 16:54:49 -0700)
X-Original-Trace: 26 Jul 2005 16:54:49 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:484
Article PK: 8905


Dave Wilson wrote:
>> A POD can use getElementById() on the current document to get a handle
>> to a given DOM object. So what you can do is put a <form> on your
>> page (set to invisible if you don't want the user seeing it) and
>> submit the form. Then have an onSubmit JS function for that form.

Okay I managed to get this to work by getting the DOM from the window.
So now I can call ADOMgetElementById() to get the form element and
call ADOMsubmit() with it. This however does *not* call the javascript
function I have setup for the form to call in the onsubmit attribute.
The client seems to trap the submission and it pops up an alert saying:

"Your submission has been recorded and will be sent during the next
Synchronization."

I know I'm not generating that message so the M-Business client must
be. Is there some way to get around this?

Thank you
Dave


Shuchit Posted on 2005-07-19 16:51:07.0Z
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: Calling a JavaScript function from a POD
From: Shuchit <me@privacy.net>
References: <42dc4e60$1@forums-2-dub>
Message-ID: <Xns969882485B23Csvelkarprivacynet@127.0.0.1>
User-Agent: Xnews/??.01.30 Hamster/2.0.6.0
NNTP-Posting-Host: svelkar-pc.sybase.com
X-Original-NNTP-Posting-Host: svelkar-pc.sybase.com
Date: 19 Jul 2005 09:51:07 -0700
X-Trace: forums-1-dub 1121791867 10.25.98.179 (19 Jul 2005 09:51:07 -0700)
X-Original-Trace: 19 Jul 2005 09:51:07 -0700, svelkar-pc.sybase.com
Lines: 12
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:471
Article PK: 8897


Dave Wilson <murrgon@hotmail.com> wrote in news:42dc4e60$1@forums-2-dub:

> Is it possible to call a JavaScript function from a POD? The
> documentation doesn't say anything about it so I am assuming
> that it is not possible. However, if anyone knows of any way
> to accomplish this, a short example would be greatly appreciated.
>

Use the DOM to locate an Input element and you can call the click method on
that element.

Shuchit


Chris Grim Posted on 2005-07-19 19:29:58.0Z
User-Agent: Microsoft-Entourage/11.1.0.040913
Subject: Re: Calling a JavaScript function from a POD
From: Chris Grim <chrisgrim@hotmail.com>
Newsgroups: ianywhere.public.mbusinessanywhere.general
Message-ID: <BF02A2C9.149A%chrisgrim@hotmail.com>
References: <42dc4e60$1@forums-2-dub>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
X-Original-NNTP-Posting-Host: 10.22.46.251
X-Original-Trace: 19 Jul 2005 12:29:54 -0700, 10.22.46.251
Lines: 21
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 19 Jul 2005 12:29:55 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 19 Jul 2005 12:29:58 -0700
X-Trace: forums-1-dub 1121801398 10.22.108.75 (19 Jul 2005 12:29:58 -0700)
X-Original-Trace: 19 Jul 2005 12:29:58 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:472
Article PK: 17695

Dave,

One of the things a POD can do is throw a DOM Level 2 event. You can
capture this event in JavaScript and run whatever JS function you'd like.
This is how our scanner pod for Pocket PC works. Start with the
documentation for the PODSEventMgr.

Chris...

On 7/18/05 5:50 PM, in article 42dc4e60$1@forums-2-dub, "Dave Wilson"

<murrgon@hotmail.com> wrote:

> Is it possible to call a JavaScript function from a POD? The
> documentation doesn't say anything about it so I am assuming
> that it is not possible. However, if anyone knows of any way
> to accomplish this, a short example would be greatly appreciated.
>
> Thank You
> Dave


Dave Wilson Posted on 2005-07-23 18:07:52.0Z
From: Dave Wilson <murrgon@hotmail.com>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: Calling a JavaScript function from a POD
References: <42dc4e60$1@forums-2-dub> <BF02A2C9.149A%chrisgrim@hotmail.com>
In-Reply-To: <BF02A2C9.149A%chrisgrim@hotmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: i216-58-65-160.igs.net
Message-ID: <42e28773$1@forums-2-dub>
X-Original-Trace: 23 Jul 2005 11:07:47 -0700, i216-58-65-160.igs.net
Lines: 22
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 23 Jul 2005 11:07:49 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 23 Jul 2005 11:07:52 -0700
X-Trace: forums-1-dub 1122142072 10.22.108.75 (23 Jul 2005 11:07:52 -0700)
X-Original-Trace: 23 Jul 2005 11:07:52 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:481
Article PK: 17696


Chris Grim wrote:
> One of the things a POD can do is throw a DOM Level 2 event. You can
> capture this event in JavaScript and run whatever JS function you'd like.
> This is how our scanner pod for Pocket PC works. Start with the
> documentation for the PODSEventMgr.

Are you generating an event or throwing an exception? I tried throwing
a string exception using PODSthrow, but all I get is an unhandled
exception in the PODS C code and JavaScript doesn't do anything. This
is what I did:

// Get the exception manager from the app
PODSExceptionMgr* pExceptionMgr = PODSgetExceptionMgr(pAvantGo);

// Create the data received exception
PODSException* pException =
PODScreateStringException(pExceptionMgr, "DataReceived");

// Throw it
PODSthrow(pExceptionMgr, pException);

Thank you