You have to set widget's ID to call its methods

  1. #1

    You have to set widget's ID to call its methods

    Hi

    I have recently upgraded to 2.4 and am now reciving this message.

    You have to set widget's ID to call its methods (widget - Ext.Net.Column)

    I dont think anything has changed but the upgrade....

    The ID on the column is set

              <Columns>
                                <ext:Column runat="server" Text="Description" DataIndex="Description" MinWidth="200" Locked="true" Sortable="false" />
                                <ext:Column ID="Col1" runat="server" DataIndex="Col1" Text="Col1">
                                    <Renderer Format="UsMoney" />
                                </ext:Column>
                                <ext:Column ID="Col2" runat="server" DataIndex="Col2" Text="Col2">
                                    <Renderer Format="UsMoney" />
                                </ext:Column>
                                <ext:Column ID="Col3" runat="server" DataIndex="Col3">
                                    <Renderer Format="UsMoney" />
                                </ext:Column>
                                <ext:Column ID="Col4" runat="server" DataIndex="Col4">
                                    <Renderer Format="UsMoney" />
                                </ext:Column>
                                <ext:Column ID="Col5" runat="server" DataIndex="Col5">
                                    <Renderer Format="UsMoney" />
                                </ext:Column>
             </Columns>
    code behind

     
    
               ChargeRate chargeRate = ChargeRatesController.GetChargeRate(chargeRateId);
    
                Col1.Text = chargeRate.Col1Name;
                Col2.Text = chargeRate.Col2Name;
                Col3.Text = chargeRate.Col3Name;
                Col4.Text = chargeRate.Col4Name;
                Col5.Text = chargeRate.Col5Name;
    For some reason the error appears on the 2nd column i.e. "Col2Text = chargeRate.Col2Name;"

    As you can see the Columns of the GridPanel have an ID.
    Any help would be appreciated.

    Here are the error Details:

    System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: You have to set widget's ID to call its methods (widget - Ext.Net.Column) at Ext.Net.BaseControl.CheckID() at Ext.Net.ControlState.SetDirectEventUpdate(String key, Object value) at Ext.Net.ControlState.set_Item(String key, Object value) at Ext.Net.ControlState.Set(String name, Object value) at Ext.Net.ColumnBase.set_Text(String value) at Crest.App.Controls.ChargesPanel.LoadChargeRates(In t32 chargeRateId) in C:\Working\Crest\Crest.App\Controls\ChargesPanel.a scx.cs:line 79 at Crest.App.Controls.ChargesPanel.LoadLabourRates() in C:\Working\Crest\Crest.App\Controls\ChargesPanel.a scx.cs:line 53 --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(IRunt imeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(IRunti meMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Ext.Net.DirectMethod.Invoke(Object target, HttpContext context, ParameterCollection args) at Ext.Net.DirectMethod.Invoke(Object target, ParameterCollection args) at Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temp orary ASP.NET Files\root\b1ccc4a9\80d28e58\App_Web_law4o3vg.1.cs :line 0 at System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e() at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)

    Thanks
    Last edited by glenh; Feb 05, 2014 at 2:43 AM.
  2. #2
    Hi @glenh,

    Seems this member reported the same problem:
    http://forums.ext.net/showthread.php?27934

    Though, he finally said that it was a problem in his environment.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @glenh,

    Seems this member reported the same problem:
    http://forums.ext.net/showthread.php?27934

    Though, he finally said that it was a problem in his environment.
    Hi

    Sorry could you eleborate in regards to "enviroment"?

    Thanks
  4. #4
    I don't know the details, it was his answer:
    http://forums.ext.net/showthread.php...l=1#post124412

    I will ask him to share any details.

    As for me, I cannot reproduce the problem and have no ideas why it might be.
  5. #5
    Dear glenh,
    as requested by Daniil, please do the following step
    remove the following code from your web.config

    <authentication mode="Forms">
          ..........
        </authentication>
    note that I have removed this tag and it worked fine for me.

    regards
  6. #6
    @FPNetworth - Thank you for taking the time to reply on this thread. It is greatly appreciated! I'm curious to know how you figured this out??

    @Daniil - Removing the Authentication tag from the web.config does in-fact stop the error from happening....However, unfortunately for me I am using Forms Authentication so this workaround is not useable. I have however, found a workaround by writing an instance script to do the same thing but this is far from an elegant solution. Given that I have a workaround in place I guess this is not high priority but it would be nice to have a fix. Now that FPNetwork has given some more insight perhaps it is fixable?

                StringBuilder sb = new StringBuilder();
                sb.AppendLine(string.Format("{0}.setText('{1}');", Col1.ClientID, chargeRate.Col1Name));
                sb.AppendLine(string.Format("{0}.setText('{1}');", Col2.ClientID, chargeRate.Col2Name));
    
                ResourceManager.AddInstanceScript(sb.ToString());
    Kind Regards
    Glen
  7. #7
    It seems to be a bug. Let's continue the discussion here:
    http://forums.ext.net/showthread.php...770#post124770
  8. #8
    It has been fixed in the SVN trunk, revision #5658. It will go to the v2.5 release.

    Thank you for the report!
  9. #9
    Thanks Daniil

Similar Threads

  1. Replies: 1
    Last Post: Jan 08, 2014, 6:05 AM
  2. Replies: 15
    Last Post: Sep 12, 2013, 6:01 AM
  3. Replies: 0
    Last Post: Jul 22, 2013, 6:46 AM
  4. Replies: 5
    Last Post: Jun 04, 2013, 2:32 AM
  5. Replies: 3
    Last Post: May 14, 2013, 12:34 AM

Posting Permissions