JET – Refer to ViewModel from HeaderTemplate in ojTable – and easier debugging of KnockOut code by Lucas Jellema


While developing a Oracle JET application against APIs on Oracle Service Bus interacting to JD Edwards and Oracle Transportation Management, we ran into a challenge. In the table (ojTable) that we had included in a page, we wanted to have column filters – fields in each column header where the user can enter a filter criteria for that column. The ojTable component supports the headerTemplate property (next to a rowTemplate and a footerTemplate). A headerTemplate is defined separately from the ojTable and can contain various components as well as script.

Our table and template were defined as follows:

It was our intent to have changes in the inputText in the column header – the filter field – immediately picked up and processed; in the ViewModel, code should be triggered by the change and should filter the data in the ArrayTableDataSource bound to the ojTable. The ViewModel has an observableArray on which the ArrayTableDataSource is based – by manipulating that observableArray we can get our table to refresh. The ViewModel also contains a KnockOut observable called country. It is this observable that we want to databind the inputText in the headerTemplate to. By subscribing our own function to this country observable we hope to be triggered when the user enters a value in the inputText and react in style.

The ViewModel: Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

Technorati Tags: WebLogic Community,Oracle,OPN,Jürgen Kress


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.