1 13 package com.tonbeller.wcf.convert; 14 15 import java.util.Map ; 16 17 import org.w3c.dom.Element ; 18 19 import com.tonbeller.wcf.ui.RadioButton; 20 21 26 public class RadioButtonConverter extends BooleanConverter { 27 28 31 public int isSelected(Element elem, Map params) { 32 33 if (RadioButton.isDisabled(elem)) 35 return UNKNOWN; 36 37 String id = RadioButton.getId(elem); 39 Object inputAvailable = params.get(id + ".valid"); 40 if (inputAvailable == null) 41 return UNKNOWN; 42 43 String groupId = RadioButton.getGroupId(elem); 44 String [] values = (String [])params.get(groupId); 45 if (values == null) 46 return FALSE; 47 for (int i = 0; i < values.length; i++) 49 if (values[i].equals(id)) 50 return TRUE; 51 return FALSE; 52 53 } 54 55 } 56 | Popular Tags |