DAX DevHook DDW Install
From Daxipedia
Contents |
[edit] Overview
Developer Defined Windows (DDW) give developers the ability to add a window with any html content they want on the front-end. The developer can have the window display an html blob or content from any valid URL. A DDW can display anything that can be displayed in a web browser.
A DDW can be created at the Portal level, selection level, or field level. A Portal level DDW is displayed in the left sidebar of the main window. A selection level DDW is displayed at the top of a window which displays a selection of records with the Create, Delete, etc. buttons. A button is also added to the detail view next to the Save and Cancel buttons. A field level DDW causes the field data to display as a link in a list of records and as a button next to the field value in the detail views.
[edit] Implementation
Adding a DDW view is done by calling DAX_Dev_DDW_Create and passing four (4) parameters.
- Object Type as Text. This is the type of object that will be displayed to users on the web page. Valid values are either "buttonDynamic", "buttonStatic", "linkDynamic" or "linkStatic".
- Object Title as Text. This is the title that will be displayed on the button or as the link.
- Method or URL as Text. This can be 1 of 2 things, the first use is the name of the method to execute when the user clicks on the button or link. In this case the method MUST return a blob that contains html content to be displayed. The second use is a valid URL that points to a resource to be loaded into the window (i.e. "http://www.4d.com" or "/4dcgi/MyWebMethod¶meter=value").
- Associated To as Text. This is the type of object that the DDW will be used with. Valid values are "Portal" or "Other". This parameter is optional and will default to "Other" if it is not provided.
[edit] Example
You can add as many DDW views as you like. Just make one call to DAX_Dev_DDW_Create for each DDW view you are adding.
Adding a Portal
$ddwID_l:=DAX_Dev_DDW_Create("LinkStatic";"4D Home Page";"http://www.4d.com/";"Portal")
Creating a DDW and assigning it to multiple fields
$ddwID_l:=DAX_Dev_DDW_Create("LinkDynamic";"Map It";"MyMapMethod";"Other")
DAX_Dev_DDW_AssignToObject($ddwID_l;"Field";Table name(->[Contact]);Field name(->[Contact]Address))
DAX_Dev_DDW_AssignToObject($ddwID_l;"Field";Table name(->[Company]);Field name(->[Company]Address))
Creating a DDW and assigning it to a Selection
$ddwID_l:=DAX_Dev_DDW_Create("LinkDynamic";"Help";"MyHelpMethod")
DAX_Dev_DDW_AssignToObject($ddwID_l;"Selection";Table name(->[Contact]))
In the above examples MyHelpMethod might load a local html help file into a blob and then return that blob. Or MyMapMethod might use the TCP commands to download map information from another site and then return the html in a blob.
