[CLOSED] Desktop problem & question

  1. #1

    [CLOSED] Desktop problem & question

    Hi,

    in my MVC application I have a desktop with the follong DesktopWindow:

     <ext:DesktopWindow 
      ID="winChangePassword" 
      runat="server" 
      Title="Modifica Password" 
      Icon="Lock"
      InitCenter="true"
      ShowInTaskbar="false"       
      Width="490"
      Height="170"
      Modal="true"
      Maximizable="false"
      Minimizable="false"
      Closable="false">
      <AutoLoad Url="/EasyRapp/Home/ChangePassword/" Mode="IFrame" />
     </ext:DesktopWindow>
    and this is the ChangePassword.aspx page:

    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" 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 id="PwdHead" runat="server">
            <title></title>
     
            <ext:ResourcePlaceHolder ID="PwdResourcePlaceHolder" runat="server" />
            <script type="text/javascript">
                setButton = function () {
                    var f = PwdMainFormPanel.getForm();
                    btnChangePwdWinOK.setDisabled(!(f.isValid() && f.isDirty()));
                };
                checkPassword = function () {
                    if (newPassword.getValue() != verifyPassword.getValue()) {
                        Ext.Msg.show({
                            title: 'Attenzione',
                            msg: 'Nuova password e verifica password non coincidono.',
                            buttons: Ext.Msg.OK,
                            icon: Ext.MessageBox.WARNING
                        });
                        return false;
                    }
                    if (oldPassword.getValue() == newPassword.getValue()) {
                        Ext.Msg.show({
                            title: 'Attenzione',
                            msg: 'Vecchia password e nuova password devono essere differenti.',
                            buttons: Ext.Msg.OK,
                            icon: Ext.MessageBox.WARNING
                        });
                        return false;
                    }
                    return true;
                };
            </script>
        </head>
        <body>
            <ext:ResourceManager ID="PwdScriptManager" runat="server" RemoveViewState="true"/>
            <ext:ViewPort ID="PwdViewPort" runat="server" Layout="fit">
                <Items>
                    <ext:FormPanel 
                        ID="PwdMainFormPanel"
                        runat="server"
                        FormID="TheChangePasswordForm"
                        Frame="true"
                        MonitorValid="true"
                        MonitorPoll="500"
                        BodyStyle="padding:17px 10px 17px 10px;background-color:transparent;" 
                        Border="false"
                        LabelWidth="120">
                        <Defaults>
                            <ext:Parameter Name="anchor" Value="100%" Mode="Value" />
                        </Defaults>
                        <Items>
                            <ext:TextField
                                ID="oldPassword"
                                runat="server"
                                FieldLabel="Vecchia Password"
                                InputType="Password"
                                AllowBlank="false"
                                MaxLength="40" />
                            <ext:TextField
                                ID="newPassword"
                                runat="server"
                                FieldLabel="Nuova Password"
                                InputType="Password"
                                AllowBlank="false"
                                MaxLength="40" />
                            <ext:TextField
                                ID="verifyPassword"
                                runat="server"
                                FieldLabel="Verifica Password"
                                AllowBlank="false"
                                InputType="Password"
                                MaxLength="40" />
                        </Items>
                        <Buttons>
                            <ext:Button runat="server" ID="btnChangePwdWinOK" Text="Esegui" Icon="Accept">
                                <Listeners>
                                    <Click Fn="checkPassword" />
                                </Listeners>
                                <DirectEvents>
                                    <Click
                                        Url="~/Account/ChangePassword/"
                                        FormID="TheChangePasswordForm"
                                        CleanRequest="true"
                                        Method="POST"
                                        Before="Ext.Msg.wait('Operazione in corso...', 'Modifica Password');"
                                        Success="Ext.Msg.hide();parent.MyDesktop.getDesktop().getManager().getActive().hide();"
                                        Failure="Ext.Msg.show({
                                           title:   'Errore in fase di modifica Password',
                                           msg:     result.errorMessage,
                                           buttons: Ext.Msg.OK,
                                           icon:    Ext.MessageBox.ERROR
                                        });">
                                        <EventMask MinDelay="200" />
                                        <Confirmation ConfirmRequest="true" Title="Modifica Password" Message="Al termine dell'operazione ti verrĂ  nuovamente presentata la maschera di login.<br />Confermi la modifica della password?" />
     
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                            <ext:Button runat="server" ID="btnChangePwdWinExit" Text="Esci" Icon="ApplicationGo">
                                <Listeners>
                                    <Click Handler="#{PwdMainFormPanel}.getForm().reset();parent.MyDesktop.getDesktop().getManager().getActive().hide();" />
                                </Listeners>
                            </ext:Button>
                        </Buttons>
                        <Listeners>
                            <ClientValidation Fn="setButton" />
                        </Listeners>
                    </ext:FormPanel>
                </Items>
     
                <Listeners>
                    <Show Handler="alert('Hello!');" />
                </Listeners>
     
            </ext:ViewPort>
        </body>
    </html>
    1) When the confirmation message is displayed it's truncated, how you can see in the attached image. How can I display a message larger then the window dimensions?

    2) The ViewPort Show Listener doesn't fire

    3) parent.MyDesktop.getDesktop().getManager().getActi ve().hide(); is the right way to hide the window or there is a simpler way?

    Bye,
    Stefano
    Last edited by Daniil; Mar 08, 2011 at 11:50 AM. Reason: [CLOSED]
  2. #2
    Hi,

    1. Does the trancating occur during the confirmation only? Try to set the following property for AutoLoad object
    TriggerEvent="show"
    2. Show even is fired if a component was hidden and show method is called. In your case ViewPort was never hidden. Try Render event

    3. Try
    parentAutoLoadControl.hide();
  3. #3
    Hi,

    Quote Originally Posted by Stefanaccio View Post
    1) When the confirmation message is displayed it's truncated, how you can see in the attached image. How can I display a message larger then the window dimensions
    There is no way to use the space outside of iframe. You could use an additional <br > to get all message visible. Or increase the password window's size.

    Quote Originally Posted by Stefanaccio View Post
    2) The ViewPort Show Listener doesn't fire
    In according to the ExtJS docs
    Fires after the component is shown when calling the show method.
    Well, .show() method is not called and, accordingly, 'show' event is not fired. You could use AfterRender event instead of Show.


    Quote Originally Posted by Stefanaccio View Post
    3) parent.MyDesktop.getDesktop().getManager().getActi ve().hide(); is the right way to hide the window or there is a simpler way?
    It can look like this:
    parent.DesktopWindow1.hide();
  4. #4
    Hi,

    1) Ok, I increased the size of the window

    2) The AfterRender event fires only the first time I show the window. If I close the window and I reopen it, the AfterRender event doesn't fire.
    I need a way to trigger an event every time I show the widow. How can I accomplish this?

    3) parent.DesktopWindow1.hide() works. My problem is that ChangePassword.aspx is called also from a non-Desktop page and i need a way to generically hide the window without having to know the parent ID. parentAutoLoadControl.hide(); (as suggested by Vladimir) works regardless of the Desktop environment?

    Bye,
    Stefano
  5. #5
    Quote Originally Posted by Stefanaccio View Post
    2) The AfterRender event fires only the first time I show the window. If I close the window and I reopen it, the AfterRender event doesn't fire.
    I need a way to trigger an event every time I show the widow. How can I accomplish this?
    You could use the Show event of DesktopWindow. I see in #3 that you also use this page in non-Desktop context... Well, please try the following Viewport's AfterRender listener to get universality of iframe page.

    Example
    <AfterRender Handler="alert('Hello (AfterRender )!'); parentAutoLoadControl.on('show', function () { alert('Hello (Show)!'); });" />

    Quote Originally Posted by Stefanaccio View Post
    3) parent.DesktopWindow1.hide() works. My problem is that ChangePassword.aspx is called also from a non-Desktop page and i need a way to generically hide the window without having to know the parent ID. parentAutoLoadControl.hide(); (as suggested by Vladimir) works regardless of the Desktop environment?
    Yes, it is universal.
  6. #6
    Hi,

    thanks, you can mark as CLOSED.

    Bye,
    Stefano

Similar Threads

  1. [CLOSED] Question about desktop window
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: May 25, 2012, 8:00 AM
  2. [CLOSED] Another question about Desktop Menu
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 19, 2012, 6:14 PM
  3. Desktop Problem
    By snouto in forum 1.x Help
    Replies: 1
    Last Post: May 24, 2010, 10:44 AM
  4. Question about using Desktop control
    By vali1993 in forum 1.x Help
    Replies: 2
    Last Post: Jan 20, 2010, 3:15 PM
  5. [CLOSED] Desktop bug and question.
    By juanpablo.belli@huddle.com.ar in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 09, 2009, 11:40 AM

Posting Permissions