cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Table Server-Side events not firing

Former Member
0 Kudos

I'm having trouble with server-side events not being handled from my SAP Table.

I'm binding the Table to a collection that inherits from CollectionBase; after binding the Table presents fine. However, the LeadSelect event in my code-behind is not being fired (yes, I have the Handles keyword set up). When I Write the value of the LeadSelectHasHandler property out to the component in the Page_Load, it returns True both before and after Postback, so it seems to be registered okay.

I have a couple SAP Buttons on the same page and the Action events for these fire as expected and are handled by the appropriate event handlers.

Am I missing something?

    • After-post notes: **

- I tried setting the OnLeadSelect attribute on the Table tag in the front-end ASCX but this produced the same result (ie. no response to the postback event).

- I set up paging on the table using the Paging event - this works fine!

- I removed the event handler procedure and double-clicked the table to have it re-create the event handler (in case it was something silly with syntax) - still can't get the LeadSelect to fire.

Thanks in advance,

Mal.

Message was edited by: Mal Cartwright

Message was edited by: Mal Cartwright

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Just a side note - paging should work even without handling the event. handling the event is useful if you want to do something additional to the actual paging when user clicks the paging button

Former Member
0 Kudos

Thanks Ofer, I discovered that shortly after I made the post! You're right, the paging is automatic - very nice!

Former Member
0 Kudos

Okay, well I think I've worked out the problem.

In ASP.NET we would typically bind repeating controls such as DataLists and Repeaters manually using <i>Control</i>.DataBind(), because we're usually using a separate class library containing collections for our objects. Seems the SAP Table control doesn't like this approach.

I changed the code so that the databinding is specified on the control, and call the Page's DataBind() method and it all worked fine.

One tip: because the collection I used to bind to is in a separate class library, I receieved a <i>BC306523: Reference required to assembly MyAssemblyName...</i> message, even though I had a reference to the assembly in my project and the DLL is being properly deployed. To fix this, you must include the following directive at the top of the component's ASCX file:

<%@ Assembly Name="AssemblyName" %>

.

Former Member
0 Kudos

Hi Mal,

When you call DataBind, don't not use the Page.DataBind method, this might cause errors when you have several .NET iView on one page.

When you have several ..NET iViews on 1 portal page, they actually ran in one page in the runtime component. If each one calls the Page.DataBind, every call will cause the whole page, i.e. all the iViews on the page to bind, So the second call of DataBind will throw an error.

Instead you can use this.DataBind, (this = PortalComponent) or bind the controls manually.

Former Member
0 Kudos

This is strange. Calling the Page's DataBind() (or the "this.DataBind" as Tsachi correctly suggested) just initiates a recursive call of "DataBind" to all controls on the page... which eventually calls the table's DataBind. So basically using "Table1.DataBind()" should have worked just fine. Could you maybe post the misbehaving code here?

Regards,

Ofer