[CLOSED] Gather Prompt Text value

  1. #1

    [CLOSED] Gather Prompt Text value

    Hi, I've got a prompt and I would like to gather Its text. Here is my code:

    <%@ Page Title="Fabricacion Jhayber" Language="C#" AutoEventWireup="true" CodeBehind="CheckQR.aspx.cs" Inherits="Fabricacion.CheckQR" %>
    <!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 id="FIchaMaquina" runat="server">
        <title>
    
        </title>
        <script type="text/javascript">
    
        </script>
    
    </head>
    <body>
    
        
        <form id="formGeneral" runat="server">
        <ext:ResourceManager ID="ResourceManagerExt" runat="server" IDMode="Explicit" />
        <ext:Viewport runat="server">
            <Items>  
                <ext:Panel runat="server" ID="p2">
                    <Items>
                        <ext:FieldSet runat="server" ID="fieldset2" Title="Faltas">
                            <Defaults>
                                <ext:Parameter Name="labelWidth" Value="35%" />
                            </Defaults>
                            <Items>
                                <ext:TextField Id="notafield" runat="server" Hidden="true" Text="30"/>
                                <ext:TextField Id="tareafield" runat="server"  Hidden="true" Text="CORTADO"/>
                                <ext:PasswordField runat="server" Revealable="true" Id="codigo" Label="Contraseña" ClearIcon="true"  Border="true" MarginSpec="0 0 0 0"/>
                                <ext:SpinnerField runat="server" Id="T37"  Label="Talla 37"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>
                                <ext:SpinnerField runat="server" Id="T38"  Label="Talla 38"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>
                                <ext:SpinnerField runat="server" Id="T39"  Label="Talla 39"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>
                                <ext:SpinnerField runat="server" Id="T40"  Label="Talla 40"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>
                                <ext:SpinnerField runat="server" Id="T41"  Label="Talla 41"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>
                                <ext:SpinnerField runat="server" Id="T42"  Label="Talla 42"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>
                                <ext:SpinnerField runat="server" Id="T43"  Label="Talla 43"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>
                                <ext:SpinnerField runat="server" Id="T44"  Label="Talla 44"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>
                                <ext:SpinnerField runat="server" Id="T45"  Label="Talla 45"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>
                                <ext:SpinnerField runat="server" Id="T46"  Label="Talla 46"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>
                                <ext:SpinnerField runat="server" Id="T47"  Label="Talla 47"  MinValue="0" MaxValue="200" StepValue="1"></ext:SpinnerField>              
                    
                            </Items>
                        </ext:FieldSet>
                        <ext:Container runat="server" Layout="HBoxLayout">
                            <Defaults>
                                <ext:Parameter Name="style" Value="margin: 1em" />
                                <ext:Parameter Name="flex" Value="1" Mode="Raw" />
                                <%-- Use the value 1 not string "1" --%>
                            </Defaults>
                            <Items>
                                <ext:Button
                                    runat="server"
                                    Text="Aceptar y Enviar"
                                    UI="Action"
                                    Scope="this"
                                    ID="formToggleBtn">
                                    <DirectEvents>
                                        <Tap OnEvent="btnLogin_Click"></Tap>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:Button
                                    runat="server"
                                    Text="Cancelar"
                                    UI="Action">
    
                                </ext:Button>
                                <ext:Button runat="server" Text="Prompt">
                                    <Listeners>
                                        <Tap Handler="Ext.Msg.prompt('Title', 'Message', function(buttonId, text) {
                                                            Ext.net.DirectMethods.Test(buttonId, text);
                                                        });" ></Tap>
                                    </Listeners>
                                </ext:Button>
                            </Items>
                        </ext:Container>
                    </Items>
            </ext:Panel>   
        </Items>
     </ext:Viewport>
    </form>   
    
    
    
    </body>
    </html>
    [DirectMethod]
            public void Test(string buttonId, string text)
            {
                X.Msg.Alert("DirectMethod", buttonId + "<br/>" + text).Show();
            }
    As you can see, I've tried to gather it following this answer but it is not working

    Thank you so much


    Edit: Solved!

    <Tap Handler="Ext.Msg.prompt('Title', 'Message', function(buttonId, text) {
                                                            App.direct.Test(buttonId, text);
                                                        });" ></Tap>
    Last edited by fabricio.murta; Oct 29, 2018 at 6:03 PM.
  2. #2
    Hello @PascuV!

    Thanks for sharing the solution and, yes, the way to call direct methods is the way you chosen as the fix, so all good.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Hide The Closable In X.Msg.Prompt
    By Abiand in forum 1.x Help
    Replies: 2
    Last Post: Apr 23, 2014, 9:05 AM
  2. Replies: 9
    Last Post: Nov 23, 2012, 4:13 AM
  3. [CLOSED] Prompt before DirectEvent
    By rthiney in forum 1.x Premium Help
    Replies: 1
    Last Post: Apr 05, 2010, 5:33 PM
  4. Custom Prompt MessageBox
    By EzaBlade in forum 1.x Help
    Replies: 2
    Last Post: Nov 04, 2009, 12:14 PM
  5. Get the value from prompt dialog and save
    By CoolNoob in forum 1.x Help
    Replies: 5
    Last Post: Oct 23, 2009, 3:13 PM

Posting Permissions