[CLOSED] No Send Values of TextField with PasswordMask in FormaPanel getValues()

  1. #1

    [CLOSED] No Send Values of TextField with PasswordMask in FormaPanel getValues()

    Hi How Can I not to send the values of TextField with PasswordMask with the method
    Ext.encode(this.up('form').getForm().getValues(false, false, false, true))
    because I to get the next values:



            <ext:FormPanel
                ID="fpUsuario"
                runat="server"
                BodyPadding="10"
                ButtonAlign="Right"
                Width="750"
                Height="380">
                <Items>
                    <ext:TextField
                        ID="txtfContrasena"
                        runat="server"
                        FieldLabel="Contrase?a"
                        LabelWidth="105"
                        MaxLength="50"
                        EnforceMaxLength="true"
                        AllowBlank="false"
                        Width="350"
                        StyleSpec="margin-right: 6px;">
                        <Plugins>
                            <ext:PasswordMask ID="pmContrasena" runat="server">
                            </ext:PasswordMask>
                            <ext:CapsLockDetector ID="cldContrasena" runat="server">
                                <Listeners>
                                    <CapsLockOn Handler="#{txtfContrasena}.showIndicator({iconCls : '#Error', tip : 'BloqMay?s esta activado'});" />
                                    <CapsLockOff Handler="#{txtfContrasena}.hideIndicator();" />
                                </Listeners>
                            </ext:CapsLockDetector>
                        </Plugins>
                    </ext:TextField>
                    <ext:TextField
                        ID="txtfConfirmarContrasena"
                        runat="server"
                        FieldLabel="Confirmar"
                        LabelWidth="105"
                        MaxLength="50"
                        EnforceMaxLength="true"
                        AllowBlank="false"
                        Width="350"
                        StyleSpec="margin-right: 6px;">
                        <Plugins>
                            <ext:PasswordMask ID="pmConfirmarContrasena" runat="server"  />
                            <ext:CapsLockDetector ID="cldConfirmarContrasena" runat="server">
                                <Listeners>
                                    <CapsLockOn Handler="#{txtfConfirmarContrasena}.showIndicator({iconCls : '#Error', tip : 'BloqMay?s esta activado'});" />
                                    <CapsLockOff Handler="#{txtfConfirmarContrasena}.hideIndicator();" />
                                </Listeners>
                            </ext:CapsLockDetector>
                        </Plugins>
                    </ext:TextField>
                </Items>
                <Listeners>
                    <ValidityChange Handler="this.dockedItems.get(0).setStatus({
                                                    text : valid ? 'La informaci?n esta completa/correcta' : 'Existe informaci?n incompleta/incorrecta', 
                                                    iconCls: valid ? 'icon-accept' : 'icon-exclamation'
                                                });
                                                #{imgbtnGuardar}.setDisabled(!valid);" />
                </Listeners>
                <Buttons>
                    <ext:Button
                        ID="imgbtnGuardar" 
                        runat="server"
                        Disabled="true"
                        Text="Save">
                        <DirectEvents>
                            <Click OnEvent="imgbtnGuardar_Click">
                                <EventMask ShowMask="true" Msg="Registrando informaci?n..." />
                                <ExtraParams>
                                    <ext:Parameter Name="registro" Value="Ext.encode(this.up('form').getForm().getValues(false, false, false, true))" Mode="Raw" />
                                </ExtraParams>
                            </Click>
                        </DirectEvents>
                    </ext:Button>
                </Buttons>
                <BottomBar>
                    <ext:StatusBar
                        ID="sbUsuario" 
                        runat="server" 
                        Cls="x-colorToolbar"
                        Text="Sin validar informaci?n" />
                </BottomBar>
            </ext:FormPanel>
            protected void imgbtnGuardar_Click(object sender, DirectEventArgs e)
            {
                //1. Obtener datos de la Forma y saber si es edici?n o nuevo
                string strRegistro = e.ExtraParams["registro"];
                Dictionary<string, string> dRegistro = JSON.Deserialize<Dictionary<string, string>>(strRegistro);
            }
    Or, How Can I to get reslve the error?:



    I would like resolve the two problems thank you.
    Attached Thumbnails PasswordMask.png   PasswordMask2.png  
    Last edited by Daniil; Jan 14, 2015 at 5:26 PM. Reason: [CLOSED]
  2. #2
    Hi @osef,

    I can suggest this solution.

    Example
    <%@ Page Language="C#" %>
    
    <script runat="server">
        protected void Submit(object sender, DirectEventArgs e)
        {
            string data = e.ExtraParams["data"];
            Dictionary<string, string> dict = JSON.Deserialize<Dictionary<string, string>>(data);
    
            X.Msg.Alert("", dict["PasswordTextField"]).Show();
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    
        <script>
            var getData = function () {
                var data = App.FormPanel1.getForm().getValues(false, false, false, true);
    
                data.PasswordTextField = data.PasswordTextField[1];
                return data;
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:FormPanel ID="FormPanel1" runat="server">
                <Items>
                    <ext:TextField ID="PasswordTextField" runat="server" Text="SomePassword1" SubmitValue="false">
                        <Plugins>
                            <ext:PasswordMask runat="server" />
                        </Plugins>
                    </ext:TextField>
                </Items>
            </ext:FormPanel>
    
            <ext:Button runat="server" Text="Submit">
                <DirectEvents>
                    <Click OnEvent="Submit">
                        <ExtraParams>
                            <ext:Parameter Name="data" Value="getData()" Mode="Raw" />
                        </ExtraParams>
                    </Click>
                </DirectEvents>
            </ext:Button>
        </form>
    </body>
    </html>
  3. #3
    Thank you Daniil this is working.

Similar Threads

  1. Replies: 1
    Last Post: Jan 14, 2015, 5:00 AM
  2. Values in Gridpanel Editor Textfield
    By Anburaja in forum 1.x Help
    Replies: 2
    Last Post: Oct 13, 2012, 3:51 AM
  3. Cannot get TextField values.
    By acuenca in forum 1.x Help
    Replies: 5
    Last Post: Jun 14, 2011, 2:58 PM
  4. 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
  5. Get TextField Values From UserControl
    By gpcontreras in forum 1.x Help
    Replies: 2
    Last Post: Feb 01, 2010, 10:25 AM

Tags for this Thread

Posting Permissions