Wisej.Web.WebRequestEventArgs
Namespace: Wisej.Web
Assembly: Wisej.Framework (2.2.0.0)
Provides data for the WebRequest event.
Initializes a new instance of the WebRequestEventArgs class with the specified error message.
Name | Type | Description |
---|---|---|
HttpRequest: Returns the current HttpRequest.
HttpResponse: Returns the current HttpResponse.
Name | Description |
---|---|
Represents the method that will handle the WebRequest event of a Widget control.
context
The current HttpContext.
Wisej.Web.Widget
Namespace: Wisej.Web
Assembly: Wisej.Framework (2.2.0.0)
Provides a generic widget that can use most third party javascript widgets.
See the InitScript property for a detailed description on how to initialize the imported widget.
Initializes a new instance of the Widget class.
BorderStyle: Indicates the border style for the control.
Boolean: Enables or disables the browser's context menu.
String: Returns or sets the initialization script.
The initialization script is called after the widget is created and before it is rendered by the browser. It is here that the code should initialize the third party widget, hook up any event, and save any reference it may need. The initialization function is named "init" and must be declared like this:
The update function is named "update", it is optional, and must be declared like this:
The "options" parameter is optional. It contains a javascript map with all the options defined in the Options property. Within the init function you can refer to the Wisej widget class using "this" and to the HTML element using "this.container". To fire an event back to the server, use "this.fireWidgetEvent() as show in the sample code below:
On the server side, you can handle the WidgetEvent and receive any data passed in the "fireWidgetEvent" call in the Data dynamic object.
Object: Returns a DynamicObject that can convert any method call into the equivalent JavaScript call targeting the third party "widget" object.
An application can invoke any method on the wrapped third party widget by using the Instance property. Dynamic method calls are automatically transformed to JavaScript client calls.
Boolean: Returns whether the JavaScript widget has been initialized.
Object: Returns or sets a dynamic object that is passed to the init(options) function upon initialization of the widget and to the update(options, old) when updating the widget.
List<Package>: List of packages required to run this widget.
Each package is a URL to either a JavaScript or a CSS file. The packages are loaded in the order they are listed. If a script depends on another script, it should be declared after the script it depends on, i.e.: Query usually if the first script in the package list. Wisej uses the name of the package to cache it and load it only once. It's important that you use consistent names when creating multiple widgets in order to load the shared packages only once.
String[]: Returns or sets the list of events that are fired by the widget wrapper.
Defines the list of events that the widget wrapper can fire. You have to add the code that handles the third party widget's events and fire a server event back to this widget wrapper. If your initialize code fires the event correctly and the event is registered in the WiredEvents list, the application code can attach a listener to the dynamic Instance object like any native event.
For the sample code above to receive the AreaClick event you have to handle the third party widget event and fire a Wisej event. The syntax for the handler registration depends on each wrapped third party widget: some may use native events, other may use jQuery, and others may use callback methods.
The list of the wired events that the server component expects to receive is available on the client side wrapper using the events array: this.getEvents().
EventHandler Fired when the widget is created on the client.
WebRequestHandler Fired when the widget used the "postbackUrl" to retrieve data from this control.
Wisej.Web.WebRequestHandler
Namespace: Wisej.Web
Assembly: Wisej.Framework (2.2.0.0)
Represents the method that will handle the WebRequest event of a Widget control.
Name | Type | Description |
---|---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Bindable components implement this interface.
All wisej components implement this interface.
All wisej controls derived from the Control class must implement this interface.
Represents a Wisej component that is capable of handling postback requests from the client.
Allows an object to serialize itself.
sender
The source of the event.
e
A WebRequestEventArgs that contains the event data.
Fired when the widget used the "postbackUrl" to retrieve data from this control.