Forum  General Visual ...  How do I...?  ASPPAGEBOX Raising Events
Previous Previous
 
Next Next
New Post 9/12/2008 11:11 AM
  rschnell
433 posts
2nd Level Poster


ASPPAGEBOX Raising Events 
Hi,

I know this question has been asked a few times before, but I have lost track of the status.

I have an ASPPAGEBOX in a VWG form. Within the aspx I want to raise and event that will ultimately popup (show) a VWG form on top the page box. I though the way to do this was:

1. Inherit the AspPageeBase is the aspx code.
2. Set a TextChange event handler on the ASPPAGEBOX
3. Change the text in the ASPX code via PageContext.Text

I supposed the event would fire and I could pick it up in VWG and eg show a new form , or indeed do anything else.

The problem is the TextChange event does not fire. (6.03, Framework 2). I really thought I had tried this and had it working in 5.8

Anyway how can I do it it now?

Regards

Richard
 
New Post 9/14/2008 7:19 AM
  ori.cohen
4401 posts
1st Level Poster




Re: ASPPAGEBOX Raising Events 
Hello Richard!

Are you using VWG v5.8x.x?
I must urge you to upgrade to a newer version. You will see many bugs fixed and many implementations completed. The official stable version now is VWG v6.0.4 but as VWG v6.1.4 is newer, much improved and nearing official stable status we recommend that you use it.

About the AspPageBox, please view this video here. It shows how to use events on an AspPageBox very clearly. If you have questions after watching this video, please reply to this post.

Regards,

Ori Cohen
The Visual WebGui team
 
New Post 9/16/2008 5:33 PM
  rschnell
433 posts
2nd Level Poster


Re: ASPPAGEBOX Raising Events 

Hi,

I am using 6.1.4, it was working (I think it was when I used 6.0 ). So presumably I knew how to do it then. I will re-check the video to make sure I haven't forgotten something.

Richard
 
New Post 9/16/2008 5:41 PM
  rschnell
433 posts
2nd Level Poster


Re: ASPPAGEBOX Raising Events 
Hi,

Sorry I perhaps confused you with mention 6.0.3 ... I am in fact using the latest.

Now as I remember this video has nothing to do with the question I asked. The question is how to raise events from the aspx which the main webgui form can respond to. I found a forum entry explaining the use of the text change event on the aspxbox in the aspx. This at the time seemed to be a secret trick, but it did work.

I think it doesn't now.

Please answer my question.

Regards

Richard
 
New Post 9/17/2008 3:35 AM
  Eyal.Albert
393 posts
3rd Level Poster




Re: ASPPAGEBOX Raising Events 

Hi Richard,

Before writing the code to do this you should know that yoou wont be able to update the VWG client side with the value that you get form aspx page because there is no VWG event that was raised from the client. But this functionality wll be added in the futer.

Ok this is the code you need in the aspx page

 

 

 

{

 

VWG.Events.SetEventAttribute(objEvent,

VWG.Events.RaiseEvents();

}

 

<script>function SendText(strMessage)var objEvent = VWG.Events.CreateEvent("<%= PageContext.Guid %>","TextBoxText");"message",strMessage);</script>

And on the button click

 

<button onclick="SendText(document.getElementById('TextBox1').value)">Raise event to VWG</button>

This will raise an event in the Aspx pag4e.

Next we will create our own AspxBox like this

 public class MyAspPageBox : AspPageBox

        {

 

            protected override void FireEvent(Gizmox.WebGUI.Common.Interfaces.IEvent objEvent)

            {

                base.FireEvent(objEvent);

 

                if (objEvent.Type == "TextBoxText")

                {

                    string value = objEvent["message"];

                }

            }

        }       

This will get the value to the VWG application and you can use it but if you want to update the value to see  it the UI you will have to wait to an event from the user in the VWG part.

Hope this helps.

Eyal Albert

 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  ASPPAGEBOX Raising Events
.NET HTML5 Web, Cloud and Mobile application delivery | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2012 Visual WebGui®       Visual WebGui weblog on ASP.NET Gizmox Blog Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS