Custom Controls > Using the Wijmo Control Extensions |
If you have developed applications for the LightSwitch Desktop Client (Silverlight), you are probably familiar with the concept of third-party control extensions that integrate directly into the screen designer. For example, LightSwitch Desktop Edition includes several Silverlight-based controls that you can use in place of the built-in DataGrid.
Unlike its desktop counterpart, the LightSwitch HTML Client does not fully support extensibility at the control level. What this means is that third-party vendors cannot provide multiple controls that you can simply select in the designer, as in the preceding example. Fortunately, ComponentOne has developed its own extensibility model that is compatible with the custom control types implemented in the HTML Client runtime. Depending upon the kind of content item you are modifying, you will be able to choose one of four control extensions, as shown in the following table.
Control Extension | Content Item Kind |
Wijmo Value Control | Value |
Wijmo Collection Control | Collection |
Wijmo Custom Control | Screen Content |
Wijmo Details Control | Group |
After you have changed the type of a content item to the appropriate Wijmo control extension, you need to set its Widget property to one of the available values, which are different for each extension. Then, you need to click the Edit Render Code link to generate JavaScript code for the selected widget.
Once you have generated code for a Wijmo control extension, changing its Widget property has no effect, and clicking Edit Render Code will not regenerate the render method for the new widget. If you applied the wrong widget and need to change it, you should first switch to code view and delete the render method that was generated previously. Then you can return to the designer and generate code for the correct widget. |
Due to the limitations of extensibility within the HTML Client, there are no design-time properties for configuring specific controls such as a calendar or pie chart. All customizations must be performed within the generated code.
Another limitation of the HTML Client is that if you rename a Wijmo control extension in the Properties window, the generated render method will not be renamed accordingly, and you will get errors at runtime. To work around this limitation, you should temporarily change the type of the content item to Custom Control, then rename it, and then change the type back to a Wijmo control.
The following sections describe each of the four control extensions in greater detail.