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.

Signature Capture - Dynamic

7 posts in General Discussion Last posting was on 2010-07-08 08:05:08.0Z
Shao Chan Posted on 2010-07-06 14:03:45.0Z
Reply-To: "Shao Chan" <nospam@nospam.com>
From: "Shao Chan" <nospam@nospam.com>
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Signature Capture - Dynamic
Lines: 40
Organization: Civica
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c3337c1@forums-1-dub>
Date: 6 Jul 2010 07:03:45 -0700
X-Trace: forums-1-dub 1278425025 10.22.241.152 (6 Jul 2010 07:03:45 -0700)
X-Original-Trace: 6 Jul 2010 07:03:45 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1500
Article PK: 18002

MBEntPPCEN_7_0_156.17052.exe

Hi all,

I am trying to get a signature capture from the PDA.

In the past we have implemented the example from the documentation
(mba_appdeven70.pdf):
<INPUT TYPE="scribble" NAME="name" SIZE="width, height" ALT="Alternative
Text">

This works fine.

However, I am not sure how I would achieve the same effect dynamically.

To create a standard text box I would type:

var node = document.createElement("text");

So, I have tried:
a)
var node = document.createElement("scribble");

b)
var node = document.createElement("text");
node.type = "scribble";

c)
var node = document.createElement("text");
node.setAttribute("type", "scribble");

None of the above appear to work.

How do I get a signature scribble dynamically?

Thanks.

Shao


Jeff Albion [Sybase iAnywhere] Posted on 2010-07-06 15:31:19.0Z
From: "Jeff Albion [Sybase iAnywhere]" <firstname.lastname@ianywhere.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5
MIME-Version: 1.0
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: Signature Capture - Dynamic
References: <4c3337c1@forums-1-dub>
In-Reply-To: <4c3337c1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c334c47$1@forums-1-dub>
Date: 6 Jul 2010 08:31:19 -0700
X-Trace: forums-1-dub 1278430279 10.22.241.152 (6 Jul 2010 08:31:19 -0700)
X-Original-Trace: 6 Jul 2010 08:31:19 -0700, vip152.sybase.com
Lines: 44
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1501
Article PK: 9457

Hi Shao,

On 06/07/2010 10:03 AM, Shao Chan wrote:
> I am trying to get a signature capture from the PDA.
>
> In the past we have implemented the example from the documentation
> (mba_appdeven70.pdf):
> <INPUT TYPE="scribble" NAME="name" SIZE="width, height" ALT="Alternative
> Text">
>
> This works fine.
>
> However, I am not sure how I would achieve the same effect dynamically.

*If you're creating an object using .createElement() (
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-2141741547
), the string passed in will be the name of the HTML/XML type you're
instantiating:

var node = document.createElement("input");

You'll then need to set various attributes on this element afterwards:

node.setAttribute("type", "scribble");
node.setAttribute("name", "name");
node.setAttribute("size", "40, 10");
node.setAttribute("alt", "Alternative Text");

---

*Note: This is untested code - if this doesn't work, please let me know
and I will try it on my local copy. :)

Cheers,

--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/library/sql-anywhere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summary.do?baseprod=144&client=ianywhere&timeframe=0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/


Shao Chan Posted on 2010-07-06 15:48:00.0Z
Reply-To: "Shao Chan" <nospam@nospam.com>
From: "Shao Chan" <nospam@nospam.com>
Newsgroups: ianywhere.public.mbusinessanywhere.general
References: <4c3337c1@forums-1-dub> <4c334c47$1@forums-1-dub>
Subject: Re: Signature Capture - Dynamic
Lines: 63
Organization: Civica
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c335030@forums-1-dub>
Date: 6 Jul 2010 08:48:00 -0700
X-Trace: forums-1-dub 1278431280 10.22.241.152 (6 Jul 2010 08:48:00 -0700)
X-Original-Trace: 6 Jul 2010 08:48:00 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1502
Article PK: 9460

Hi Jeff,

Thanks for the response. My example had an error (I was messing with
combinations) and I wrote "text" rather than "input".

Anyway, taking your example, that is how I imagined the syntax to work, but
it doesn't.

Please give it a try locally! :)

Thanks,

Shao

"Jeff Albion [Sybase iAnywhere]" <firstname.lastname@ianywhere.com> wrote in
message news:4c334c47$1@forums-1-dub...
> Hi Shao,
>
> On 06/07/2010 10:03 AM, Shao Chan wrote:
>> I am trying to get a signature capture from the PDA.
>>
>> In the past we have implemented the example from the documentation
>> (mba_appdeven70.pdf):
>> <INPUT TYPE="scribble" NAME="name" SIZE="width, height" ALT="Alternative
>> Text">
>>
>> This works fine.
>>
>> However, I am not sure how I would achieve the same effect dynamically.
>
> *If you're creating an object using .createElement() (
> http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-2141741547 )
> , the string passed in will be the name of the HTML/XML type you're
> instantiating:
>
> var node = document.createElement("input");
>
> You'll then need to set various attributes on this element afterwards:
>
> node.setAttribute("type", "scribble");
> node.setAttribute("name", "name");
> node.setAttribute("size", "40, 10");
> node.setAttribute("alt", "Alternative Text");
>
> ---
>
> *Note: This is untested code - if this doesn't work, please let me know
> and I will try it on my local copy. :)
>
> Cheers,
>
> --
> Jeff Albion, Sybase iAnywhere
>
> iAnywhere Developer Community :
> http://www.sybase.com/developer/library/sql-anywhere-techcorner
> iAnywhere Documentation :
> http://www.ianywhere.com/developer/product_manuals
> SQL Anywhere Patches and EBFs :
> http://downloads.sybase.com/swd/summary.do?baseprod=144&client=ianywhere&timeframe=0
> Report a Bug/Open a Case : http://case-express.sybase.com/cx/


Jeff Albion [Sybase iAnywhere] Posted on 2010-07-06 18:31:49.0Z
From: "Jeff Albion [Sybase iAnywhere]" <firstname.lastname@ianywhere.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5
MIME-Version: 1.0
Newsgroups: ianywhere.public.mbusinessanywhere.general
Subject: Re: Signature Capture - Dynamic
References: <4c3337c1@forums-1-dub> <4c334c47$1@forums-1-dub> <4c335030@forums-1-dub>
In-Reply-To: <4c335030@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c337695$1@forums-1-dub>
Date: 6 Jul 2010 11:31:49 -0700
X-Trace: forums-1-dub 1278441109 10.22.241.152 (6 Jul 2010 11:31:49 -0700)
X-Original-Trace: 6 Jul 2010 11:31:49 -0700, vip152.sybase.com
Lines: 58
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1503
Article PK: 9459

Hi Shao,

Let's try some tested code this time. :)

The following code seems to work for me on 7.0.149.16781, Win32:

================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>2010-07-06 - DOM Scribble Test Script</title>
<script type="text/javascript">
// <![CDATA[
function AddScribble(){

var boundingbox = document.getElementById("scribblebox");
var scribblebox = document.createElement("input");
scribblebox.setAttribute("type", "scribble");
scribblebox.setAttribute("name", "signbox");
scribblebox.setAttribute("width", "500");
scribblebox.setAttribute("height", "100");
scribblebox.setAttribute("alt", "Signature Box #1");
//scribblebox.defaultChecked = true;

boundingbox.appendChild(scribblebox);
}
// ]]>
</script>
</head>
<body>
<form id="signatureform" method="post" action="action.html">
<div id="scribblebox">
</div>
<div>
<input type="button" value="New Signature Box!" name="addbox"
id="addbox" onclick="AddScribble();" />
</div>
</form>
</body>
</html>
================================================================

Does this example work okay for you as well?

Cheers,

--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/library/sql-anywhere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summary.do?baseprod=144&client=ianywhere&timeframe=0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/


Shao Chan Posted on 2010-07-06 20:23:32.0Z
From: "Shao Chan" <nospam@nospam.com>
Newsgroups: ianywhere.public.mbusinessanywhere.general
References: <4c3337c1@forums-1-dub> <4c334c47$1@forums-1-dub> <4c335030@forums-1-dub> <4c337695$1@forums-1-dub>
Subject: Re: Signature Capture - Dynamic
Lines: 77
Organization: Civica
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c3390c4@forums-1-dub>
Date: 6 Jul 2010 13:23:32 -0700
X-Trace: forums-1-dub 1278447812 10.22.241.152 (6 Jul 2010 13:23:32 -0700)
X-Original-Trace: 6 Jul 2010 13:23:32 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1504
Article PK: 9458

Hi Jeff,

Thanks for that. You code works. My code wasn't working because I wasn't
calling my code function. I changed it because it wasn't working to call
another function (a standard textarea). Forgot to change it back - stupid
mistake!

Thanks

Shao

"Jeff Albion [Sybase iAnywhere]" <firstname.lastname@ianywhere.com> wrote in
message news:4c337695$1@forums-1-dub...
> Hi Shao,
>
> Let's try some tested code this time. :)
>
> The following code seems to work for me on 7.0.149.16781, Win32:
>
> ================================================================
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html
> PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <title>2010-07-06 - DOM Scribble Test Script</title>
> <script type="text/javascript">
> // <![CDATA[
> function AddScribble(){
>
> var boundingbox = document.getElementById("scribblebox");
> var scribblebox = document.createElement("input");
> scribblebox.setAttribute("type", "scribble");
> scribblebox.setAttribute("name", "signbox");
> scribblebox.setAttribute("width", "500");
> scribblebox.setAttribute("height", "100");
> scribblebox.setAttribute("alt", "Signature Box #1");
> //scribblebox.defaultChecked = true;
>
> boundingbox.appendChild(scribblebox);
> }
> // ]]>
> </script>
> </head>
> <body>
> <form id="signatureform" method="post" action="action.html">
> <div id="scribblebox">
> </div>
> <div>
> <input type="button" value="New Signature Box!" name="addbox"
> id="addbox" onclick="AddScribble();" />
> </div>
> </form>
> </body>
> </html>
> ================================================================
>
> Does this example work okay for you as well?
>
> Cheers,
>
> --
> Jeff Albion, Sybase iAnywhere
>
> iAnywhere Developer Community :
> http://www.sybase.com/developer/library/sql-anywhere-techcorner
> iAnywhere Documentation :
> http://www.ianywhere.com/developer/product_manuals
> SQL Anywhere Patches and EBFs :
> http://downloads.sybase.com/swd/summary.do?baseprod=144&client=ianywhere&timeframe=0
> Report a Bug/Open a Case : http://case-express.sybase.com/cx/


Shao Chan Posted on 2010-07-07 10:29:52.0Z
Reply-To: "Shao Chan" <nospam@nospam.com>
From: "Shao Chan" <nospam@nospam.com>
Newsgroups: ianywhere.public.mbusinessanywhere.general
References: <4c3337c1@forums-1-dub>
Subject: Re: Signature Capture - Dynamic
Lines: 65
Organization: Civica
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c345720@forums-1-dub>
Date: 7 Jul 2010 03:29:52 -0700
X-Trace: forums-1-dub 1278498592 10.22.241.152 (7 Jul 2010 03:29:52 -0700)
X-Original-Trace: 7 Jul 2010 03:29:52 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1505
Article PK: 18003

Hi all,

One more question.....

Traditionally in our application, once the user has entered a signature
scribble into the scribble input field, to get it into the database, the
following method is used:
setBytesParameter (parameterId, array)

So I can't just type:
setBytesParameter (parameterId, myfield.value)

How can I achieve converting myfield.value into a binary array without
exporting myfield.value into an external file and then reading it into an
array?

Thanks,

Shao

"Shao Chan" <nospam@nospam.com> wrote in message
news:4c3337c1@forums-1-dub...
> MBEntPPCEN_7_0_156.17052.exe
>
> Hi all,
>
> I am trying to get a signature capture from the PDA.
>
> In the past we have implemented the example from the documentation
> (mba_appdeven70.pdf):
> <INPUT TYPE="scribble" NAME="name" SIZE="width, height" ALT="Alternative
> Text">
>
> This works fine.
>
> However, I am not sure how I would achieve the same effect dynamically.
>
> To create a standard text box I would type:
>
> var node = document.createElement("text");
>
> So, I have tried:
> a)
> var node = document.createElement("scribble");
>
> b)
> var node = document.createElement("text");
> node.type = "scribble";
>
> c)
> var node = document.createElement("text");
> node.setAttribute("type", "scribble");
>
> None of the above appear to work.
>
> How do I get a signature scribble dynamically?
>
> Thanks.
>
> Shao
>


Shao Chan Posted on 2010-07-08 08:05:08.0Z
Reply-To: "Shao Chan" <nospam@nospam.com>
From: "Shao Chan" <nospam@nospam.com>
Newsgroups: ianywhere.public.mbusinessanywhere.general
References: <4c3337c1@forums-1-dub> <4c345720@forums-1-dub>
Subject: Loading and Saving Scribble into BLOB field
Lines: 98
Organization: Civica
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c3586b4$1@forums-1-dub>
Date: 8 Jul 2010 01:05:08 -0700
X-Trace: forums-1-dub 1278576308 10.22.241.152 (8 Jul 2010 01:05:08 -0700)
X-Original-Trace: 8 Jul 2010 01:05:08 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.mbusinessanywhere.general:1506
Article PK: 18005

I found a solution to transfer to and from a BLOB field from the scribble
signature if it helps anyone:

function string2Bin(str) {
var result = [];

for (var i = 0; i < str.length; i++) {
result.push(str.charCodeAt(i));
}
return result;
}

function bin2String(array) {
return String.fromCharCode.apply(String, array);
}

Basically, the problem is that once you have your scribble, it needs to
be transferrable to a bytes parameter when writing to the database.
http://dcx.sybase.com/index.html#1101en/ulmbus_en11/ag-apiref-setbytespa
rameter.html
When retrieving it, it needs to be converted so that it can be assigned
to the .value of the scribble.

Cheers,

Shao

"Shao Chan" <nospam@nospam.com> wrote in message
news:4c345720@forums-1-dub...
> Hi all,
>
> One more question.....
>
> Traditionally in our application, once the user has entered a signature
> scribble into the scribble input field, to get it into the database, the
> following method is used:
> setBytesParameter (parameterId, array)
>
> So I can't just type:
> setBytesParameter (parameterId, myfield.value)
>
> How can I achieve converting myfield.value into a binary array without
> exporting myfield.value into an external file and then reading it into an
> array?
>
> Thanks,
>
> Shao
>
>
>
> "Shao Chan" <nospam@nospam.com> wrote in message
> news:4c3337c1@forums-1-dub...
>> MBEntPPCEN_7_0_156.17052.exe
>>
>> Hi all,
>>
>> I am trying to get a signature capture from the PDA.
>>
>> In the past we have implemented the example from the documentation
>> (mba_appdeven70.pdf):
>> <INPUT TYPE="scribble" NAME="name" SIZE="width, height" ALT="Alternative
>> Text">
>>
>> This works fine.
>>
>> However, I am not sure how I would achieve the same effect dynamically.
>>
>> To create a standard text box I would type:
>>
>> var node = document.createElement("text");
>>
>> So, I have tried:
>> a)
>> var node = document.createElement("scribble");
>>
>> b)
>> var node = document.createElement("text");
>> node.type = "scribble";
>>
>> c)
>> var node = document.createElement("text");
>> node.setAttribute("type", "scribble");
>>
>> None of the above appear to work.
>>
>> How do I get a signature scribble dynamically?
>>
>> Thanks.
>>
>> Shao
>>
>
>