decoded html after ajaxmethod

Page 1 of 4 123 ... LastLast
  1. #1

    decoded html after ajaxmethod

    i have an encode string returned from an ajaxmethod... but on the ajaxmethod success callback function, the returned string is already decoded... is this also affected by having the file upload field on the page?


    Coolite.AjaxMethods.uchrcaPublicQS.publishQuestionSetToCompany( 
                                tobepid, tobepwid,
                                { 
                                    success: function(result)  
                                        {   //result is already decoded html }
  2. #2

    RE: decoded html after ajaxmethod

    Hi,

    I am sure that it is FileUploadField. Try to add to the config object of the AjaxMethod
    type : "load"
  3. #3

    RE: decoded html after ajaxmethod

    this html decoding that the file upload field is causing is really messed up,,, anyway another issue i have just tried using type = load for an ajax event but i am having this error

    this.loadMask.destroy is not a function

    code which triggers ajaxevent is below

    
    <AjaxEvents>
                        <DblClick OnEvent="PortalAdministrationIcon_DblClick" Failure="HRCA_ShowError('Load failed', result.errorMessage)" Type="Load">
                            <EventMask ShowMask="true" Msg="Loading..." Target="CustomTarget" CustomTarget="#{winPortalAdministration}" />
                            <ExtraParams>
                                <ext:Parameter Name="id" Value="#{PortalAdministrationDataView}.getRecord(node).get('id')" Mode="Raw"/>
                                <ext:Parameter Name="name" Value="#{PortalAdministrationDataView}.getRecord(node).get('name')" Mode="Raw"/>
                            </ExtraParams>
                        </DblClick>
                    </AjaxEvents>
  4. #4

    RE: decoded html after ajaxmethod

    Hi,

    Please provide test sample which causes that issue
  5. #5

    RE: decoded html after ajaxmethod

    this is a complex page which contains multiple user controls... i have only experienced this error when i added type = load on the ajaX event
  6. #6

    RE: decoded html after ajaxmethod

    this is the code of the store and the grid where the data is loaded during the ajax event

    
    <ext:Store ID="PageManagerStore" runat="server" AutoLoad="true" ShowWarningOnFailure="false">
                <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="id" Type="Int" />
                            <ext:RecordField Name="title" Type="String" >
                                <Convert Handler="return Ext.util.Format.htmlEncode(title);" /> 
                            </ext:RecordField>
                            <ext:RecordField Name="author" Type="String" />
                            <ext:RecordField Name="content" Type="String" />
                            <ext:RecordField Name="dateCreated" Type="Date" />
                            <ext:RecordField Name="dateModified" Type="Date" />
                            <ext:RecordField Name="type" Type="String" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
                <Listeners>
                    <LoadException Handler="HRCA_ShowError('Load failed', e.message)" />
                </Listeners>
            </ext:Store>
            <ext:FitLayout runat="server" >
                <ext:GridPanel
                    ID="PageManagerGridPanel"
                    runat="server"
                    StoreID="PageManagerStore"
                    AutoExpandColumn="Title"
                    StripeRows="true"
                    AutoHeight="false"
                >
                    <ColumnModel ID="PageManagerColumnModel" runat="server">
                        <Columns>
                            <ext:Column ColumnID="ID" Header="ID" DataIndex="id" Hidden="true" />
                            <ext:Column ColumnID="Title" Header="Title" DataIndex="title" >
                                <Renderer Fn="htmlrenderer" />
                            </ext:Column>
                            <ext:Column ColumnID="Author" Header="Author" DataIndex="author" />
                            <ext:Column ColumnID="Content" Header="Content" DataIndex="content" Hidden="true" />
                            <ext:Column ColumnID="DateCreated" Header="Date Created" DataIndex="dateCreated" Width="90"/>
                            <ext:Column ColumnID="DateModified" Header="Date Modified" DataIndex="dateModified" Width="90"/>
                            <ext:Column ColumnID="Type" Header="Type" DataIndex="type" Width="60"/>
                        </Columns>
                    </ColumnModel>
                    <Listeners>
                        <RowDblClick Fn="PageManagerEditPage_Click" />
                        <Failure Handler="HRCA_ShowError('', e.message)" />
                    </Listeners>
                    <SelectionModel>
                        <ext:RowSelectionModel runat="server" SingleSelect="true"/>
                    </SelectionModel>
                </ext:GridPanel>
            </ext:FitLayout>

    the script error seem to come from a grid panel since this is the part where coolite.axd shows the error

    {Ext.grid.GridPanel.superclass.afterRender.call(this);this.view.layout();if(this.deferRowRender){this.view.afterRender.defer(10,this.view);}else{this.view.afterRender();}
    this.viewReady=true;},reconfigure:function(store,colModel){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({},{store:store},this.initialConfig.loadMask));}
  7. #7

    RE: decoded html after ajaxmethod

    Hi,

    Do you call reconfigure for the GridPanel ?
  8. #8

    RE: decoded html after ajaxmethod

    nope, this is the full ajax event method

    
    protected void PortalAdministrationIcon_DblClick(object sender, AjaxEventArgs e)
            {
                int id = Convert.ToInt32(e.ExtraParams["id"]);
                string name = e.ExtraParams["name"];
                try
                {
                    if (isAccessible)
                    {
                        switch (id)
                        {
                            case 0:
                                bindPortalContentPages();
                                winPageManager.Title = name;
                                winPageManager.AddScript(@"var win = Ext.getCmp('" + winPageManager.ClientID + @"');
                                        if (!win.rendered)
                                        {
                                            win.render(Ext.get(&#100;ocument.forms[0]));
                                            windowchecker(win);
                                        }
                                        win.show();
                                        checkAndRenderWindow(Ext.getCmp('" + winPageEditor.ClientID + "'))");
                                break;
    
                            case 1:
                                bindPortalMenuItems();
    
                                BindMenuEditorPageItems();
                                BindMenuEditorParentItems();
    
                                winMenuManager.Title = name;
                                winMenuManager.AddScript(@"var win = Ext.getCmp('" + winMenuManager.ClientID + @"');
                                        if (!win.rendered)
                                        {
                                            win.render(Ext.get(&#100;ocument.forms[0]));
                                            windowchecker(win);
                                        }
                                        win.show();");
                                break;
                            case 2:
                                winRollover.Title = name;
                                winRollover.Show();
                                break;
                            case 3:
                                winInstructions.Title = name;
                                winInstructions.Show();
                                break;
                            case 4:
                                winCommonPages.Title = name;
                                winCommonPages.Show();
                                break;
                            case 5:
                                winConfig.Title = name;
                                winConfig.Show();
                                break;
                        }
                    }
                    else
                        throw new Exception("Only HRCA Admins can access this module");
                }
                catch (Exception ex)
                {
                    e.Success = false;
                    e.ErrorMessage = ex.Message;
                }
            }
  9. #9

    RE: decoded html after ajaxmethod

    i'm thinking of putting the file upload field to another page but the problem is that it seems like i have to put the whole form into the other page and not the field upload field only.. and a lot of checking would have to be done there as well, since this is within a window and within a complex page

    even the panel's field label is not showing... the panel is occupying the whole row and the field label is not shown

    
    <ext:Anchor>
                                <ext:Panel runat="server" Height="25" FieldLabel="File" >
                                    <AutoLoad Url="Pages/FileUploader.aspx" Mode="IFrame" Text="File" NoCache="True" ></AutoLoad>
                                </ext:Panel>
                            </ext:Anchor>
    isn't there any other way to let the fileuploadfield do its thing without it having to decode the response while making it stay in the page?
  10. #10

    RE: decoded html after ajaxmethod

    or isn't there any way to encode the response or the store after data is binded?
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Cant send html string as parameter to AjaxMethod
    By masudcseku in forum 1.x Help
    Replies: 9
    Last Post: Jul 19, 2011, 10:38 PM
  2. Can I send a string with html tag to Ajaxmethod?
    By masudcseku in forum 1.x Help
    Replies: 1
    Last Post: Jul 19, 2011, 10:31 PM
  3. Replies: 1
    Last Post: May 28, 2010, 1:13 PM
  4. Replies: 2
    Last Post: Jan 08, 2010, 2:47 AM
  5. 0.82 encoded html getting decoded on store
    By [WP]joju in forum 1.x Help
    Replies: 15
    Last Post: Dec 23, 2009, 6:40 AM

Posting Permissions