LostFocused

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

This post has 9 Replies | 0 Followers

Not Ranked
Male
Posts 32
255 Points
Joined: Apr 26, 2005
Last Online:
Dec 18, 2007 20:59
Location: usa. los angeles
massoud Posted: Jul 13, 2006 17:29
How helpful was this post/question? Please rate here:
Dear friend,
do we have an event to Notify us the form is LostFocused? What is that?
Thanks advance.
MASSOUD
mkd
Not Ranked
Male
Posts 23
304 Points
Joined: Jun 4, 2006
Last Online:
Mar 18, 2008 19:02
Location: Iasi, Romania
Ciprian Dudau replied on Jul 18, 2006 8:00
How helpful was this comment/solution? Please rate here:

Hi Massoud,

I don't know the exact answer, but I realize that this has to do with the windows changing inside Axapta (e.g. the focus is lost by a form (window) only when the user focuses on another window (form). I have seen an application that handles windows inside Axapta. Maybe you can find your answer by looking over its code http://www.belugin.info/sidax/

Kind regards, Ciprian Dudau Dynamics Developer
Not Ranked
Male
Posts 32
255 Points
Joined: Apr 26, 2005
Last Online:
Dec 18, 2007 20:59
Location: usa. los angeles
massoud replied on Jul 18, 2006 9:55
How helpful was this comment/solution? Please rate here:

thanks friend,

unfortunatly it doesn't help me. Another idea?

massoud

 

mkd
Not Ranked
Male
Posts 32
255 Points
Joined: Apr 26, 2005
Last Online:
Dec 18, 2007 20:59
Location: usa. los angeles
massoud replied on Jul 18, 2006 10:04
How helpful was this comment/solution? Please rate here:

Frriends,

If you want disable Docu you should write this line in form.init() method:

    infolog.docuHandlingActive(false);
and of course in form.close() method you should write these lines:

    infolog.docuHandlingActive(true);
    infolog.formNoteButton(true,true);

and when you want enable it during form is running, for example in a mousedown() method:

public int mouseDown(int x, int y, int button, boolean ctrl, boolean shift)
{
    int         ret;
    Args        args = new Args();
    FormRun     notes;

    ret = super(x, y, button, ctrl, shift);

    if ( condition ...)
    {
        infolog.docuHandlingActive(true);
        args.name(formstr(DocuView));
        args.caller(this).name(formstr(YourForm));
        args.record(Your Record));
        notes = classFactory.formRunClass(args);
        notes.init();
        notes.run();
        notes.wait();
        element.redraw();   //redraw the grid if the user deletes the note
        infolog.formNoteButton(false, false);
        infolog.docuHandlingActive(false);
    }

    return ret;
}

It works great, but if user run another form when that form is running, we don't have Docu icon. that's why I am looking for a Form.lostFocused() method to solve this problem, but I can not find any LostFocused method.

Any idea?


 

mkd
Not Ranked
Male
Posts 23
304 Points
Joined: Jun 4, 2006
Last Online:
Mar 18, 2008 19:02
Location: Iasi, Romania
Ciprian Dudau replied on Jul 18, 2006 11:13
How helpful was this comment/solution? Please rate here:

Why you say not helping? Can you provide some more details to describe your situation?

I have checked and the application I suggested and it seems the best answer to your lostfocus problem. There is no LostFocus method for forms in Axapta, per my knowledge.

Kind regards, Ciprian Dudau Dynamics Developer
Top 25 Contributor
Male
Posts 749
8,199 Points
Joined: Jan 21, 2003
Last Online:
Mar 19, 2010 11:43
Location: Herts, England
DynamicsAXMVP
Moderator
Harish Mohanbabu replied on Jul 19, 2006 8:35
How helpful was this comment/solution? Please rate here:

Hi Massoud,

I am getting lost when you say lost focus. Say if you are trying to close a form by pressing Esc key then you can catch it with task method. But I guess this is not what you are looking for.

Perhaps if you can tell us exactly what you are trying to achieve,  we might be able to help you.

Regards,

Harish Mohanbabu
Long way to go before I sleep ..

View Harish Mohanbabu's profile on LinkedIn

Top 25 Contributor
Male
Posts 749
8,199 Points
Joined: Jan 21, 2003
Last Online:
Mar 19, 2010 11:43
Location: Herts, England
DynamicsAXMVP
Moderator
Harish Mohanbabu replied on Jul 19, 2006 8:51
How helpful was this comment/solution? Please rate here:

Hi Massoud, As you probably noticed I merged your thread titled "Document handling" and "LostFocused" since these threads were related to each other.

If you want to disable document handling for a particular form/table perhaps you might want to look at "Activate document tables form" available under Basic -> Setup -> Document management. This way Axapta will switch off and on document handling based on the tables that you select.

If you decide to go down this route, make sure you select "Use active document tables" field under Parameters.

In case if you want to stick with your modification route, please check here to find out how by default this is handled in Axapta.

Hope this helps,

Harish Mohanbabu
Long way to go before I sleep ..

View Harish Mohanbabu's profile on LinkedIn

Not Ranked
Male
Posts 32
255 Points
Joined: Apr 26, 2005
Last Online:
Dec 18, 2007 20:59
Location: usa. los angeles
massoud replied on Jul 19, 2006 11:45
How helpful was this comment/solution? Please rate here:

dear Harish,

Thanks for your reply,

As I have been asked, user shouldn't have Docu Icon in some forms, not tables. so I Disabled/Enabled Docu in different sitution. Problem raised when that form is running and user runs another form(eg Goto Main Table), in that case Docu ICON is disabled for entire axapta. That's why I should find a mechanism same as From.LostFocused event, to enable Docu.

 

Thanks a lot 

mkd
Not Ranked
Male
Posts 32
255 Points
Joined: Apr 26, 2005
Last Online:
Dec 18, 2007 20:59
Location: usa. los angeles
massoud replied on Jul 19, 2006 11:59
How helpful was this comment/solution? Please rate here:

Dear Ciprian ,

Thanks for your reply. I checked that form(Sidax form), it's a great idea, but problem is I couldn't find a mechanism that shows "When current form is beeing lost focused?". If there is let me know. form example in Sidax form, Visibility of a previous form is checked in Current form. my problem is different. maybe there is an answer I couldn't find it. can you show me where is the idea in Sidax form.

Thanks

MASSOUD

mkd
Not Ranked
Male
Posts 8
105 Points
Joined: Jul 30, 2006
Last Online:
Nov 22, 2006 0:04
Location: Moscow
AxCoder replied on Jul 30, 2006 5:26
How helpful was this comment/solution? Please rate here:
\Classes\Info\formNotify:

void formNotify(FormRun formRun,FormNotify event)
{
switch (event)
{
case FormNotify::Activate:
this.activate(formRun);
if (docu)
docu.reSearch(formRun);
break;
case FormNotify::DeActivate:
break;
Page 1 of 1 (10 items) | Get this RSS feed | Bookmark and Share