.NETGURU
Barcode scanning on mobile WebForm - Setfocus issue on Textbox
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.mobile.

Post a new message to this list...

DotNetJunkies User
Hi,

Does anybody have a small sample solution for setting on page load the focus in a textbox on a mobile webform ?

This is required in order to be able to use a barcode scanner, who will enter data in this field ( ending with a tab or enter)

As soon as the data is entered this way, how can i raise a postback, so I get the server back to the server ?

Remark :
As the textbox on a mobile webform has no setfocus method the below code is mentioned as solution for setting the focus on a textbox on a mobile webfrom on several forums. BUT..
I dont get it working, because nowbody states the correct
<deviceFilters> setting in the web.config...

Please help !

<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice Filter="isHTML32"
Xmlns="http://schemas.microsoft.com/mobile/html32template";;>
<FooterTemplate>
<script for="window" event="onload" language="javascript">
<!--
window.document.Form1.txtFileNumber.focus();
// -->
</script>
</FooterTemplate>
</Choice>
</mobile:DeviceSpecific>

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
Reply to this message...
 
    
Gybas Petr
Hi,

I'm actually writing the same application - ASP.NET application working with
bar code scanner. Here is form, that works fine:

<mobile:Form id="FormEANFind" runat="server" Paginate="True"
PagerStyle-NextPageText="->" PagerStyle-PreviousPageText="<-"
StyleReference="Form">
<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice Filter="isHTML32"
Xmlns="http://schemas.microsoft.com/mobile/html32template";>
<HeaderTemplate>
<mobile:Link id="LinkEANIndex" runat="server"
NavigateUrl="index.aspx">Index</mobile:Link>
</HeaderTemplate>
</Choice>
</mobile:DeviceSpecific>EAN:
<mobile:TextBox id="edtEAN" runat="server"></mobile:TextBox>
<mobile:Command id="btnSubmitEAN" runat="server">Find</mobile:Command>
<mobile:Label id="lblEANError" runat="server"
StyleReference="error"></mobile:Label>
<mobile:Panel id="Panel1" runat="server">
<mobile:DeviceSpecific id="DeviceSpecific5" runat="server">
<Choice Filter="isHTML32"
Xmlns="http://schemas.microsoft.com/mobile/html32template";>
<ContentTemplate>
<Script for="window" event="onload" language="jscript">
window.FormEANFind.edtEAN.focus();
</Script>
</ContentTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:Panel>
</mobile:Form>

But trouble is to handle onchange event and take some action. I found on
Internet, that you should use such script (for example):

window.FormEANFind.edtEAN.onchange = text_changed;
function text_changed(e)
{
window.FormEANFind.btnSubmitEAN.click();
}

It looks so fine, but it doesn't work. I'll post question in this newsgroup,
so check it for possible answer from another user.

pgyb

"DotNetJunkies User" <Click here to reveal e-mail address> wrote in message
news:Ou$Click here to reveal e-mail address...
[Original message clipped]

webfrom on several forums. BUT..
[Original message clipped]


Reply to this message...
 
 
System.Web.UI.MobileControls.DeviceSpecific
System.Web.UI.MobileControls.PagerStyle
System.Web.UI.MobileControls.TextBox
System.Web.UI.WebControls.TextBox
System.Windows.Forms.TextBox




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification