Forum Stats

  • 3,757,774 Users
  • 2,251,265 Discussions
  • 7,869,914 Comments

Discussions

Page Getting hanged for a while

Praveen Krishna Rachaveti
Praveen Krishna Rachaveti Member Posts: 12 Green Ribbon

Hi JB,

There was an issue with oj-table. We are getting data from DB using REST API. the response payload is about 5-6mb and it contains about 2600 records. I don't know why the page is getting hanged for 1-2 sec after fetching the data. there few points i need to mention.

  1. OJET version is 9.2
  2. Windows OS
  3. I'm getting JSON data in string format. Once I get the response I'm just parsing using Worker method then I'm storing this array and data provider.
  4. Is there a way that we can use node modules inside the project?

Please advice any solution

Best Answer

  • John 'JB' Brock-Oracle
    John 'JB' Brock-Oracle Posts: 2,658 Employee
    Accepted Answer

    Try changing from the use of the progress-bar to use the built-in progressive loading of the table. That should free up the rest of the app while the table is waiting. It sounds like your own code is doing the blocking.

    In regards to modules, yes, you can load 3rd party libraries and use them just fine. You can't use Nodejs modules as they are written in commonJS and would not be recognized in the browser (JET only runs in the browser). If there is a module that runs in the browser that can render Excel or XML data, then that should work fine.

    This section of the Developers Guide discusses how to use 3rd party libraries.

    Add Third-Party Tools or Libraries to Your Oracle JET Application

Answers

  • John 'JB' Brock-Oracle
    John 'JB' Brock-Oracle Posts: 2,658 Employee
    edited Sep 2, 2021 5:02PM

    Hi Praveen,

    5-6mb is pretty big for a JSON payload. That is going to take a second or two no matter how good your bandwidth is, and definitely going to be an issue on a mobile device.

    When you say the table is hanging, what is it actually doing? Does it sit with a "no data" message, or does it show some of the rows and not other?

    If this is a matter of the table just having to wait for the data to be available, you could use progressive loading so that the end user sees the shadow rows indicating that something is happening, until the real data arrives.

    If this is an issue with the table itself taking seconds to render the data, after it has been delivered, then you will want to make sure that you are using some kind of loadMoreOnScroll policy so that it renders the first X number rows very quickly and then goes back to the local array to get more data as the user scrolls down the table. This loadMoreOnScroll scroll-policy should be the default behavior as long as you have a height set via CSS on the oj-table element.

    For that 4th item in your list, I don't have a clue what you are asking for. :-) Can you please provide more details?

  • Praveen Krishna Rachaveti
    Praveen Krishna Rachaveti Member Posts: 12 Green Ribbon

    Hi JB,

    Thanks for the response. I'm using the progress bar on the oj-bind-if condition. if it is true I'm displaying the progress bar else table. The thing is the application itself getting hung for 2 sec. Meanwhile, the end-user can't able to scroll or click on button at that particular moment.

    The Other one is about importing node modules. Like we do in other frameworks (ex: Angular). We will just install the module and import using require. In our project, we just want to read excel and XML data. and I see there is a way to read those using some node modules.

  • John 'JB' Brock-Oracle
    John 'JB' Brock-Oracle Posts: 2,658 Employee
    Accepted Answer

    Try changing from the use of the progress-bar to use the built-in progressive loading of the table. That should free up the rest of the app while the table is waiting. It sounds like your own code is doing the blocking.

    In regards to modules, yes, you can load 3rd party libraries and use them just fine. You can't use Nodejs modules as they are written in commonJS and would not be recognized in the browser (JET only runs in the browser). If there is a module that runs in the browser that can render Excel or XML data, then that should work fine.

    This section of the Developers Guide discusses how to use 3rd party libraries.

    Add Third-Party Tools or Libraries to Your Oracle JET Application

  • Praveen Krishna Rachaveti
    Praveen Krishna Rachaveti Member Posts: 12 Green Ribbon

    Thanks, JB. I appreciate your help