Prev | Current Page 263 | Next

Frank Zammetti

"Practical DWR 2 Projects"

If this
was in the .js file, the server would not interpret the scriptlet, and thus the functions it performs
would not work. It has to be in the JSP so that the container interprets it while rendering
the HTML from the JSP.
The calls to setValue(), setChecked(), and setDisabled(), functions we??™ll examine
shortly, are present to get around an issue I was seeing in Firefox. Even when reloading the
page, for some reason, Firefox would continue to maintain any entries in text boxes. To this
day I don??™t know why this was happening, although it didn??™t occur in IE. To get around the
problem I simply wrote code to clear out all the text boxes and check boxes and such when
the page loads. In some ways, this is better anyway, and more typical: most applications tend
to have an initialization routine at the start, so this is adhering to that pattern.
The current view is set to the Intro view after the fields have been cleared. Lastly, the
scriptlet section is encountered. The purpose of this section is simply to see if the app has
been configured yet??”that is, if an e-mail account has been set up. If it hasn??™t been configured
yet, then all the buttons are hidden and the divGettingStarted
is shown, which is just
some verbiage telling you that you need to set up an account, and a link to the Options view,
since the user should only be able to configure options in this state.


Pages:
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275