Dear hsin,
i can't reproduce the problem as described, but i see two issues in the given example: (a) there is a missing double quote after "uid" in the "select" opening tag. (b) in order to group data, one should use the "group" tag of OpenACS for best results. See the following example:
hsin.tcl:
set user_id 123
template::multirow create user user_name user_id group_name
template::multirow append user "Joe Dalton" 122 villain
template::multirow append user "William Dalton" 123 villain
template::multirow append user "Jack Dalton" 124 villain
template::multirow append user "Averell Dalton" 125 villain
template::multirow append user "Luky Luke" 126 cowboy
hsin.adp:
<master>
<form>
<select id="uid" size="8" name="uid">
<multiple name="user">
<optgroup label="@user.group_name@">
<group column="group_name">
<option <if @user_id@ eq @user.user_id@>selected</if> value="@user.user_id@">@user.user_name@</option>
</group>
</optgroup>
</multiple>
</select>
</form>
result:
This is tested with the current version in the oacs-5-9 branch.
Hope this helps, all the best
-gn