Hi,
You don't. :)
Not easily anyway.
This is because when you build the page, the message is defined in the button and send to the browser. At this point, nothing is selected.
When the user mark a checkbox, the message is not changed. Than, when you click the button/link, the popup does not have the actual counter.
The EASIER (not best, probably) way of doing what you wants to do is to define the message in the button including a variable that is the counter of the checked.
Initially, it will be zero.
Than, in the check box, set a OnChange action.
In the action:
1. check if the variable is True (increment the counter) or False (decrement the counter).
2. Ajax Refresh the button (the message will be updated).
It is also possible to do this with JavaScript, of course.
Cheers,
Eduardo Jauch