Subclassing GoWebImage and GoView

Hi,
I am having real troubles subclassing GoWebImage and GoView.
I have a GoView which seems to be subclassed successfully and simply produces some Javascript.
We also have a GoWebImage Subclass which our drawing page uses as the GoDiagram.aspx. We have successfully inherited the GoWebImage and it does get called when the page is loaded.
I have noticed two issues.

  1. The session state never seems to be stored, so when the Subclassed GoView Control is called using findSessionViews always returns null.
    protected override void OnLoad(EventArgs evt)
    {
    GoView saved = FindSessionView();
    if (saved != null)
    {
    LoadView(saved);
    }
    else
    {
    CreateView();
    OnSessionStarted(EventArgs.Empty);
    }
    base.OnLoad(evt);

// produce helper JavaScript function definitions
RenderScript();
// produce __doPostBack definition
// Form the script that is to be registered at client side.
String scriptString = " function OutputSize() {\n";
scriptString += “var width=document.getElementById(“MCLContainer”).offsetWidth; \n” ;
scriptString +=“var height=document.getElementById(“MCLContainer”).offsetWidth * 3/4;\n”;
scriptString +=“var innerstring = document.getElementById(“MCLContainer”).innerHTML;\n”;
scriptString +=“innerstring=”<IMG SRC=\“MCLView.aspx?MCLGoView=Viewer1&width=”+ width +"&height="+height+ “\” name=\“Viewer1\” width=\"" + width + “\” height=\""+height+ “\”>";\n";
scriptString +=“var innerstring = document.getElementById(“MCLContainer”).innerHTML=innerstr ing;}<”;
scriptString += “/”;
scriptString += “script>”;
if(!this.Page.IsClientScriptBlockRegistered(“clientScript”))this.Page.RegisterClientScriptBlock(“clientScript”, scriptString);
this.Page.GetPostBackEventReference(this);
}
Why would it always return null? I have implemented OnInit on the GoView and OnLoad on the GoView as per the UserGuide. The second point to note (and I think this is where the problem is comming in) is that if we simply use the Normal GoWebImage as the page we are using as the image, the image was displayed fine (It is not working now). It is when we create a SubClass of GoWebImage we run into problems. Are there any examples of subclassing GoWebImage? If there it would be a massive help to me, as we have this important task we have to complete ASAP.
Regards,
Paul

Could you try using the 2.2 Release Candidate? I’m not sure what problem you are running into, but there might be a bug fix in there that could help.
http://www.nwoods.com/go/evaluation.htm

Hi Walter,
I will give the Release Candidate a go, however, we are going to be using the Overview/Subclassed views and GoWebImages in a production environment so I am not to sure if we can get candidate releases in (Especially the licencing from yourselves). On a side note, is the licencing of the controls any differnent if we have the current versions of the software purchased and upgrades for the year?
Regards,
Thanks for your help.
Paul

All GoDiagram controls are licensed in the same manner and with the same terms. Everyone who has purchased recently can upgrade for free to version 2.2. If you requested unlock codes for version 2.1, you’ll need to re-request new unlock codes for the version 2.2 components.
Regarding your particular override implementations, I do notice a couple of issues.
First, your GoView.OnLoad override shouldn’t be duplicating all that code from GoView’s implementation. You should just call the base method and then call RegisterClientScriptBlock.
Second, the scriptString you are generating looks wrong. I haven’t taken the time to figure out exactly what it’s generating, but I do notice that the query parameter to the GoWebImage subclass is wrong. It ought to be something like:
…“MCLView.aspx?GoView=” + view.MakeSessionViewID() + “&”…
where GoView.MakeSessionViewID() is a new method we have added in version 2.2 so that you can properly identify the view in the session state’s table of views, as returned by GoView.GetSessionViewsTable().

Thanks Walter
I will Look into it now.
Regards,
Paul