Forum  General Visual ...  Let's Chat Abou...  HTMLBox and WGX Application interoperability
Previous Previous
 
Next Next
New Post 12/16/2008 11:14 AM
Resolved
  giten
31 posts
No Ranking


HTMLBox and WGX Application interoperability 
Modified By giten  on 12/17/2008 6:36:39 AM)

Hi, I'm using HTMLBox with a html that writes some data in hidden fields. I need from the WGX application to get those values. How can i achieve this?

Thank you very much.

Giten

 
New Post 12/17/2008 11:40 PM
  ori.cohen
4401 posts
1st Level Poster




Re: HTMLBox and WGX Application interoperability 
Modified By ori.cohen  on 12/18/2008 1:39:28 PM)

Hello Giten!

Welcome to Visual WebGui!

You have to use the AspPageBox with ASP.NET instead of the HtmlBox with HTML.

Please follow these steps:

1. Have your ASP.NET application's Page derive not from System.Web.UI.Page, but from Gizmox.WebGUI.Forms.Hosts.AspPageBase . This type is a derivative of the ASP.NET Page class and is required for the purpose of allowing step 2.

2. On Page Load event create a JavaScript variable called "mintMyVwgGuid" and set it's value to the value of the Page's PageContext.Guid property.

3. Create a new JavaScript function on the Page called RaiseVwgReadHtmlInputEvent. In this function add this code:
    var strHiddenInputValue = code to read value...
    var objEvent = Events_CreateEvent(mintMyVwgGuid, "VwgReadHtmlInput", null, true);
    Events_SetEventAttribute(objEvent, strHiddenInputValue, mintMyVwgGuid);
    Events_RaiseEvents();


    You may need to call the obove functions using window.top.functionname

4. On your VWG Form override the FireEvent and add this code to it:
    // Select event type
    switch (objEvent.Type)
    {
        case "VwgReadHtmlInput":
            OnVwgReadHtmlInput();
            break;
    }
    base.FireEvent(objEvent);


5. Implement the OnVwgReadHtmlInput method to handle receiving the value of the specific hidden input.

Regards,

Ori Cohen
The Visual WebGui team
---------------------------
Upcoming community chat on Dec 22.
More info

 
New Post 12/18/2008 5:01 AM
  giten
31 posts
No Ranking


Re: HTMLBox and WGX Application interoperability 

Ori, thanks a lot for your excellent explanation. Can you tell me more about the step 2 since I cannot find the PageContext.Guid property.

Thanks again.

Giten.

 
New Post 12/18/2008 6:59 AM
  giten
31 posts
No Ranking


Re: HTMLBox and WGX Application interoperability 
Modified By giten  on 12/18/2008 11:00:41 AM)

Ori, I finally found the PageContext.Guid property by inheriting my page from Gizmox.WebGUI.Forms.Hosts.AspPageBase (not from Gizmox.WebGUI.Forms.Hosts.AspPipeLinePage). Now then problem is than my script fails when trying to create the event here:

var objEvent = Events_CreateEvent(mintGuid, "VwgReadHtmlInput", null, true);

It seems the the Events_CreateEvent function cannot be found.

What am I doing wrong? Thank you very much.

Giten.
 

 
New Post 12/24/2008 2:49 AM
  ori.cohen
4401 posts
1st Level Poster




Re: HTMLBox and WGX Application interoperability 

Hello Giten!

The problem is that the javascript scope if the HtmlBox is limited to itself, because it resides inside an HTML IFrame element.
You need to go up the DOM to the window object in which the HtmlBox resides.
You can do that simply by doing the following:
window.top.Events_CreateEvent(mintGuid, "VwgReadHtmlInput", null, true);

Regards,

Ori Cohen
Manager of support, the Visual WebGui team

 
Previous Previous
 
Next Next
  Forum  General Visual ...  Let's Chat Abou...  HTMLBox and WGX Application interoperability
.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