Author: ilya_shaikovsky
Date: 2008-03-19 07:28:43 -0400 (Wed, 19 Mar 2008)
New Revision: 6939
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/pickList/examples/items.xhtml
Log:
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java 2008-03-19
10:26:31 UTC (rev 6938)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java 2008-03-19
11:28:43 UTC (rev 6939)
@@ -16,7 +16,7 @@
public class CapitalsBean {
private ArrayList<Capital> capitals = new ArrayList<Capital>();
private ArrayList<String> capitalsNames = new ArrayList<String>();
- private SelectItem[] capitalsNamesOptions;
+ private ArrayList<SelectItem> capitalsOptions = new
ArrayList<SelectItem>();
private String capital = "";
public List<Capital> autocomplete(Object suggest) {
@@ -49,11 +49,9 @@
for (Capital cap : capitals) {
capitalsNames.add(cap.getName());
}
- capitalsNamesOptions = new SelectItem[capitals.size()];
- for (int i=0; i<capitals.size(); i++) {
- capitalsNamesOptions[i] = new SelectItem();
- capitalsNamesOptions[i].setLabel(capitals.get(i).getName());
- capitalsNamesOptions[i].setValue(capitals.get(i).getName());
+ capitalsOptions.clear();
+ for (Capital cap : capitals) {
+ capitalsOptions.add(new SelectItem(cap.getName(),cap.getState()));
}
}
@@ -74,12 +72,12 @@
this.capital = capital;
}
+ public ArrayList<SelectItem> getCapitalsOptions() {
+ return capitalsOptions;
+ }
+
public ArrayList<String> getCapitalsNames() {
return capitalsNames;
}
- public SelectItem[] getCapitalsNamesOptions() {
- return capitalsNamesOptions;
- }
-
}
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/pickList/examples/items.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/pickList/examples/items.xhtml 2008-03-19
10:26:31 UTC (rev 6938)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/pickList/examples/items.xhtml 2008-03-19
11:28:43 UTC (rev 6939)
@@ -7,26 +7,30 @@
<style>
.top{
vertical-align:top;
+ }
+ .pbody{
+ padding:0px;
+ height:120px;
+ width:150px;
+ overflow:auto;
}
</style>
<h:form>
- <h:panelGrid columns="1" columnClasses="top, top">
+ <h:outputText value="change after RF-2602"></h:outputText>
+ <h:panelGrid columns="2" columnClasses="top, top">
<rich:pickList value="#{pickListBean.result}">
- <f:selectItems value="#{pickListBean.optionsAvailable}"/>
+ <f:selectItems value="#{capitalsBean.capitalsOptions}"/>
<a4j:support event="ondblclick" reRender="result"/>
</rich:pickList>
- <rich:panel id="result">
+ <rich:panel id="result" bodyClass="pbody">
<f:facet name="header">
<h:outputText value="#{pickListBean.items} Options
Choosen"></h:outputText>
</f:facet>
- <rich:dataTable value="#{pickListBean.result}" var="pickList"
rendered="#{pickListBean.items>0}">
+ <rich:dataList value="#{pickListBean.result}" var="pickList"
rendered="#{pickListBean.items>0}">
<rich:column>
- <f:facet name="header">
- <h:outputText value="Oprtions Values"/>
- </f:facet>
<h:outputText value="#{pickList}"/>
</rich:column>
- </rich:dataTable>
+ </rich:dataList>
</rich:panel>
</h:panelGrid>
</h:form>
Show replies by date