Kaggle does not support saving Widget state to the static HTML notebook. This is why the code lines are commented out in the Kaggle notebook.
Happy to answer any questions.