/** * @see * com.idega.presentation.ui.AbstractChooserWindow#displaySelection(com.idega.presentation.IWContext) */ public void displaySelection(IWContext iwc) { String uId = iwc.getParameter(this.PARAMETER_USER_ID); if (uId != null) { try { User user = getUserHome().findByPrimaryKey(new Integer(uId)); Page page = getParentPage(); page.setOnLoad(SELECT_FUNCTION_NAME + "('" + user.getName() + "','" + uId + "')"); } catch (RemoteException e) { } catch (FinderException e) { } } else { init(iwc); addTitle(this.iwrb.getLocalizedString("select_a_user", "Select a user"), TITLE_STYLECLASS); this.form.maintainParameter(SCRIPT_PREFIX_PARAMETER); this.form.maintainParameter(SCRIPT_SUFFIX_PARAMETER); this.form.maintainParameter(DISPLAYSTRING_PARAMETER_NAME); this.form.maintainParameter(VALUE_PARAMETER_NAME); Table mainTable = new Table(1, 4); mainTable.setStyleClass(this.mainTableStyle); mainTable.setWidth(Table.HUNDRED_PERCENT); mainTable.setBorder(0); mainTable.add(getHeaderTable(iwc), 1, 1); mainTable.add(getNavigationTable(iwc), 1, 3); try { mainTable.add(getListTable(iwc), 1, 4); } catch (RemoteException r) { throw new RuntimeException(r.getMessage()); } this.form.add(mainTable); add(this.form, iwc); } }
public UIComponent getOverviewForm() { Form myForm = new Form(); myForm.setName(prmForm); Table T = new Table(3, 3); T.setCellpadding(0); T.setCellspacing(0); T.setBorder(0); T.setBorderColor("#000000"); T.setVerticalAlignment(1, 1, Table.VERTICAL_ALIGN_TOP); T.setVerticalAlignment(3, 1, Table.VERTICAL_ALIGN_TOP); // T.setVerticalAlignment(1, 4, Table.VERTICAL_ALIGN_BOTTOM); // T.add(getNavigationTree(iwc), 1, 1); T.add(getNavigationTree(), 1, 1); // T.add(getInfoLayer(), 2, 1); T.add(new Break(3), 3, 1); // T.setHeight(1, 3, "130"); // T.setHeight(1, 4, "90"); T.setWidth(2, 1, "40"); myForm.add(T); Page pVisit = this.getParentPage(); if (pVisit != null) { Script S = pVisit.getAssociatedScript(); // pVisit.setOnLoad("setRowColor(document.getElementById('inf1_1'));"); S.addFunction("setRowColor(obj)", setRowColorScript()); S.addFunction("showHideLayer(obj)", showHideLayerScript()); Script timeScript = myForm.getAssociatedFormScript(); if (timeScript == null) { timeScript = new Script(); myForm.setAssociatedFormScript(timeScript); } } ArrayList texts1 = new ArrayList(); ArrayList texts2 = new ArrayList(); if (age != null && age.getYears() >= 70) { texts1.add(localize(keySet1Text1U1, "Texten")); texts1.add(localize(keySet1Text2U1, "Texten")); texts1.add(localize(keySet1Text3U1, "Texten")); texts1.add(localize(keySet1Text4U1, "Texten")); texts1.add(localize(keySet1Text5U1, "Texten")); texts2.add(localize(keySet2Text1U1, "Texten")); texts2.add(localize(keySet2Text2U1, "Texten")); texts2.add(localize(keySet2Text3U1, "Texten")); texts2.add(localize(keySet2Text4U1, "Texten")); texts2.add(localize(keySet2Text5U1, "Texten")); } else { texts1.add(localize(keySet1Text1U2, "Texten")); texts1.add(localize(keySet1Text2U2, "Texten")); texts1.add(localize(keySet1Text3U2, "Texten")); texts1.add(localize(keySet1Text4U2, "Texten")); texts1.add(localize(keySet1Text5U2, "Texten")); texts2.add(localize(keySet2Text1U2, "Texten")); texts2.add(localize(keySet2Text2U2, "Texten")); texts2.add(localize(keySet2Text3U2, "Texten")); texts2.add(localize(keySet2Text4U2, "Texten")); texts2.add(localize(keySet2Text5U2, "Texten")); } Layer layerOut = new Layer(Layer.DIV); layerOut.setVisibility("visible"); layerOut.setOverflow("scroll"); layerOut.setPositionType("absolute"); layerOut.setWidth("280"); layerOut.setHeight("170"); layerOut.setMarkupAttribute("class", "ehealth_div"); Layer layer = new Layer(Layer.DIV); layer.setVisibility("hidden"); layer.setOverflow("hidden"); layer.setPositionType("absolute"); layer.setWidth("250"); layer.setHeight("145"); layer.setMarkupAttribute("class", "ehealth_div_no_border"); int theRow = 1; int i = 1; Iterator iter1 = texts1.iterator(); Iterator iter2 = texts2.iterator(); while (iter1.hasNext()) { Layer layers = (Layer) layer.clone(); layers.setID("info" + i + "_" + theRow); String text = (String) iter1.next(); layers.add(text); layerOut.add(layers); theRow++; } i++; theRow = 1; while (iter2.hasNext()) { Layer layers = (Layer) layer.clone(); layers.setID("info" + i + "_" + theRow); String text = (String) iter2.next(); layers.add(text); layerOut.add(layers); theRow++; } T.add(layerOut, 3, 1); return myForm; }