CreateFromURL function

Official Content
This documentation is valid for:

When using Dynamic Component Creation you can achieve a high degree of parameterization by using the CreateFromURL function to dynamically change the object to be displayed in a certain section of a layout.

To use it, all you have to do is insert a Component Control in any Object and assign the result of the execution of the CreateFromURL function to the control object property.

Syntax

Control.Object = CreateFromURL(URL)

Where:

URL
   It is a string variable (as VarChar data type) containing the object and parameters.

Web: Check the GeneXus Work With Pattern which uses this feature to create the TabbedView Web Component.

Sample for Web

In this example there is a Web Form containing a Web Component called Component, whose purpose is to load the links recently accessed by the user. They are dynamically loaded, meaning, for example, that they are loaded every time that the Web Panel object is Refreshed.

Event Refresh
    For &Index = &FirstTab To &LastTab
        Do 'LoadItem'
    EndFor
EndEvent

Sub 'LoadItem'
    &WebComponentUrl = &Tab.WebComponent
     Component.Object = CreateFromURL(&WebComponentUrl)
EndSub

The variable &WebComponentURL is Character(1000).

The &Tab variable is based on  the TabOptions SDT  whose structure is as follows:

TabOptions SDT

Sample for Smart Devices

Event Start
   &Url = MyPanel.Link(&parm1)
   Component1.Object = CreateFromURL(&Url)
EndEvent

Availability

CreateFromURL function is available also in Smart Devices as of GeneXus 15 upgrade 12.

See Also