Iron Speed Technical Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
Geno

Avatar / Picture

Registered:
Posts: 9
Reply with quote  #1 

I am having trouble on a show table with some custom search fields.  In the filters panel I added 5 textboxes below the search field. When a value is entered into one textbox and the tab button is pressed the next field has focus for a second, then the focus is set back to the search control. The result is very frustrating to the user.

The text boxes are set with  autopostback=false. When I look at the attributes of the rendered page however, the controls now have an “onchange” attribute of:

Code:
javascript:setTimeout('__doPostBack(\'ctl00$PageContent$PM1\',\'\')', 0)

They also have an onfocus attribute of:

Code:
try{document.getElementById("__LASTFOCUS").value=this.id;}catch(e){}

Why do these text boxes have a postback property? I tried to remove it by adding this code to the control prerender:

           

Code:

Me.PM1.Attributes.Remove("onchange")
Me.PM2.Attributes.Remove("onchange")
Me.PM3.Attributes.Remove("onchange")
Me.PM4.Attributes.Remove("onchange")
Me.PM5.Attributes.Remove("onchange")

 

It didn’t seem to make a difference.

Any help would be much appreciated.

Thanks!

Attached Images
Click image for larger version - Name: SC_10_-_text.jpg, Views: 9, Size: 218.14 KB 

__________________
  ▲  Josh
▲ ▲

Geno

Avatar / Picture

Registered:
Posts: 9
Reply with quote  #2 

Sometimes just writing out an issue will make think about it with a new line of reasoning. (If I were helping someone with this issue what would be the first thing I would ask them to do?) I searched the controls class for “AutoPostBack” and found that any text box added to the filters panel gets the following  code generated for it

 

Public Overridable Sub SetPM1()
      ' Set AutoPostBack to true so that when the control value is changed, to refresh PM1_DDL controls
      Me.PM1.AutoPostBack = True
End Sub

 

So, I overrode the subroutines and it works.

I must admit, I feel foolish for posting the above question. 


__________________
  ▲  Josh
▲ ▲
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement