01: /**
02: * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a>
03: * @version $Id: ListBoxItemBean.java 6385 2007-10-25 14:02:26Z wehrens $
04: */package org.gridsphere.provider.portletui.beans;
05:
06: /**
07: * A <code>ListBoxItemBean</code> defines the elements contained within a <code>ListBoxBean</code>
08: */
09: public class ListBoxItemBean extends SelectElementBean {
10:
11: /**
12: * Constructs a default listbox item bean
13: */
14: public ListBoxItemBean() {
15: super (TagBean.LISTBOXITEM_NAME);
16: }
17:
18: /**
19: * Constructs a listbox item bean with a supplied bean identifier
20: *
21: * @param beanId the listbox item bean identifier
22: */
23: public ListBoxItemBean(String beanId) {
24: this ();
25: this .beanId = beanId;
26: }
27:
28: public String toStartString() {
29: String pval = (value == null) ? "" : value;
30: pval = (name == null) ? pval : name;
31: String sname = pval;
32: if (!beanId.equals("")) {
33: sname = "ui_" + vbName + "_" + beanId + "_" + pval;
34: }
35: // 'selected' replaced by 'selected="selected"' for XHTML 1.0 Strict compliance
36: return "<option " + getFormattedCss() + " value='" + sname
37: + "' " + checkDisabled() + " "
38: + checkSelected("selected=\"selected\"") + ">" + value
39: + "</option>";
40: }
41:
42: public String toEndString() {
43: return "";
44: }
45: }
|