Hiding a template item

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
cgreathouse
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 21
Joined: Tue Mar 03, 2009 10:49 am

Hiding a template item

Post by cgreathouse » Thu Apr 02, 2009 7:23 am

Hello

I'm trying to figure out how to hide a text box from a product template. Here's where I'm at so far...

In BuildProductChoices I monitor the controls being added until I see the RadioButtonList I'm interested in. I then add an event handler like this

((RadioButtonList)o).AutoPostBack = true;
((RadioButtonList)o).SelectedIndexChanged += new EventHandler(ProductHelper_SelectedIndexChanged);

I then added the handler

static void ProductHelper_SelectedIndexChanged(object sender, EventArgs e){}

so now I can see the handle is getting called but I don't know how to tell which are the text boxes I want to hide. I'm able to get the InputFieldId from ac_InputFields. But now I'm stuck

How can I find the control I need hide based on InputFieldId?

Thanks!

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Hiding a template item

Post by mazhar » Thu Apr 02, 2009 7:29 am

One solution could be to create two CSS classes one for hide/show purpose and then use PageHelper.RecursiveFindControl method to find desired text box and finally change its class to show/hide it.

cgreathouse
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 21
Joined: Tue Mar 03, 2009 10:49 am

Re: Hiding a template item

Post by cgreathouse » Thu Apr 02, 2009 7:40 am

Thanks!

That's getting me closer. How can I find the control when all I have is the InputFieldId? I don't have the controlId to search on. What I really have is a RadioButtonList. Depending on what radio item is selected, text boxes need to be hidden or made visible.

I have the InputFieldIds, I just need to find the text boxes that are associated with those InputFieldIds.

I feel like I'm so close, just need a little more help.

Thanks!

Post Reply