I am struggling with a very small detail here that should be very easy to fixe but still couldn't fix it properly.
I have a button 'button1". When I click it, I would like table1 to be calculated and shown on the screen and then I would like to calculate table2 and show it on the screen.
As far as my understanding goes, Shiny will only update the UI when the server is done with all calculations after an event is triggered, regardless of the order of the code. In your case, the fact you update table1 before table2 calculations start will not make it appear as you order it in the same event.
A simple fix is to make table 2 have a separate button, so you can calculate 1, then click two.
Is there anyway to render the second table only once the first has been rendered without adding any button?
The second table makes sense only once the first has been obtained...
I'm afraid that (to my knowledge) that is not possible.
You must look at it from Shiny's general perspective (this is not a very technical explanation beware ): If several things need to be updated in one user action, the output should all appear at once to avoid conflicting results. In your case that wouldn't be an issue if table 1 appeared before 2, but imagine the code for creating table 2 would alter parameters that influenced table 1, then table one would have incorrect output if rendered before table 2 was finished and needed to be updated again once 2 finished.
In short, I think you have to choose: 1 click and wait, or two clicks and have table 1 first. It doesn't need to be a button, you can also create tabs or something, as long as table two is triggered by something else than table 1.
Again, there might be Shiny experts on here who would know a workaround, so this is just what I got from my experience with it...
Thanks, well then I suppose I can create a condition button2 based on the button1 being clicked At least the button2 would appear only when table1 is rendered...
Just thinking out loud but thank you very much PJ for the shared reflexion!
Have a nice day,