Forum  Commercial Foru...  Commercial Foru...  Reference foremost form
Previous Previous
 
Next Next
New Post 8/24/2009 10:39 AM
  lufe
127 posts
www.keyword.com.br
5th Level Poster


Reference foremost form 

Hi,

Im working on an application using "inline windows" that generates several instances of the same form. I want to print the contents of a grid in the foremost form when the user clicks a button on the main form. Is it possible to get a reference to the foremost form so I can know which grid to print?

 

Thanks

 
New Post 8/24/2009 10:58 AM
  rdhatch
635 posts
1st Level Poster




Re: Reference foremost form 
Modified By rdhatch  on 8/24/2009 12:59:26 PM)

Hi Lufe -

Although I have not tested to confirm, VWGContext.Current.ActiveForm will probably return the MainForm, since you are clicking a button in the MainForm.

What you could do is create a Public LastActiveForm Property in your MainForm.  And anytime the user clicks / focuses on an inline Form - you update the LastFormUsed with VWGContext.Current.ActiveForm.  That way, your LastActiveForm always represents the Form the user last came from.

Hope this helps!

Ryan


Ryan D. Hatch, VWG MVP
GeniusCode.net | VWG Community Frameworks | VWG Wiki
 
New Post 8/24/2009 11:10 AM
  lufe
127 posts
www.keyword.com.br
5th Level Poster


Re: Reference foremost form 

 Ryan,

Thanks for your reply.

My first tought was doing what you said, but It seems that when the user alternates among the forms no server event is triggered, sou I couldnt find an event to set the LastActiveForm. Tried click,enter,activated and gotfocus without success...

DO you know if there is another event I could use?

Thanks.

 
New Post 8/24/2009 11:45 AM
  rdhatch
635 posts
1st Level Poster




Re: Reference foremost form 
Modified By rdhatch  on 8/24/2009 1:46:39 PM)

Hi Lufe -

I have not researched this.  Perhaps Palli knows of one?

If there really isn't an event being fired - Gizmox would probably be willing to add one.

Ryan


Ryan D. Hatch, VWG MVP
GeniusCode.net | VWG Community Frameworks | VWG Wiki
 
New Post 8/25/2009 7:29 AM
  ori.cohen
4383 posts
1st Level Poster




Re: Reference foremost form 

Hello,

What I can think of that would be relevant in this case is to create a custom Form of your own that would derive from the Gizmox.WebGui.Forms.Form.
This new Form would send a notice to the server-side, when the Form gets focus in client-side. At server-side this would change the ActiveForm to the newly focused Form.

BTW, I think the implementation of the ActiveForm should be a linked-list structure and not a single reference to a Form. The reason for that is that if the top Form is closed, you need the Form that was active before it to be printed (if it is still alive), etc.
I also think you should save this linked-list structure on the Context objext and not on the MainForm. It is generally a more logical place to hold it and it will give you more felxibility.

Please reply if you need any help with these implementations or need any additional information on this subject.

Regards,

Ori Cohen
Support Manager, the Visual WebGui team

 
Previous Previous
 
Next Next
  Forum  Commercial Foru...  Commercial Foru...  Reference foremost form
Azure banner
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS