Now we will expand using a very powerful feature called page properties. Page properties allow for easy communication between Delphi, Client IWML, and client script.
From the user perspective, nothing has changed. Our application functions the same. Instead of using server code to update the Guess count, we now are using data binding.
The binding isn't one way – it's two way. If we update the properties in Delphi, they are updated in the client. If we update them in the client, they are updated in Delphi.
Page properties are always accessible via the .Properties property of the page. However we can make them even easier to access by adding matching properties into our client event.
We can modify the property in the client, or on the server and IntraWeb takes care of the rest.
You can even add an additional Guess property, bind the Edit control to it, and then in our Delphi code simply get and set .Guess, instead of needing using the Edit.Text property.
Using these techniques you can easily and completely isolate your UI from your code.