1
votes

I have a quick question concerning GAS efficiency and best practices. I have a script that is embedded into a site. In an effort to try and make it quicker I changed from using a doGet() with a serverclickhandler attached to a submit button and another submit() function to using doGet() with submit and doPost. The initial version used a vertical panel, while the second version requires a form panel. My vertical panel has a grid setup on it, and I would like to keep as much existing code as possible. My question is:

Can I put a grid directly into a formPanel without it slowing down the loading process? I tried it and it seemed slower, but maybe Google's server was having a bad day.

Can I add the verticalPanel to the formPanel without slowing things down? What would be the best practice in this situation?

The reason I want to switch to doPost is that it shows another panel when you click the submit button, so the user knows that there submission went through. Previously I was clearing the GUI elements, which seems like a lot of extra code that could slow things down.

Thanks in advance!

2

2 Answers

0
votes

concerning the last point of your post, you don't have to clear everything, you can mask the whole panel with another empty (or not) one on top of it... quick and efficient ;-)

Depending on the way you created your Ui different approaches are possible : one of the easiest it to setVisible(false) the parent panel that holds all the widgets while you setVisible(true) a big label saying 'thanks for you answer... bla bla bla' (this one can be there from the beginning but invisible ;-) and set to visible by a handler on the 'submit' button (client or server... both are able to do the job))

0
votes

Having panels inside other panels shouldn't slow down the loading of the UI.