Posts

Showing posts from March, 2020

Oracle JET: Detail Row with Tree Table; Expanding rows on page load

Image
We already have a best example given in the Oracle JET cookbook. This post is providing a small yet useful extension to this existing example. Courtesy:   OJET Cookbook example: Detail Row with Tree Table We see the rows are not expanded on the page load, as shown below. Some or most of the times, we have a requirement to expand the first row by default. To do this, we take help of the class  FlattenedTreeDataProviderView  The constructor of this class has a second parameter. This parameter is a JSON object, and it has predefined property called " expanded   ", as shown below. Reference:  oj.FlattenedTreeDataProvider Before we provide the value, we need to make a small change at the line, where the ADP is getting created. The  keyAttributes   should be changed  from   { keyAttributes: 'id' }  to   { keyAttributes: 'attr.id' }. This is because, the JSON structure itself tells that, each paren...

Oracle JET: Programmatic control over the Page's Busy State

Image
Please wait. Yes, don't got anywhere. The above message proves, always, to make the user wait and  do no action on the keyboard or mouse. And yes, the user waits, although for some time. In our web application, the logic should be capable to show this message, conditionally. Once the condition has evaluated false, the actual content should get loaded. To achieve this we should always rely on the framework delivered functionality, and not to code by ourselves. All frameworks have it, and let us see how its done in Oracle JET View: In the HTML lets add the below small piece, as a direct  child to body, above the actual content < div id = 'busyDiv' class = "oj-flex oj-sm-align-items-center oj-sm-justify-content-center" style = " height:100vh;" > < div class = "oj-flex-item" style = " text-align:center;font-weight:bold;font-size:3em;" > Please wait < p style = " font-size:0.5em;" > Loading....