Client programming with Dojo

IBM® WebSphere® sMash includes the Dojo Toolkit for developing AJAX-based clients. Although AJAX and Dojo are not required for WebSphere sMash applications, the combination can result in compelling Web applications.

Adding Dojo to your application

You can add Dojo to your WebSphere sMash application as a dependency. Start by adding the following line to the dependencies element in your config/ivy.xml file:

 

Dojo References

The best sources of information for Dojo can be found at the following locations:

  • Dojo documentation
  • Dojo support forums
  • Debugging

Using Dojo Data to integrate with Resource Handlers

Another common design pattern is an AJAX-based client as the user in terface for RESTful services interacting with XHR. This pattern is in directly demonstrated in the Employee Demo sample. The sample uses the Dojo DataGrid and the Dojo Data store (zero.resource.RestStore) provided by WebSphere sMash to retrieve and access resources in the application.Highlights of the sample, showing snippets from public/index.gt are shown in the following example for including dojo:

< pre>









< br />

Create new employee entry

Clicking the Add New Employee button displays a form for creating a new employee record.



"/resources/locations">






Update employee

Click the Edit Selected Employee button to display an edit form with the selected employee record.

 





Delete employee entry

Click the Delete Selected Employee button to display a form for creating a new employee record.




IBM® WebSphere® sMash includes the Dojo Toolkit for developing AJAX-bas ed clients. Although AJAX and Dojo are not required for WebSphere sMash applications, the combination can result in compelling Web applications.

 















"/resources/locations">











 


< /p>

Leave a Comment

Your email address will not be published.