Search This Blog

Thursday, October 10, 2013

Update to the E2106 example about highlighting the focused editor in DetailView

Today I have refactored and also slightly changed the Web part of the E2106 example + updated the whole description to make it easier for XAF users to understand this solution and implement it in their projects.

The main change is about moving custom client side functionality from a ViewController into a separate JS file under the Web project. This JS file is now registered in the Default.aspx page as in the regular non-XAF ASP.NET application:

<head runat="server">
    <script type="text/javascript" src="E2106.js"></script>

This way it will be easier for you to write and debug these scripts (previously, you had to put the debugger; directive in the controller's code).

I want to pay your attention to this example, because it shows how to implement two very popular tasks in an XAF application:

1. Extend and customize the Application Model to add your own configurable UI options;
2. Implement custom Controllers that will look at your model options and adjust the UI for each platform accordingly;

Take special note that there is one base controller in the shared module and two descendants that implement platform-dependent layout customizations. This is also very common pattern in XAF you should be aware of. So, I hope you find this example helpful. Please let me know your thoughts in comments.

No comments:

Post a Comment