This is for GoWeb
Is there a reason Delete button not
calling the SelectionDeleting event
I made sure the Event is registered on server side
but when clicked on delte button the event is not called
The button’s HTML is same as the one in IconicNode
example project.
Really? The TreeApp sample web app uses the GoView.SelectionDeleting event, to decide what to do based on whether a checkbox is checked. I wonder how your initialization might be different.
I checked both samples thouroughly.
The only difference I see is my code has a webcontrol
which does everything
and a Page to show this control.
I converted my Control code into a Page and delete works.
Are there any known issues for GoWeb working in
a web page versus webcontrol ??
Any thoughts ??
There was a naming bug that we fixed for version 2.2. Offhand I can’t think of anything else. What version are you using?
2.2.2
Any help on this.
GOWeb delete etc… works in Page but not in Control
Also I have two views to bound to same document.
Does it matter ??
I tested the supplied Sample TreeApp application.
The delete works if it is a Page but if the same code is
made into a control , it wont work.
The only difference is I cannot override RaisePostBack
in a control, so commented that out.
But in my project I wont override this event anyway.
Can someone please solve it ASAP, as I am having problems in moving forward.
I put the
Solution files here.
the virtual directory should be TreeApp
Thanx a bunch
I haven’t had a chance to look into this very much. Thanks for your test web app that uses a UserControl.
Well, if all else fails, you ought to be able to define your own view class inheriting from GoView, overriding OnSelectionDeleting.
I dont know whether OnSelectionDeleting is called at all
or not for a WebControl.
I will test it tommorrow, but if Inheriting and overriding does not work any other thoughts on how to solve it??
Thanx in advance
Inheriting GoView and overriding OnSelectionDeleting
did not work.
The only way I am doing is to call my own function on server side for button click and implementing the logic
to remove the item.
If you solve the bug please post it
Thanx
Ah–the problem is that the definition of that HTML button is trying to refer to a particular GoView given its name. But when you put objects inside a UserControl, that name is no longer correct, because being nested inside a UserControl gives it a different ID.
So clicking that “Delete” button wasn’t invoking any method on that view at all.
If you just replace the HTML button with an ASP.NET button, it works just fine:
private void Button1_Click(object sender, System.EventArgs e) {
MyView.EditDelete();
}
Or to put it another way–using JavaScript code references to particular controls doesn’t work well in UserControls, because the hardcoded names aren’t generalizable when you have multiple instantiations of the UserControl in a Form.
Anyway, it’s pretty clear that GoViews do work in UserControls. It’s just the example HTML buttons that don’t.