[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Eric Fortin

12/19/2002 1:34:00 AM

Is it possible to set the initial focus of a text box in a mobile web app.

I've searched and searched and searched and cannot find an example.

Please, please help......

--



2 Answers

(Patrick C. Cole (MS))

12/19/2002 3:41:00 PM

0

Eric,

You can set focus to a control in a mobile application, but it depends on
what the Choice Filter for the specific platform is, and whether or not it
supports JScript client-side. The code below works in Internet Explorer or
any HTML32 device:

<mobile:Form id="Form1" runat="server">
<mobile:Panel id="Panel1" runat="server">
<mobile:DeviceSpecific id="DeviceSpecific1" Runat="server">
<Choice Filter="isHTML32">
<contenttemplate>
<Script for=window event=onload language=jscript>
var tbTempArray = document.getElementsByName("_ctl0:TextBox1");
tbTempArray[0].focus();
</Script>
<mobile:TextBox id="TextBox1" runat="server"
text="mobile:TextBox1"></mobile:TextBox>
<mobile:TextBox id="TextBox2" runat="server"
text="mobile:TextBox2"></mobile:TextBox>
</contenttemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:Panel>
</mobile:Form>

This is a sample I created recently that traps specific keystrokes and sets
focus to a mobile:TextBox control (by using it's ClientID,
"_clt0:TextBox1").

Hope this helps,

Patrick Cole
Microsoft Developer Communities

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
--------------------
| From: "Eric Fortin" <emfortin@attbi.com>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.mobile
| Subject: Mobile TextBox Initial Focus
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Message-ID: <iu8M9.390740$%m4.123471@rwcrnsc52.ops.asp.att.net>
| NNTP-Posting-Host: 12.253.205.9
| X-Complaints-To: abuse@attbi.com
| X-Trace: rwcrnsc52.ops.asp.att.net 1040258062 12.253.205.9 (Thu, 19 Dec
2002 00:34:22 GMT)
| NNTP-Posting-Date: Thu, 19 Dec 2002 00:34:22 GMT
| Organization: AT&T Broadband
| Date: Thu, 19 Dec 2002 00:34:22 GMT
| Path:
cpmsftngxa06!cpmsftngxa08!cppssbbsa01.microsoft.com!news-out.cwix.com!newsfe
ed.cwix.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!
rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail
| Xref: cpmsftngxa06 microsoft.public.dotnet.framework.aspnet.mobile:5043
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.mobile
|
| Is it possible to set the initial focus of a text box in a mobile web app.
|
| I've searched and searched and searched and cannot find an example.
|
| Please, please help......
|
| --
|
|
|
|

Eric Fortin

12/19/2002 9:36:00 PM

0

Patrick,

Thanks for your help.

I got the mobile part of it working on IE, but it still does not set the
intial focus in the Personal Internet Explorer (Windows CE 3.0.11171(Build
11178))

Here is what I'm trying to do. (Maybe you or someone reading this will have
experience in this area:) This is a basic order fulfillment app, and the
windows CE Device has a barcode scanner attached to it.

1. Present next component for an order via PIE (talking to a WebServer,
hosted outside the CE Device)
2. User scans location (verify that he's pulling from the right
location--not necessarily server side)
3. User scans Part (verify that he's pulling the right part number--not
necessarily server side)

4. Enter key (or really--the carriage return suffix of the barcode scanner)
submits the form.

5. Webserver logic calls a stored procedure (history, status update,
inventory balance update) for that specific requirement

6. System presents next component for order (server evaluates and then
passes that information back to the device)

7. repeat's this process until done.

There may be multiple people working on the same order
One user may pull 300+ components in a shift
there may be 20+ users pulling parts (potentially for the same order) at any
given time.

Due to other complications, It is essential that:

1. The first field has focus
2. Enter will submit the form
3. I can use the database to dynamically present the next component for the
next order (No batch assigning parts to a device).

(Note: The scanners are also used in other processes which makes changing
preamble & suffix impossible)

Anyone know if this is possible with the new MobileASP, or Must I build a
traditional client/server app (device/listening device).

Any help or suggestions would be appreciated.

Thanks.

"Patrick C. Cole [MSFT]" <patcole@online.microsoft.com> wrote in message
news:wks1ty2pCHA.1488@cpmsftngxa06...
> Eric,
>
> You can set focus to a control in a mobile application, but it depends on
> what the Choice Filter for the specific platform is, and whether or not it
> supports JScript client-side. The code below works in Internet Explorer
or
> any HTML32 device:
>
> <mobile:Form id="Form1" runat="server">
> <mobile:Panel id="Panel1" runat="server">
> <mobile:DeviceSpecific id="DeviceSpecific1" Runat="server">
> <Choice Filter="isHTML32">
> <contenttemplate>
> <Script for=window event=onload language=jscript>
> var tbTempArray = document.getElementsByName("_ctl0:TextBox1");
> tbTempArray[0].focus();
> </Script>
> <mobile:TextBox id="TextBox1" runat="server"
> text="mobile:TextBox1"></mobile:TextBox>
> <mobile:TextBox id="TextBox2" runat="server"
> text="mobile:TextBox2"></mobile:TextBox>
> </contenttemplate>
> </Choice>
> </mobile:DeviceSpecific>
> </mobile:Panel>
> </mobile:Form>
>
> This is a sample I created recently that traps specific keystrokes and
sets
> focus to a mobile:TextBox control (by using it's ClientID,
> "_clt0:TextBox1").
>
> Hope this helps,
>
> Patrick Cole
> Microsoft Developer Communities
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use. ) 2002 Microsoft Corporation. All rights
> reserved.
> --------------------
> | From: "Eric Fortin" <emfortin@attbi.com>
> | Newsgroups: microsoft.public.dotnet.framework.aspnet.mobile
> | Subject: Mobile TextBox Initial Focus
> | Lines: 10
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
> | Message-ID: <iu8M9.390740$%m4.123471@rwcrnsc52.ops.asp.att.net>
> | NNTP-Posting-Host: 12.253.205.9
> | X-Complaints-To: abuse@attbi.com
> | X-Trace: rwcrnsc52.ops.asp.att.net 1040258062 12.253.205.9 (Thu, 19 Dec
> 2002 00:34:22 GMT)
> | NNTP-Posting-Date: Thu, 19 Dec 2002 00:34:22 GMT
> | Organization: AT&T Broadband
> | Date: Thu, 19 Dec 2002 00:34:22 GMT
> | Path:
>
cpmsftngxa06!cpmsftngxa08!cppssbbsa01.microsoft.com!news-out.cwix.com!newsfe
>
ed.cwix.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!
> rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail
> | Xref: cpmsftngxa06 microsoft.public.dotnet.framework.aspnet.mobile:5043
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.mobile
> |
> | Is it possible to set the initial focus of a text box in a mobile web
app.
> |
> | I've searched and searched and searched and cannot find an example.
> |
> | Please, please help......
> |
> | --
> |
> |
> |
> |
>