Author: lfryc(a)redhat.com
Date: 2010-07-10 14:10:10 -0400 (Sat, 10 Jul 2010)
New Revision: 17815
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java
root/tests/metamer/trunk/src/main/webapp/components/a4jCommandLink/simple.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/header.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml
Log:
https://jira.jboss.org/jira/browse/RFPL-466
* added log
* checkboxes in header fixed
* a4j:commandLink fixed (default behavior changed)
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java 2010-07-10
18:09:21 UTC (rev 17814)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java 2010-07-10
18:10:10 UTC (rev 17815)
@@ -68,7 +68,7 @@
attributes.put("action",
"#{a4jLinkBean.first6CharsAction}");
attributes.put("actionListener",
"#{a4jLinkBean.toUpperCaseActionListener}");
attributes.put("render", "output1 output2 output3");
-
+
}
/**
@@ -133,9 +133,13 @@
* @return null since no navigation should be performed
*/
public String first6CharsAction() {
- int endIndex = input.length() > ACTION_STRING_LENGTH ? ACTION_STRING_LENGTH :
input.length();
- input2 = (String) input.subSequence(0, endIndex);
- return null;
+ if (input == null) {
+ return "";
+ } else {
+ int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
+ input2 = (String) input.subSequence(0, endIndex);
+ return null;
+ }
}
/**
@@ -159,8 +163,12 @@
* @return null since no navigation should be performed
*/
public String toUpperCaseAction() {
- input2 = input.toUpperCase();
- return null;
+ if (input == null) {
+ return "";
+ } else {
+ input2 = input.toUpperCase();
+ return null;
+ }
}
/**
@@ -170,8 +178,12 @@
* an event representing the activation of a user interface component (not
used)
*/
public void first6CharsActionListener(ActionEvent event) {
- int endIndex = input.length() > ACTION_STRING_LENGTH ? ACTION_STRING_LENGTH :
input.length();
- input3 = (String) input.subSequence(0, endIndex);
+ if (input == null) {
+ input3 = "";
+ } else {
+ int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
+ input3 = (String) input.subSequence(0, endIndex);
+ }
}
/**
@@ -195,7 +207,11 @@
* an event representing the activation of a user interface component (not
used)
*/
public void toUpperCaseActionListener(ActionEvent event) {
- input3 = input.toUpperCase();
+ if (input == null) {
+ input3 = "";
+ } else {
+ input3 = input.toUpperCase();
+ }
}
}
Modified: root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java 2010-07-10
18:09:21 UTC (rev 17814)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java 2010-07-10
18:10:10 UTC (rev 17815)
@@ -33,7 +33,7 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpServletRequest;
+import javax.faces.model.SelectItem;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
@@ -52,19 +52,21 @@
private static final long serialVersionUID = 5590865106686406193L;
private Logger logger;
private String skin;
- private String skinning;
- private String skinningClasses;
- private String skinningSelect;
+ private List<SelectItem> skinningList;
+ private Skinning skinning;
private List<String> skins;
private boolean reDefault;
private boolean reComponent;
- private boolean reAttributes;
private boolean reTests;
private boolean log;
private String component;
private Map<String, String> components; // [a4jCommandLink; A4J Command Link]
private String container;
+ public enum Skinning {
+ NONE, SKINNING, SKINNING_CLASSES
+ }
+
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(RichBean.class);
@@ -74,11 +76,13 @@
component = "none";
container = "plain";
skin = "blueSky";
- skinning = "disable";
- skinningClasses = "disable";
+ skinningList = new ArrayList<SelectItem>();
+ skinningList.add(new SelectItem(Skinning.NONE));
+ skinningList.add(new SelectItem(Skinning.SKINNING));
+ skinningList.add(new SelectItem(Skinning.SKINNING_CLASSES));
+ skinning = Skinning.NONE;
reTests = false;
reComponent = true;
- reAttributes = true;
}
private Map<String, String> createComponentsMap() {
@@ -128,7 +132,7 @@
}
public String getSkinning() {
- if (skinningSelect.equals("skinning")) {
+ if (skinning == Skinning.SKINNING) {
return "enabled";
} else {
return "disabled";
@@ -136,11 +140,11 @@
}
public void setSkinning(String skinning) {
- this.skinning = skinning;
+ this.skinning = Skinning.valueOf(skinning);
}
-
+
public String getSkinningClasses() {
- if (skinningSelect.equals("skinning classes")) {
+ if (skinning == Skinning.SKINNING_CLASSES) {
return "enabled";
} else {
return "disabled";
@@ -148,9 +152,13 @@
}
public void setSkinningClasses(String skinningClasses) {
- this.skinningClasses = skinningClasses;
+ this.skinning = Skinning.valueOf(skinningClasses);
}
+ public List<SelectItem> getSkinningList() {
+ return skinningList;
+ }
+
public void setSkins(List<String> skins) {
this.skins = skins;
}
@@ -175,14 +183,6 @@
return reComponent;
}
- public void setReAttributes(boolean reAttributes) {
- this.reAttributes = reAttributes;
- }
-
- public boolean isReAttributes() {
- return reAttributes;
- }
-
public void setLog(boolean log) {
this.log = log;
}
@@ -233,14 +233,6 @@
this.reTests = reTests;
}
- public String getSkinningSelect() {
- return skinningSelect;
- }
-
- public void setSkinningSelect(String skinningSelect) {
- this.skinningSelect = skinningSelect;
- }
-
public String getListPage(String component) {
if ("none".equals(component)) {
return "/index?faces-redirect=true";
Modified: root/tests/metamer/trunk/src/main/webapp/components/a4jCommandLink/simple.xhtml
===================================================================
---
root/tests/metamer/trunk/src/main/webapp/components/a4jCommandLink/simple.xhtml 2010-07-10
18:09:21 UTC (rev 17814)
+++
root/tests/metamer/trunk/src/main/webapp/components/a4jCommandLink/simple.xhtml 2010-07-10
18:10:10 UTC (rev 17815)
@@ -33,7 +33,7 @@
style="#{a4jLinkBean.attributes['style']}"
styleClass="#{a4jLinkBean.attributes['styleClass']}"
tabindex="#{a4jLinkBean.attributes['tabindex']}"
target="#{a4jLinkBean.attributes['target']}"
title="#{a4jLinkBean.attributes['title']}"
type="#{a4jLinkBean.attributes['type']}"
- value="#{a4jLinkBean.attributes['value']}" />
+ value="#{a4jLinkBean.attributes['value']}"
execute="@form"/>
</h:panelGrid>
Modified: root/tests/metamer/trunk/src/main/webapp/templates/header.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/header.xhtml 2010-07-10 18:09:21
UTC (rev 17814)
+++ root/tests/metamer/trunk/src/main/webapp/templates/header.xhtml 2010-07-10 18:10:10
UTC (rev 17815)
@@ -8,7 +8,7 @@
<h:panelGrid columns="2" style="width: 180px;">
<h:outputLabel id="a4jLogLabel"
for="a4jLogCheckbox" value="a4j:log" />
<h:selectBooleanCheckbox id="a4jLogCheckbox"
value="#{richBean.log}">
- <a4j:ajax event="change" execute="@this"
render="a4jLog" />
+ <a4j:ajax event="change" execute="@this"
render="a4jLogPanel" />
</h:selectBooleanCheckbox>
<h:outputLabel id="a4jStatusLabel" for="a4jStatus"
value="a4j:status" />
<a4j:status id="a4jStatus">
@@ -20,13 +20,10 @@
<h:panelGrid columns="2">
<h:outputLabel id="reTestsCheckboxLabel" value="Display
tests" for="reTestsCheckbox" />
- <h:selectBooleanCheckbox id="reTestsCheckbox"
value="#{richBean.reTests}" onchange="submit();" />
+ <h:selectBooleanCheckbox id="reTestsCheckbox"
value="#{richBean.reTests}" onchange="submit();"
disabled="true"/>
<h:outputLabel id="reComponentCheckboxLabel"
value="Display component" for="reComponentCheckbox" />
<h:selectBooleanCheckbox id="reComponentCheckbox"
value="#{richBean.reComponent}" onchange="submit();" />
-
- <h:outputLabel id="reAttributesCheckboxLabel"
value="Didplay Properties" for="reAttributesCheckbox" />
- <h:selectBooleanCheckbox id="reAttributesCheckbox"
value="#{richBean.reAttributes}" onchange="submit();" />
</h:panelGrid>
<h:panelGrid columns="1">
@@ -36,10 +33,8 @@
<f:selectItems value="#{richBean.skins}" />
</h:selectOneMenu>
- <h:selectOneMenu id="skinningSelect"
value="#{richBean.skinningSelect}" style="width: 130px;">
- <f:selectItem itemLabel="none"
itemValue="none" />
- <f:selectItem itemLabel="skinning"
itemValue="skinning" />
- <f:selectItem itemLabel="skinningClasses"
itemValue="skinning classes" />
+ <h:selectOneMenu id="skinningSelect"
value="#{richBean.skinning}" style="width: 130px;">
+ <f:selectItems value="#{richBean.skinningList}" />
</h:selectOneMenu>
</h:panelGrid>
Modified: root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml 2010-07-10 18:09:21
UTC (rev 17814)
+++ root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml 2010-07-10 18:10:10
UTC (rev 17815)
@@ -14,9 +14,9 @@
<div class="header"><ui:include
src="/templates/header.xhtml" /></div>
<div class="content">
- <div id="controlPoint1">Control1</div>
+ <div class="messages"><rich:messages /></div>
- <h:panelGroup id="commonGrid" layout="block">
+ <h:panelGroup id="commonGrid" layout="block"
rendered="#{richBean.reComponent}">
<div><b>Status: </b> <input style="border: 0px; color:
black; width: 700px" readonly="true"
id="statusMessage" /></div>
<br />
@@ -24,9 +24,13 @@
<ui:insert name="template" />
</h:form></div>
</h:panelGroup> <br />
- <div id="controlPoint2">Control2</div>
+
</div>
+ <h:panelGroup id="a4jLogPanel" layout="block">
+ <a4j:log id="a4jLog" height="300px"
rendered="#{richBean.log}"/>
+ </h:panelGroup>
+
<div id="footer"><ui:insert name="footer">
<hr />
RichFaces #{a4j.version}