The code presented here combines JavaScript with the use of
web services. I think it deserves more clarification.
Listing 1 is really simple for anyone who has used html. It
is simply creating a group of checks using the same name properties with
different ID's. The trick here is the onclick event attached to the check box.
Once a checkbox is clicked, the JavaScript function UpdatePizza gets called
with a number of checkboxes to check.
Listing 2 shows the real JavaScript that reads all check
boxes and formulates them into one string by concatenating the values of the
checkboxes. However, there is an additional line to find the dynamic populate
extender and call its populate method (dp1). You note that listing 3 specified
that the behaviorid is dp1 (voila, the link).
Listing 3 brings about the whole picture. The
targetcontrolid specified the panel that is going to be filled when the job is
finished. Behaviorid is already explained. The option is the service method
that is used to handle the dynamic call. GetPizza is the one called when the
populate event is called from the JavaScript.
GetPizza webservice simply creates an HTML format filling
for the panel using a sentence and a value passed from the java function.