Help with SimpleSearch

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Will
Captain (CAPT)
Captain (CAPT)
Posts: 263
Joined: Fri Oct 05, 2007 8:02 am

Help with SimpleSearch

Post by Will » Mon Mar 03, 2008 6:26 pm

I'm having a problem which I think is my own lack of ASP.net knowledge rather than an AC7 problem.

I've got the SimpleSearch control in the header of each page of the site. Problem is when the header is on a page with any other form (login, edit address, etc.), when you fill out the other form and hit return, it submits a search instead of submitting the form you're focused on.

I created my own custom control so we could style it a little differently. I tried using the stock control as well, but get the same results.

I'm totally stumped. Where should I start looking?

Thanks.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Mon Mar 03, 2008 8:54 pm

The default value for a button is UseSubmitBehavior=True.

Add this parameter to the asp:button control on the simplesearch.ascx page. It should eliminate the issue although I haven't tested it.

Code: Select all

UseSubmitBehavior="False"
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Will
Captain (CAPT)
Captain (CAPT)
Posts: 263
Joined: Fri Oct 05, 2007 8:02 am

Post by Will » Mon Mar 03, 2008 9:26 pm

Joe -- I checked out the login page for your site. Yours works fine. Whatever form you focus on gets submitted when you hit the enter key. I assume you didn't have to do anything special to get that to work?

I think somewhere I've got something set that's overriding the original behavior.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Tue Mar 04, 2008 4:28 am

You are correct, I did not go to any special steps (that I am aware of) to make that functionality possible. As you can tell, my theme is pretty much the default with some minor tweaks.

What about any "SetFocus" parameters - got any of those set on your modifications? Sometimes .Net validators can SetFocus as well without realizing it.

Another way to possibly narrow it down is pick a problem page. Switch to Edit Mode. Change one zone back to the AC7 default. Test. Change another zone. Test. Keep working backwards towards the AC7 default setup until the problem disappears - the last zone changed would be the one that contains the problem control(s).

Just some thoughts, that's a tricky one to narrow down for sure.... :roll:
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Post by Shopping Cart Admin » Tue Mar 04, 2008 6:03 am

Hello Joe,

This was corrected in the RC3 components which you are likely using.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

User avatar
batmike
Commander (CMDR)
Commander (CMDR)
Posts: 123
Joined: Tue Sep 04, 2007 10:46 am
Location: Minneapolis, MN
Contact:

Post by batmike » Tue Mar 04, 2008 7:09 am

Not to take the post off topic, but considering the last post, is RC3 available yet, or is it still being tested?

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Post by Shopping Cart Admin » Tue Mar 04, 2008 7:14 am

Hello,

It will be available later this week. Joe graciously volunteered a weekend to test the upgrade! Thanks Joe.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

Will
Captain (CAPT)
Captain (CAPT)
Posts: 263
Joined: Fri Oct 05, 2007 8:02 am

Post by Will » Tue Mar 04, 2008 7:41 am

Mike -- just to confirm -- are you saying this is an AC bug that was corrected in RC3?

Thanks for the quick reply. You saved me a ton of headache.

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Post by Shopping Cart Admin » Tue Mar 04, 2008 7:44 am

Hello Will,

Yes that's correct the UI issue was corrected for inclusion into the next release.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

Will
Captain (CAPT)
Captain (CAPT)
Posts: 263
Joined: Fri Oct 05, 2007 8:02 am

Post by Will » Tue Mar 04, 2008 9:46 am

Hi Joe --

Code: Select all

UseSubmitBehavior="False"


Works great for asp:Button, but doesn't work for asp:ImageButton. Do you know a workaround for this.

Will
Captain (CAPT)
Captain (CAPT)
Posts: 263
Joined: Fri Oct 05, 2007 8:02 am

Post by Will » Tue Mar 04, 2008 9:54 am

Never mind, I got it. Changed asp:ImageButton to asp:Image.

It's definitely a kludge because now you can't submit any forms using the return key.

But at least hitting return doesn't trigger an unintended search.

Looking forward to RC3. :)

Will
Captain (CAPT)
Captain (CAPT)
Posts: 263
Joined: Fri Oct 05, 2007 8:02 am

Post by Will » Tue Mar 04, 2008 10:25 am

Argh! It worked in that it disabled the search button, but then just shifted focus to the next button on the page.

If I change everything on the login page to use asp:button, everything works fine. If they are asp:ImageButton or asp:LinkButton things get confused.

This is kind of a bummer because we need to use asp:ImageButton and asp:LinkButton to style our buttons.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Tue Mar 04, 2008 2:26 pm

Bud I wish I knew - there's no obvious property on linkbutton or imagebutton that supresses the submit behavior.

Any straight HTML buttons on your site that could be the cause??
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Will
Captain (CAPT)
Captain (CAPT)
Posts: 263
Joined: Fri Oct 05, 2007 8:02 am

Post by Will » Wed Mar 05, 2008 10:01 am

Ended up changing all asp:LinkButton to asp:Button and using a DefaultButton reference in the appropriate asp:Panel. Seems to work now.

Of course, now that I've posted this, it will probably break. :)

Post Reply