Welcome Guest Search | Active Topics | Sign In | Register

callbackpanel and viewstate Options
Sens
Posted: Tuesday, September 18, 2007 2:31:09 AM
Rank: Newbie
Groups: Member

Joined: 9/11/2007
Posts: 8
Functionality: someone clicks in productcategory: result set is built up in callbackpanel
- additional search options in parameterRepeater
- the results for the selected category in catRepeater
When pnlMenuCallback is built up, ppl can search deeper in the results through parameterRepeater.

I'm totally lost why I can't get the value of the selected dropdownboxes when the trigger (btnParamSearch) makes the panel callback. I have the generated dropdownboxes... so there no problem. But I can't access the selectedValue. It's just always 0. When I remove btnParamSearch as trigger from pnlMenuCallBack all works fine yet I have a refresh of my whole page. And I would like only a refresh of pnlMenuCallback. As info... uc1 is the treeview control.
One additional question... how to catch those annoying javascript errors for the callback panel?
Code: HTML/ASPX
<tr>
    <td>
    <asp:panel id="ProductCatpln" Runat="server">
      <uc1:productcategory id="ProductCategory" runat="server"></uc1:productcategory>
    </asp:panel>
    </td>
<EO:CallbackPanel ID="pnlMenuCallback" runat="server" GroupName="grpCallback" triggers="{ControlID:ProductCategory;Parameter:},{ControlID:btnParamSearch;Parameter:}"  OnExecute="CallbackPanelResults_Execute">
<table>
 <TR>
   <TD>
     <TABLE>
       <TR>
	<asp:repeater id="parameterRepeater" Runat="server">
	<ItemTemplate>
	<td><table><tr><td>
	<asp:Literal ID="parameterLiteral" Runat="server"></asp:Literal>
	<asp:Literal ID="PPId" Runat="server" Visible="False"></asp:Literal>
	</td></tr>
	<tr><td>
	<asp:DropDownList ID="parameterVcbo" Runat="server"></asp:DropDownList>
	</td></tr></table></td>
	</ItemTemplate>
	</asp:repeater>
            <TD vAlign="baseline"><ASP:LINKBUTTON id="btnParamSearch" runat=server Visible="False" >_Search</ASP:LINKBUTTON></TD>
        </TR>
      </TABLE>
     </TD>
   </TR>
   <TR>
     <TD>
        <TABLE>
	<asp:panel id="pnlResult" Runat="server" visible="False">
    	<TR><TD><TABLE>
	<asp:Repeater id="catRepeater" Runat="server">
	<ItemTemplate>
	<tr><td>.....</td></tr>
	</ItemTemplate>
	</asp:Repeater>
         </TABLE></TD></TR>
    </asp:panel>
  </table>
 </TD>
</TR>
</table>
</EO:CallbackPanel>


Thnx for your help.
eo_support
Posted: Tuesday, September 18, 2007 6:22:55 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Your code looks fine. Since you mentioned about JavaScript error, I would start by identifying and fixing that. In order to catch the error, you want to go to your Internet Explorer -> Options to uncheck "Disable Script Debugging" options. You will then be able to invoke a Script Debugger to get more specific information about the error when it occurs.
Sens
Posted: Tuesday, September 18, 2007 6:34:56 AM
Rank: Newbie
Groups: Member

Joined: 9/11/2007
Posts: 8
I don't have javascript errors in this specific case. It's just that when btnParamSearch triggers CallbackPanelResults_Execute, it seems it doesn't take the last state of the parameterVcbo dropdownboxes. So it's impossible to find the selectedValues. Perhaps it's an issue with dynamically generated controls? I'm sure, I don't rebuild the parameterVcbo in the code behind.
eo_support
Posted: Tuesday, September 18, 2007 6:50:44 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

It definitely does have to do with dynamically creating controls. This post explained how view state works in detail:

http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=347

Thanks
Sens
Posted: Wednesday, September 19, 2007 2:10:13 AM
Rank: Newbie
Groups: Member

Joined: 9/11/2007
Posts: 8
I knew you would send me this link... but my controls are buildup... it's just that I can't find the selected value. Even more... when I remove the trigger "btnParamSearch" from the panel and add the onclick event on btnParamSearch itself, it works just fine. But I don't like a complete postback of my page. Moreover... I should build up the parameters in my page_init? Won't this bring the performance down?
eo_support
Posted: Wednesday, September 19, 2007 7:08:59 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Generally when you want to rebuild the control tree due to view state issues, you should do it inside Page_Init instead of Page_Load. Rebuilding controls tree in Page_Load will get the contents correctly rendered, but it will not resolve the view state issues because the flow is Page_Init -> Load View State -> Page_Load. In another word, Page_Load happens after Load view state, so whatever you do there will not help view state at all.

I don't have an explanation as why it works without trigger though. If you can create a reproducing small sample project that demonstrates the problem, we would be happy to take a look.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.