Welcome Guest Search | Active Topics | Members

Problem with rubberband not found on postbacks/ajax actions Options
Stefan Haupt
Posted: Wednesday, October 24, 2007 11:35:35 PM
Rank: Member
Groups: Member

Joined: 10/24/2007
Posts: 12
Points: 6
Hi

I have integrated your code in a large solution. The code compiles fine but ajax actions do nothing and postbacks return ControlNotFound exceptions. Se code below (which should look familar as it is taken more or less directly from your examples):
Code:

                                    <td>
                                        <input id="ButtonCrop" onclick="Crop();" type="image" src="Images\ImageEditor\crop.jpg" /> &nbsp;
                                        <input id="ButtonRotateRight" onclick="RotateRight();" type="image" src="Images\ImageEditor\right.jpg" /> &nbsp;
                                        <input id="ButtonRotateLeft" onclick="RotateLeft();" type="image" src="Images\ImageEditor\left.jpg" /> &nbsp;
                                        <input id="ButtonBrightnessUp" onclick="BrightnessUp();" type="image" src="Images\ImageEditor\light.jpg" /> &nbsp;
                                        <input id="ButtonBrightnessDown" onclick="BrightnessDown();" type="image" src="Images\ImageEditor\dark.jpg" />
                                    </td>
                                </tr>
                                <tr>
                                    <td valign="top">
                                        <aur:BitmapViewer ID="viewer" runat="server" Width="344px" Height="270px" ImageLoadMode="AdaptiveTile" Rubberband="RectangleRubberband1"
                                            ZoomMode="BestFitShrinkOnly" ViewportAlignment="CenterCenter" BorderWidth="2" BorderStyle="Inset" ScrollBarsStyle="Auto" BackColor="White">
                                        </aur:BitmapViewer>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td valign="top" width="100">
                                        <span id="SpanWarning" style="display: none; font-weight: bold; color: red">Selected
                                            area is too small to get good quality of prints. </span>
                                        <asp:CustomValidator ID="imageValidation" runat="server"></asp:CustomValidator>
                                    </td>
                                    <td>
                                        <asp:Button ID="OK" runat="server" OnCommand="UploadImage" Text="Gem" />
                                    </td>
                                </tr>
                            </table>
                            <aur:RectangleRubberband ID="RectangleRubberband1" runat="server" ResizeMode="Proportional" GripsVisible="True" MaskVisible="True" />
                            <script type="text/javascript">
                                Sys.Application.add_load(Application_load);
                            </script>


exception message is: Can't locate rubberband with ClientID equals 'RectangleRubberband1'.

The solution also contains other ajax components, can this be an issue?

Regards
<stefan>
Stefan Haupt
Posted: Thursday, October 25, 2007 2:18:50 AM
Rank: Member
Groups: Member

Joined: 10/24/2007
Posts: 12
Points: 6
More details: the problems seem to start in this javascript method Sys$WebForms$PageRequestManager$_onFormSubmit

In line 764, this call fails if (!this._postBackSettings.async) {, as postBackSettings is null.....
Stefan Haupt
Posted: Thursday, October 25, 2007 2:20:43 AM
Rank: Member
Groups: Member

Joined: 10/24/2007
Posts: 12
Points: 6
Even though I pass 'viewer.invokeRemo....' in the javascript code shown below the .cs code is never reached

Code:
function Crop(){
      if (viewer.get_status() != GraphicsMill.UpdateStatus.busy) {
            //Process cropping via remote scripting
            var r = rectangleRubberband.get_rectangle();
            if (r.width < 1 || r.height < 1) {
                  return;
            }
      
            viewer.invokeRemoteMethod("Crop", [r.x, r.y, r.width, r.height]);      

            updateRectangle=true;
      }
      else {
            alert("Please wait until previous operation will be completed.");
      }
}
Sergey Peshekhonov
Posted: Friday, October 26, 2007 12:09:17 AM
Rank: Advanced Member
Groups: Member

Joined: 6/6/2007
Posts: 57
Points: 45
Hello, Stefan.

We confirm the problem. To get rid of this error you should move your BitmapViewer and RectangleRubberband to the root form tag of your page.

If this solution is not suitable for you please submit case.

Sincerely yours,
Sergey Peshekhonov.

Aurigma Technical Support Team.
Stefan Haupt
Posted: Friday, October 26, 2007 1:06:09 AM
Rank: Member
Groups: Member

Joined: 10/24/2007
Posts: 12
Points: 6
Thank you, I have come to the same conclusion and this works just fine for me.

The funny part is that IE7 does not fail on ajax actions but FireFox 2 (and Safari 3) do.

Regards
Stefan Haupt
Posted: Tuesday, June 24, 2008 7:24:44 AM
Rank: Member
Groups: Member

Joined: 10/24/2007
Posts: 12
Points: 6
Hi

I have the same problem again.

We have av new framework that creates most of a page during preinit adding controls programatically. There is nothing in the .aspx file itself.

Again I get "Can't locate rubberband with ClientID equals 'rectangleRubberband'." during postbacks or ajax interactions....

Preinit occurs before the exceptions is thrown so the page structure should be present. Looking at the html confirms a control with that name is indeed present on the page.....

Please advise ;->

Stack trace is this:

[ControlNotFoundException: Can't locate rubberband with ClientID equals 'rectangleRubberband'.]
Aurigma.GraphicsMill.AjaxControls.BaseViewer.LoadPostData(String postDataKey, NameValueCollection postCollection) +855
Aurigma.GraphicsMill.AjaxControls.BitmapViewer.LoadPostData(String postDataKey, NameValueCollection postCollection) +67
Aurigma.GraphicsMill.AjaxControls.BaseViewer.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +36
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +661
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1194

Best regards
<stefan>
Alex Kon
Posted: Wednesday, June 25, 2008 10:27:18 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 388
Points: 409
Hello Stefan,

Please, could you create support case for this issue and attach small code sample to reproduce the issue?


Best wishes, Alex.
Users browsing this topic
Guest


Forum Jump
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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.