Extra parameters Ajax Method from a Text Field

  1. #1

    Extra parameters Ajax Method from a Text Field

    Hello, I have a problem.

    I have window with Showonload="false". When I click a button show this window.

    In this window I have 2 textfield and 1 button.

    When click this button I want to call a method "add_purl" presents in the code behind.

    My problem is to pass the Extra Params to the method.

    Post the code

    <ext:Window ID="Window_add_PURL"  runat="server"  Icon="Star" Title="Add a new Prefered url"
        Show&#111;nload="false" X="250" Y="100" Height="150" Width="250">
       
    
        <Body>
       
    <table><tr><td style="padding: 10px 10px 10px
    10px;"><ext:Label runat="server"
    Text="Url"></ext:Label></td>
            <td><ext:TextField ID="purl_descr" Text="www" LabelCls="Description:" runat="server">
            </ext:TextField></td>
           
    </tr><tr><td style="padding: 10px 10px 10px
    10px;"><ext:Label runat="server"
    Text="Description"></ext:Label></td>
            <td><ext:TextField ID="purl_url" FieldLabel="URL:" runat="server" >
            </ext:TextField></td>
            </tr><tr><td colspan="2" align="center">
            <ext:Button ID="bt_add_purl"  HandleMouseEvents="true" runat="server" Text="Add" Flat="true"
                Icon="Accept">
                <AjaxEvents>
               
                    <Click OnEvent="add_purl">
                      
                        <EventMask ShowMask="true" MinDelay="500" Msg="Saving setting..." />
                        <ExtraParams>
                            <ext:Parameter Name="descr" Mode="Raw" Value="purl_descr.Text">
                            </ext:Parameter>
                            <ext:Parameter Name="url" Mode="Raw" Value="purl_url.Text">
                            </ext:Parameter>
                        </ExtraParams>
                    </Click>
                </AjaxEvents>
            </ext:Button></td></tr>
            </table>
           
    
        </Body>
    </ext:Window>
    If the extra params descr and url are in mode "Value" NO problem, it's all ok, but in mode "raw" the button
    does not work.

    Please help Me

    Thanks
  2. #2

    RE: Extra parameters Ajax Method from a Text Field

    Hi davromu,

    You should use .getValue() instead of .Text for each of the parameter values.

    Example

    Value="purl_descr.getValue()"
    Hope this helps.

    Geoffrey McGill
    Founder
  3. #3

    RE: Extra parameters Ajax Method from a Text Field

    Thanks for the interest, but don't change nothing.

    Whene click the button of the "Window_add_PURL" I have No reaction from the system.

    If I use mode = "value" I have a correct reaction, but is not interested for my example.

    probably is wrong the path of the object purl_descr??? I try a lot of combinations but no one positive effects.


    Thanks
  4. #4

    RE: Extra parameters Ajax Method from a Text Field

    Hi davromu,

    I tested your code sample, and if I include the change to .getValue(), it appears to work fine.


    There must be something else affecting the sample that you are not posting. Can you provide a simplified .aspx code sample demonstrating how to reproduce the error?


    See http://forums.ext.net/showthread.php...ing-New-Topics
    Last edited by geoffrey.mcgill; Feb 20, 2011 at 12:01 PM.
    Geoffrey McGill
    Founder
  5. #5

    RE: Extra parameters Ajax Method from a Text Field



    I am experiencing the same issue with the following code - the value from the textfield is not getting passed in as the autoload param value
    
    
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="v2.aspx.cs" Inherits="Calculator_v2" %>
    
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    
    <head runat="server">
    
    
    <title>Untitled Page</title>
    
    
    </head>
    
    
    <body>
    
    
    <form id="form1" runat="server">
    
    
    <ext:ScriptManager ID="ScriptManager1" runat="server">
    
    
    </ext:ScriptManager>
    
    
    <div style="padding-left: 40px; padding-top: 40px;">
    
    
    <ext:TabPanel ID="TabPanel1" runat="server" Plain="true" Border="false" ActiveTabIndex="0"
    
    
    DeferredRender="false" Width="940" Height="600">
    
    
    <Tabs>
    
    
    <ext:Tab ID="Tab1" runat="server" Title="Report Selection">
    
    
    <Body>
    
    
    <div style="padding-top: 20px; padding-left: 20px;">
    
    
    <ext:TextField runat="server" ID="txtCriteria" />
    
    
    <ext:Button runat="server" ID="btnGo" Text="Go" >
    
    
    <AjaxEvents>
    
    
    <Click OnEvent="Search" ></Click>
    
    
    </AjaxEvents>
    
    
    </ext:Button> 
    
    
    
    
    
    
    </Body>
    
    
    </ext:Tab>
    
    
    <ext:Tab ID="Tab2" runat="server" Title="Hospital Based HCPCS/CPT" Hidden="true" >
    
    
    <AutoLoad Url="~/Calculator/V2/Reports/HCPCS.aspx" ShowMask="true" Mode="IFrame" >
    
    
    <Params>
    
    
    <ext:Parameter Name="Criteria" Mode="Raw" Value="#{txtCriteria}.getValue()"> </ext:Parameter>
    
    
    </Params>
    
    
    </AutoLoad> 
    
    
    </ext:Tab>
    
    
    <ext:Tab ID="Tab3" runat="server" Title="Professional Fees" Hidden="true">
    
    
    <Body>
    
    
    </Body>
    
    
    </ext:Tab>
    
    
    <ext:Tab ID="Tab4" runat="server" Title="ASC Reimbursement" Hidden="true">
    
    
    <Body>
    
    
    </Body>
    
    
    </ext:Tab>
    
    
    </Tabs>
    
    
    </ext:TabPanel>
    
    
    
    
    
    
    </form>
    
    
    </body>
    
    
    </html>

Similar Threads

  1. [CLOSED] Extra Parameters in Textfields
    By trezv in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 03, 2012, 3:24 PM
  2. Replies: 4
    Last Post: Apr 21, 2011, 6:04 AM
  3. send extra parameters on blur event of textfield editor inside gridpanel
    By aditya.murthy88@gmail.com in forum 1.x Help
    Replies: 2
    Last Post: Dec 11, 2010, 12:04 PM
  4. Listener Fn - How can I pass extra parameters?
    By lionelhutz in forum 1.x Help
    Replies: 0
    Last Post: Dec 10, 2009, 5:25 PM
  5. Replies: 2
    Last Post: Jan 27, 2009, 3:56 PM

Posting Permissions