Problem with Focus method with iehp.exe on thin client

G

Guest

The HP t5520 Windows CE based thin client comes with a browser called
'Internet Explorer' - iehp.exe. It appears to have Java script
(Request.Browser.JavaScript = True). I want to use this browser in
conjunction with a 'keyboard wedge' magnetic card reader (and no keyboard) to
record the arrival of staff and to display information about the employees
jobs for the day. The webform has a textbox that must maintain focus so that
when a magnetic card is swiped, the card details are recorded and the form
submitted. Page_Load has textbox1.Focus which does the job fine in IE7, but
does not work with hpie.exe (Request.Browser.Type="Mozilla"). I know nothing
about Java script or how .Focus works. Is there any way of fixing this
problem, or is there a Windows CE browser that would make .Focus work?
 
S

Steven Cheng[MSFT]

Hi John,

As Ben has said, you can simply test the setfocus behavior through pure
javascript function call rather than the ASP.NET Page.Setfocus method.
ASP.NET server-side page/control method also emit client-side script to
setfocus. If pure client script also not work, I'm afraid the problem
should be specific to the iehp.exe browser:

#Set Focus to First Input on Web Page
http://www.codeproject.com/jscript/FocusFirstInput.asp


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hi Ben,

Thanks for the help - your sample code works fine. Also pasting the
id="Body" onload="document.form1.txtCardID.focus();"
into my existing page makes it work too.

I know nothing about Java script, so why does your 'onload' work and
Microsoft's
<form id="form1" runat="server" defaultfocus="txtCardID">
not work?
 
S

Steven Cheng[MSFT]

Hi Ben,

The "defaultfocus" is an ASP.NET server-side control attribute, the ASP.NET
runtime will render out clientscript (to set focus) according to this
attribute value. However, the rendering will vary according to the client
browser. I think ASP.NET possibly detect the iehp.exe as a non-javascript
enabled browser and doesn't correctly output script to set focus.

<form id="form1" runat="server" defaultfocus="txtCardID">

You can try checking the source of the output html at client-side to see
whether the ASP.NET has render the same script code as your own custom
script.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hello Stevan,

Request.Browser.JavaScript = True, so it ought to think that the browser
supports Java script. Can you tell me where I could download a copy of
Microsoft's Internet Explorer for Windows CE? I cant find a download anywhere.
Thanks
 
S

Steven Cheng[MSFT]

Hi John,

What's the " Internet Explorer for Windows CE" you mean? The exe image of
it? So far for Internet explorer, it seems be installed with the windows
OS rather than a separate package. If you want to get a correct copy to
replace a corrupted one, you can consider copy one from another box with
this IE for Wince installed.


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top