in
Forums
Blogs
Files
Devexpress.Com
ClientCenter
Support Center
DevExpress Channel

Urgent help required on win <> web convertion

Last post 8/22/2008 7:35 AM by Raven Angel. 2 replies.
Page 1 of 1 (3 items)
Sort Posts:
Previous Next
  • 8/22/2008 3:23 AM

    Urgent help required on win <> web convertion

    I created a new app using the eXpressApp framework. It created 2 modules, win and web...

    for the win i created a controller ( derived from the WinDetailViewController) which i linked to a specific detail view for a specific businessclass

    in that controller i hook on the Activated event, in which i do the following:

     

     

    View.ControlsCreated +=

    new EventHandler(View_ControlsCreated);

    to get the ControlsCreated event!

    In that event i do the following:

    ...

     

    TextEdit m_TxtEditPassword = null;

    foreach (StringPropertyEditor item in View.GetItems<StringPropertyEditor>()){

    if (item.Id == "Password"){

    m_TxtEditPassword = (

    TextEdit)item.Control;

    m_TxtEditPassword.EditValueChanged += new EventHandler(m_TxtEditPassword_EditValueChanged);

    }

    }

     

     ...

     > By doing this i can listen to the password textbox value changed event. Because i want to know when the user changed something in the textbox, so i can react on it...

    How can i do this for the web module?

    i know i can do something like:

    foreach(ASPxStringPropertyEditor item in View.GetItems<ASPxStringPropertyEditor>()){

     if (item.Id == "Password")

    {

    ??????????? what now: i know there is item.Control but that's a Table, which has 1 row which has cells...

    }

     

    but how can i reach the TextBox (i don't know what control is used by the framework)?

    Thanks

     

  • 8/22/2008 5:39 AM In reply to

    Re: Urgent help required on win <> web convertion

    Answer

    ASPxStringPropertyEditor has an Editor property that returns an ASPxTextEdit control to which you can attach your event handler. The Control property points to a table that contains the actual editor for layout purposes.

    You can also write a view controller in your base module that catches changes to properties and that will work in both the Web and Windows versions. You can hook into the View.CurrentObjectChanging and View.CurrentObjectChanged events of the View. In the CurrentObjectChanged handler you can then hook into the ((BaseObject)View.CurrentObject).Changed event, and you can unhook from this event in CurrentObjectChanging handler when the object is about to change to another one. The Changed event of the object is fired whenever any of the properties of the object change, and is therefore very useful for writing platform independent code.

    I would advise against using text boxes with ImmediatePostData enabled in the web application, which is the only way to get the value as soon as the user changes it in the browser. The postback will only occur when the focus leaves the text box, such as when you try to click on an action after editing the text in the box, and this causes the action not to be called as the ValueChanged event of the text box takes precedence. If you edit your password field, for example, and click on the Save action, the object will NOT be saved as the page is already busy posting back the ValueChanged event for the text box before your click event arrives at the Save action.

    This is a limitation of the ASP.Net platform, not DevExpress in particular, so DevExpress won't be fixing it.

     

  • 8/22/2008 7:35 AM In reply to

    Re: Urgent help required on win <> web convertion

     Thanks!

Page 1 of 1 (3 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED