runTimeField.setContent(String.valueOf(run.getRunTime())); chipTimeField.setContent(String.valueOf(run.getChipTime()));
	public void initializeFields() {		IWContext iwc = IWContext.getInstance();		IWResourceBundle iwrb = getResourceBundle(iwc);		RunBusiness runBiz = getRunBiz(iwc);		String userID = iwc.getParameter("ic_user_id");		String selectedGroupID = iwc.getParameter("selected_ic_group_id");		String runGroupID = iwc.getParameter(IWMarathonConstants.GROUP_TYPE_RUN);		User user = null;		if(userID != null) {			try {				user = getUserBiz().getUser(Integer.parseInt(userID));				if(user != null) {					userNameField = new Text(user.getName());				}			}			catch (NumberFormatException e1) {				e1.printStackTrace();			}			catch (RemoteException e1) {				e1.printStackTrace();			}		}				if(runGroupID != null && !runGroupID.equals("")) {			Group runGroup = null;			try {				runGroup = getGroupBiz().getGroupByGroupID(Integer.parseInt(runGroupID));			}			catch (IBOLookupException e) {				e.printStackTrace();			}			catch (NumberFormatException e) {				e.printStackTrace();			}			catch (RemoteException e) {				e.printStackTrace();			}			catch (FinderException e) {				e.printStackTrace();			}			runField = new Text(iwrb.getLocalizedString(runGroup.getName(),runGroup.getName()));		}		Run run = null;		if(userID != null && selectedGroupID != null) {			run = getRunBiz(iwc).getRunObjByUserAndGroup(Integer.parseInt(userID),Integer.parseInt(selectedGroupID));		try {			Group dis = getRunBiz(iwc).getDistanceByUserID(Integer.parseInt(userID));			f.addParameter(IWMarathonConstants.GROUP_TYPE_RUN_DISTANCE,dis.getPrimaryKey().toString());			if(userID != null && runGroupID != null) {				run = getRunBiz(iwc).getRunObjByUserIDandDistanceID(Integer.parseInt(userID),Integer.parseInt(dis.getPrimaryKey().toString()));			}		}		catch (Exception re) {			log(re);		}		}						participantNumberField = new TextInput(IWMarathonConstants.PARAMETER_PARTICIPANT_NUMBER);		chipNumberField = new TextInput(IWMarathonConstants.PARAMETER_CHIP_NUMBER);		tShirtField = new DropdownMenu(IWMarathonConstants.PARAMETER_TSHIRT);		SelectOption empty = new SelectOption(iwrb.getLocalizedString("run_reg.select_tee_shirt_size", "Select tee-shirt size"), "-1");		SelectOption selectAdult = new SelectOption(iwrb.getLocalizedString("run_reg.adult_sized", "Adult sizes"), "-1");		small = new SelectOption("- " + iwrb.getLocalizedString("run_reg.small", "Small"), IWMarathonConstants.PARAMETER_TSHIRT_S);		medium = new SelectOption("- " + iwrb.getLocalizedString("run_reg.medium", "Medium"), IWMarathonConstants.PARAMETER_TSHIRT_M);		large = new SelectOption("- " + iwrb.getLocalizedString("run_reg.large", "Large"), IWMarathonConstants.PARAMETER_TSHIRT_L);		xlarge = new SelectOption("- " + iwrb.getLocalizedString("run_reg.xlarge", "Larger"), IWMarathonConstants.PARAMETER_TSHIRT_XL);		xxlarge = new SelectOption("- " + iwrb.getLocalizedString("run_reg.xxlarge", "Largest"), IWMarathonConstants.PARAMETER_TSHIRT_XXL);		tShirtField.addOption(empty);		tShirtField.addOption(selectAdult);		tShirtField.addOption(small);		tShirtField.addOption(medium);		tShirtField.addOption(large);		tShirtField.addOption(xlarge);		tShirtField.addOption(xxlarge);		selectKids = new SelectOption(iwrb.getLocalizedString("run_reg.kids_sized", "Kids sizes"), "-1");		smallKids = new SelectOption("- " + iwrb.getLocalizedString("run_reg.small_kids", "Small"), IWMarathonConstants.PARAMETER_TSHIRT_S + "_kids");		mediumKids = new SelectOption("- " + iwrb.getLocalizedString("run_reg.medium_kids", "Medium"), IWMarathonConstants.PARAMETER_TSHIRT_M + "_kids");		largeKids = new SelectOption("- " + iwrb.getLocalizedString("run_reg.large_kids", "Large"), IWMarathonConstants.PARAMETER_TSHIRT_L + "_kids");		xlargeKids = new SelectOption("- " + iwrb.getLocalizedString("run_reg.xlarge_kids", "Larger"), IWMarathonConstants.PARAMETER_TSHIRT_XL + "_kids");		tShirtField.addOption(selectKids);		tShirtField.addOption(smallKids);		tShirtField.addOption(mediumKids);		tShirtField.addOption(largeKids);		tShirtField.addOption(xlargeKids);				payMethodField = new DropdownMenu(IWMarathonConstants.PARAMETER_PAY_METHOD);		notPayed = new SelectOption(iwrb.getLocalizedString("run_tab.not_payed", "Not payed"), "not_payed");		credit = new SelectOption(iwrb.getLocalizedString("run_tab.credit", "Credit"), "credit");		debet = new SelectOption(iwrb.getLocalizedString("run_tab.debet", "Debet"), "debet");		cash = new SelectOption(iwrb.getLocalizedString("run_tab.cash", "Cash"), "cash");				payMethodField.addOption(notPayed);		payMethodField.addOption(credit);		payMethodField.addOption(debet);		payMethodField.addOption(cash);				payedAmountField = new TextInput(IWMarathonConstants.PARAMETER_AMOUNT);				teamNameField = new TextInput(IWMarathonConstants.PARAMETER_GROUP_NAME);		if(run != null) {			int disID = run.getRunDistanceGroupID();			int grID = run.getRunGroupGroupID();			Group dis = null;			Group gr = null;			try {				dis = getGroupBiz().getGroupByGroupID(disID);				gr = getGroupBiz().getGroupByGroupID(grID);			}			catch (IBOLookupException e) {				e.printStackTrace();			}			catch (RemoteException e) {				e.printStackTrace();			}			catch (FinderException e) {				e.printStackTrace();			}			if(dis != null) {				distanceField = new Text(iwrb.getLocalizedString(dis.getName(),dis.getName()));			}			if(gr != null) {				groupField = new Text(iwrb.getLocalizedString(gr.getName(),gr.getName()));			}						participantNumberField.setContent(String.valueOf(run.getParticipantNumber()));			chipNumberField.setContent(String.valueOf(run.getChipNumber()));			tShirtField.setSelectedElement(run.getTShirtSize());			payMethodField.setSelectedElement(run.getPayMethod());			payedAmountField.setContent(run.getPayedAmount());			teamNameField.setContent(run.getRunGroupName());					}		submitButton = new SubmitButton(iwrb.getLocalizedString("run_tab.save", "Save"),PARAMETER_ACTION,Integer.toString(ACTION_SAVE));		submitButton.setAsImageButton(true);					}