JBoss Rich Faces SVN: r3496 - trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-10-24 06:12:27 -0400 (Wed, 24 Oct 2007)
New Revision: 3496
Modified:
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
Log:
don't encode parameters if name == null
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2007-10-24 10:12:00 UTC (rev 3495)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2007-10-24 10:12:27 UTC (rev 3496)
@@ -70,18 +70,16 @@
UIParameter param = (UIParameter)child;
String name = param.getName();
- if (null == name) {
- throw new IllegalArgumentException(Messages.getMessage(
- Messages.UNNAMED_PARAMETER_ERROR, component.getClientId(context)));
+ if (name != null) {
+ Object value = param.getValue();
+ buff.append("params[");
+ buff.append(ScriptUtils.toScript(name));
+ buff.append("] = ");
+ buff.append(ScriptUtils.toScript(value));
+ buff.append(";");
+ params.add(buff.toString());
}
-
- Object value = param.getValue();
- buff.append("params[");
- buff.append(ScriptUtils.toScript(name));
- buff.append("] = ");
- buff.append(ScriptUtils.toScript(value));
- buff.append(";");
- params.add(buff.toString());
+
}
}
17 years, 2 months
JBoss Rich Faces SVN: r3495 - trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-10-24 06:12:00 -0400 (Wed, 24 Oct 2007)
New Revision: 3495
Modified:
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
Log:
don't encode parameters if name == null
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-10-24 10:11:10 UTC (rev 3494)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-10-24 10:12:00 UTC (rev 3495)
@@ -107,18 +107,16 @@
UIParameter param = (UIParameter)child;
String name = param.getName();
- if (null == name) {
- throw new IllegalArgumentException(Messages.getMessage(
- Messages.UNNAMED_PARAMETER_ERROR, component.getClientId(context)));
+ if (name != null) {
+ Object value = param.getValue();
+ buff.append("params[");
+ buff.append(ScriptUtils.toScript(name));
+ buff.append("] = ");
+ buff.append(ScriptUtils.toScript(value));
+ buff.append(";");
+ params.add(buff.toString());
}
-
- Object value = param.getValue();
- buff.append("params[");
- buff.append(ScriptUtils.toScript(name));
- buff.append("] = ");
- buff.append(ScriptUtils.toScript(value));
- buff.append(";");
- params.add(buff.toString());
+
}
}
17 years, 2 months
JBoss Rich Faces SVN: r3494 - trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-10-24 06:11:10 -0400 (Wed, 24 Oct 2007)
New Revision: 3494
Modified:
trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
Log:
don't add parameters if name==null
Modified: trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2007-10-24 08:34:35 UTC (rev 3493)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2007-10-24 10:11:10 UTC (rev 3494)
@@ -34,6 +34,7 @@
import javax.faces.context.ResponseWriter;
import javax.faces.event.PhaseId;
+import org.ajax4jsf.Messages;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
@@ -252,7 +253,8 @@
return context.getExternalContext().getRequestParameterMap();
}
- protected Map getParameters(UIComponent component){
+ //get UIParameter's Map
+ protected Map getParameters(FacesContext context, UIComponent component){
Map parameters = new HashMap();
if(component instanceof UIDatascroller){
@@ -262,7 +264,10 @@
UIComponent child = (UIComponent) iterator.next();
if(child instanceof UIParameter) {
UIParameter param = (UIParameter)child;
- parameters.put(param.getName(), param.getValue());
+ String name = param.getName();
+ if (name != null) {
+ parameters.put(name, param.getValue());
+ }
}
}
}
@@ -281,7 +286,7 @@
Map parameters = (Map) eventOptions.get("parameters");
parameters.put(scroller.getClientId(context), value);
- Map params = getParameters(component);
+ Map params = getParameters(context,component);
if(!params.isEmpty()){
parameters.putAll(params);
}
17 years, 2 months
JBoss Rich Faces SVN: r3493 - in branches/3.1.x/test-applications/facelets/src/main: java/richPanels and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: viktor_volkov
Date: 2007-10-24 04:34:35 -0400 (Wed, 24 Oct 2007)
New Revision: 3493
Added:
branches/3.1.x/test-applications/facelets/src/main/java/richPanels/
branches/3.1.x/test-applications/facelets/src/main/java/richPanels/RichPanelsBean.java
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/ModalPanel/
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/ModalPanel/ModalPanel.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/Panel/
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/Panel/Panel.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/PanelBar/
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/PanelBar/PanelBar.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/SimpleTogglePanel/
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/SimpleTogglePanel/SimpleTogglePanel.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/TabPanel/
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/TabPanel/TabPanel.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/TogglePanel/
branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/TogglePanel/TogglePanel.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-RichPanelsBean.xml
branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichPanels/
branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichPanels/RichPanels.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichPanelsMenu/
branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichPanelsMenu/RichPanelsMenu.xhtml
Modified:
branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml
branches/3.1.x/test-applications/facelets/src/main/webapp/pages/main.xhtml
Log:
Merging the RichPanels framework to main test application
Added: branches/3.1.x/test-applications/facelets/src/main/java/richPanels/RichPanelsBean.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/richPanels/RichPanelsBean.java (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/java/richPanels/RichPanelsBean.java 2007-10-24 08:34:35 UTC (rev 3493)
@@ -0,0 +1,17 @@
+package richPanels;
+
+public class RichPanelsBean {
+ private String src;
+
+ public RichPanelsBean() {
+ src = "/RichPanels/Panel/Panel.xhtml";
+ }
+
+ public String getSrc() {
+ return src;
+ }
+
+ public void setSrc(String src) {
+ this.src = src;
+ }
+}
Added: branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/ModalPanel/ModalPanel.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/ModalPanel/ModalPanel.xhtml (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/ModalPanel/ModalPanel.xhtml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -0,0 +1,68 @@
+<f:subview id="modalPanelSubviewID"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form id="MPform">
+ <rich:modalPanel id="MPid" minHeight="#{modalPanel.minHeight}"
+ minWidth="#{modalPanel.minWidth}" height="#{modalPanel.height}"
+ width="#{modalPanel.width}" moveable="#{modalPanel.moveable}"
+ resizeable="#{modalPanel.resizeable}" keepVisualState="" visualOptions="" >
+
+ <f:facet name="header">
+ <h:outputText value="Heder goes here..." />
+ </f:facet>
+ <h:outputText value="This is Modal Panel example" styleClass="text1" />
+ <f:verbatim>
+ <br />
+ <br />
+ </f:verbatim>
+ <h:outputLink
+ onclick="Richfaces.hideModalPanel('MPform:MPid');return false;"
+ value="Close">
+ <f:verbatim>Close</f:verbatim>
+ </h:outputLink>
+
+ </rich:modalPanel>
+
+ <a onclick="Richfaces.showModalPanel('MPform:MPid');" href="#">Show
+ MP</a>
+
+ <rich:spacer height="20px"></rich:spacer>
+
+ <h:panelGrid columns="2">
+
+ <h:outputText value="Width:" />
+ <h:inputText value="#{modalPanel.width}">
+ <a4j:support event="onchange" reRender="MPform:MPid"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Height:" />
+ <h:inputText value="#{modalPanel.height}">
+ <a4j:support event="onchange" reRender="MPform:MPid"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="minWidth:" />
+ <h:inputText value="#{modalPanel.minWidth}">
+ <a4j:support event="onchange" reRender="MPform:MPid"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="minHeight:" />
+ <h:inputText value="#{modalPanel.minHeight}">
+ <a4j:support event="onchange" reRender="MPform:MPid"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Resizeable:" />
+ <h:selectBooleanCheckbox value="#{modalPanel.resizeable}">
+ <a4j:support event="onclick" reRender="MPform:MPid"></a4j:support>
+ </h:selectBooleanCheckbox>
+
+ <h:outputText value="Moveable:" />
+ <h:selectBooleanCheckbox value="#{modalPanel.moveable}">
+ <a4j:support event="onclick" reRender="MPform:MPid"></a4j:support>
+ </h:selectBooleanCheckbox>
+
+ </h:panelGrid>
+ </h:form>
+</f:subview>
Added: branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/Panel/Panel.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/Panel/Panel.xhtml (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/Panel/Panel.xhtml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -0,0 +1,71 @@
+<f:subview id="panelSubviewID"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:c="http://java.sun.com/jstl/core">
+ <h:form>
+
+ <h:outputText
+ value="Panel 1, rendered: #{!panel.rendered}; Panel 2, rendered #{panel.rendered};"></h:outputText>
+
+ <rich:panel rendered="#{!panel.rendered}" id="p1"
+ style="width:#{panel.width};height:#{panel.height};overflow:auto;">
+ <f:facet name="header">
+ <h:outputText id="t1" value="#{panel.title[0]} (Panel 1)" />
+ </f:facet>
+
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText id="t2" value="#{panel.title[1]}" />
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText id="o1" value="width #{panel.title[2]}, eg. 250px"></h:outputText>
+ <h:inputText value="#{w}">
+ <a4j:support event="onchange" reRender="p3"></a4j:support>
+ </h:inputText>
+
+ <h:outputText id="o2" value="height #{panel.title[2]}, eg. 200px"></h:outputText>
+ <h:inputText value="#{h}">
+ <a4j:support event="onchange" reRender="p3"></a4j:support>
+ </h:inputText>
+ </h:panelGrid>
+
+ <rich:panel id="p3" style="width:#{w};height:#{h};overflow:auto;">
+ <f:facet name="header">
+ <h:outputText id="t3" value="#{panel.title[2]}" />
+ </f:facet>
+ <h:graphicImage value="/pics/asus.jpg" width="150" height="100"></h:graphicImage>
+ </rich:panel>
+ </rich:panel>
+ </rich:panel>
+
+ <rich:panel onmousedown="alert('OnMouseDown');" id="panelId"
+ onclick="submit()" rendered="#{panel.rendered}"
+ style="width:#{panel.width};height:#{panel.height}">
+ <f:verbatim>This is panel 2 example...</f:verbatim>
+
+ </rich:panel>
+
+ <h:panelGrid columns="2" cellpadding="10px">
+ <h:outputText value="Title"></h:outputText>
+ <h:inputText valueChangeListener="#{panel.makeTitle}">
+ <a4j:support event="onchange" reRender="t1,t2,t3,o1,o2"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Width: "></h:outputText>
+ <h:inputText value="#{panel.width}">
+ <a4j:support event="onchange" reRender="panelId,p1"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Height: "></h:outputText>
+ <h:inputText value="#{panel.height}">
+ <a4j:support event="onchange" reRender="panelId,p1"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Rendered:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{panel.rendered}" onclick="submit()"></h:selectBooleanCheckbox>
+ </h:panelGrid>
+ </h:form>
+</f:subview>
+
Added: branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/PanelBar/PanelBar.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/PanelBar/PanelBar.xhtml (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/PanelBar/PanelBar.xhtml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -0,0 +1,72 @@
+<f:subview id="panelBarSubviewID"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich">
+ <h:form>
+
+ <h:messages></h:messages>
+
+ <rich:panelBar id="pBId" height="#{panelBar.height}"
+ width="#{panelBar.width}" contentClass="#{panelBar.contentStyle}"
+ styleClass="#{panelBar.style}" selectedPanel="pBiId4">
+ <rich:panelBarItem rendered="#{panelBar.rendered}" id="pBiId1"
+ label="#{panelBar.label[0]}" headerClass="#{panelBar.headerStyle}">
+ <h:outputText value="Some text..."></h:outputText>
+ </rich:panelBarItem>
+
+ <rich:panelBarItem id="pBiId2" label="#{panelBar.label[1]}"
+ headerClass="#{panelBar.headerStyle}">
+ <h:graphicImage value="/pics/masshtaby_01.jpg" width="300"
+ height="200"></h:graphicImage>
+ </rich:panelBarItem>
+
+ <rich:panelBarItem id="pBiId3" label="#{panelBar.label[2]}"
+ headerClass="#{panelBar.headerStyle}">
+ <f:facet name="openMarker">
+ <h:graphicImage value="/pics/ajax_process.gif"></h:graphicImage>
+ </f:facet>
+ <f:facet name="closeMarker">
+ <h:graphicImage value="/pics/ajax_stoped.gif"></h:graphicImage>
+ </f:facet>
+ <h:graphicImage value="/pics/podb109_61.jpg" width="300"
+ height="200"></h:graphicImage>
+ </rich:panelBarItem>
+
+ <rich:panelBarItem id="pBiId4" label="#{panelBar.label[3]}"
+ headerClass="#{panelBar.headerStyle}">
+ <h:outputText value="Select Panel"></h:outputText>
+ </rich:panelBarItem>
+
+ </rich:panelBar>
+
+ <rich:spacer height="20px"></rich:spacer>
+
+ <h:panelGrid columns="2" cellspacing="10px">
+ <h:outputText value="Label: "></h:outputText>
+ <h:inputText valueChangeListener="#{panelBar.makeLabels}">
+ <a4j:support event="onchange" reRender="pBId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Width: "></h:outputText>
+ <h:inputText value="#{panelBar.width}">
+ <a4j:support event="onchange" reRender="pBId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Height: "></h:outputText>
+ <h:inputText value="#{panelBar.height}">
+ <a4j:support event="onchange" reRender="pBId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Rendered"></h:outputText>
+ <h:selectBooleanCheckbox value="#{panelBar.rendered}">
+ <a4j:support event="onchange" reRender="pBId" />
+ </h:selectBooleanCheckbox>
+
+ <h:outputText value="Switch Styles:" />
+ <h:commandButton action="#{panelBar.doStyles}"
+ value="#{panelBar.btnLabel}" />
+
+ </h:panelGrid>
+ </h:form>
+</f:subview>
Added: branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/SimpleTogglePanel/SimpleTogglePanel.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/SimpleTogglePanel/SimpleTogglePanel.xhtml (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/SimpleTogglePanel/SimpleTogglePanel.xhtml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -0,0 +1,93 @@
+<f:subview id="simpleTogglePanelSubviewID"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form>
+ <rich:simpleTogglePanel id="sTP" bodyClass="body" headerClass="head"
+ label="simpleTogglePanel with some text"
+ width="#{simpleTogglePanel.width}"
+ height="#{simpleTogglePanel.height}"
+ switchType="#{simpleTogglePanel.switchType}" opened="false">
+ <f:facet name="closeMarker">
+ <h:outputText value="Close It" />
+ </f:facet>
+ <f:facet name="openMarker">
+ <h:outputText value="Open It" />
+ </f:facet>
+ <f:verbatim>
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ </f:verbatim>
+ </rich:simpleTogglePanel>
+
+ <rich:simpleTogglePanel id="sTP1" headerClass="head"
+ label="simpleTogglePanel wiht image"
+ width="#{simpleTogglePanel.width}"
+ height="#{simpleTogglePanel.height}"
+ rendered="#{simpleTogglePanel.rendered}"
+ switchType="#{simpleTogglePanel.switchType}" opened="false">
+ <h:graphicImage value="/pics/podb109_61.jpg" width="500" height="300"></h:graphicImage>
+ </rich:simpleTogglePanel>
+
+ <rich:simpleTogglePanel id="sTP2" label="Focus simpleTogglePanle"
+ width="#{simpleTogglePanel.width}" ignoreDupResponses="true"
+ focus="#{simpleTogglePanel.focus}">
+ <f:facet name="closeMarker">
+ <h:graphicImage value="/pics/ajax_stoped.gif"></h:graphicImage>
+ </f:facet>
+ <f:facet name="openMarker">
+ <h:graphicImage value="/pics/ajax_process.gif"></h:graphicImage>
+ </f:facet>
+ <rich:simpleTogglePanel id="INsTP">
+ <h:panelGrid columns="2">
+ <h:graphicImage value="/pics/podb109_61.jpg" width="250px" height="200px"></h:graphicImage>
+ <f:verbatim>
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ </f:verbatim>
+ </h:panelGrid>
+ </rich:simpleTogglePanel>
+ </rich:simpleTogglePanel>
+
+ <rich:spacer height="20px"></rich:spacer>
+
+ <h:panelGrid columns="2" border="1">
+ <h:outputText value="Width:">
+ </h:outputText>
+ <h:inputText value="#{simpleTogglePanel.width}">
+ <a4j:support event="onchange" reRender="sTP, sTP1"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Height:">
+ </h:outputText>
+ <h:inputText value="#{simpleTogglePanel.height}">
+ <a4j:support event="onchange" reRender="sTP, sTP1"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Switch Type:"></h:outputText>
+ <h:selectOneRadio value="#{simpleTogglePanel.switchType}">
+ <f:selectItem itemLabel="client" itemValue="client" />
+ <f:selectItem itemLabel="server" itemValue="server" />
+ <f:selectItem itemLabel="ajax" itemValue="ajax" />
+ <a4j:support event="onclick" reRender="sTP, sTP1, sTP2"></a4j:support>
+ </h:selectOneRadio>
+
+ <h:outputText value="Rendered:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{simpleTogglePanel.rendered}"
+ onclick="submit()">
+ </h:selectBooleanCheckbox>
+
+ </h:panelGrid>
+
+ </h:form>
+</f:subview>
Added: branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/TabPanel/TabPanel.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/TabPanel/TabPanel.xhtml (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/TabPanel/TabPanel.xhtml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -0,0 +1,112 @@
+<f:subview id="tabPanelSubviewID"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:c="http://java.sun.com/jsp/jstl/core">
+<h:form>
+ <rich:tabPanel id="tabPanelId"
+ headerAlignment="#{tabPanel.headerAlignment}"
+ width="#{tabPanel.width}" height="#{tabPanel.height}"
+ rendered="#{tabPanel.rendered}" title="#{tabPanel.title}"
+ switchType="#{tabPanel.switchType}"
+ headerSpacing="#{tabPanel.headerSpacing}"
+ selectedTab="#{tabPanel.selectedTab}"
+ activeTabClass="#{tabPanel.activeTabStyle}"
+ disabledTabClass="#{tabPanel.disabledTabStyle}"
+ inactiveTabClass="#{tabPanel.inactiveTabStyle}"
+ contentClass="#{tabPanel.contentStyle}">
+
+ <rich:tab id="tabOne" onmousedown="alert('OnMouseDown');"
+ labelWidth="#{tabPanel.labelWidth}" label="#{tabPanel.label}">
+ <h:outputText value="This is tab panel test example"
+ styleClass="text1"></h:outputText>
+ </rich:tab>
+ <rich:tab id="tabTwo" label="Tab with image"
+ disabled="#{tabPanel.disabledTab}">
+ <f:facet name="header">
+ <h:outputText value="client switchType from facet" />
+ </f:facet>
+ <h:graphicImage value="/pics/masshtaby_01.jpg" width="560"
+ height="383"></h:graphicImage>
+ </rich:tab>
+ <rich:tab id="tabThree" label="Tab with some text"
+ disabled="#{tabPanel.disabledTab}">
+ <h:outputText
+ value=" Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text...
+ Some text... Some text... Some text... Some text... Some text... Some text... Some text... Some text..." />
+ </rich:tab>
+ </rich:tabPanel>
+
+ <rich:spacer height="20px"></rich:spacer>
+
+ <h:panelGrid columns="2" cellspacing="10px">
+ <h:outputText value="Width (px or %):"></h:outputText>
+ <h:inputText value="#{tabPanel.width}">
+ <a4j:support event="onchange" reRender="tabPanelId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Height (px or %):"></h:outputText>
+ <h:inputText value="#{tabPanel.height}">
+ <a4j:support event="onchange" reRender="tabPanelId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Title:"></h:outputText>
+ <h:inputText value="#{tabPanel.title}">
+ <a4j:support event="onchange" reRender="tabPanelId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="LabelWidth:"></h:outputText>
+ <h:inputText value="#{tabPanel.labelWidth}">
+ <a4j:support event="onchange" reRender="tabPanelId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="SwitchType:"></h:outputText>
+ <h:selectOneRadio value="#{tabPanel.switchType}">
+ <f:selectItem itemLabel="client" itemValue="client" />
+ <f:selectItem itemLabel="server" itemValue="server" />
+ <f:selectItem itemLabel="ajax" itemValue="ajax" />
+ <a4j:support event="onchange" reRender="tabPanelId"></a4j:support>
+ </h:selectOneRadio>
+
+ <h:outputText value="Header Alignment:"></h:outputText>
+ <h:selectOneRadio value="#{tabPanel.headerAlignment}">
+ <f:selectItem itemLabel="left" itemValue="left" />
+ <f:selectItem itemLabel="center" itemValue="center" />
+ <f:selectItem itemLabel="right" itemValue="right" />
+ <a4j:support event="onchange" reRender="tabPanelId"></a4j:support>
+ </h:selectOneRadio>
+
+ <h:outputText value="Header Spacing:"></h:outputText>
+ <h:inputText value="#{tabPanel.headerSpacing}">
+ <a4j:support event="onchange" reRender="tabPanelId"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="Selected Tab:"></h:outputText>
+ <h:selectOneRadio value="#{tabPanel.selectedTab}" onchange="submit();">
+ <f:selectItem itemLabel="1" itemValue="tabOne" />
+ <f:selectItem itemLabel="2" itemValue="tabTwo" />
+ <f:selectItem itemLabel="3" itemValue="tabThr" />
+ </h:selectOneRadio>
+
+ <h:outputText value="Rendered"></h:outputText>
+ <h:selectBooleanCheckbox value="#{tabPanel.rendered}"
+ onclick="submit()">
+ </h:selectBooleanCheckbox>
+
+ <h:outputText value="Disable Tab"></h:outputText>
+ <h:selectBooleanCheckbox value="#{tabPanel.disabledTab}"
+ onclick="submit()">
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Switch Styles:" />
+ <h:commandButton action="#{tabPanel.doStyles}"
+ value="#{tabPanel.btnLabel}" />
+
+
+ </h:panelGrid>
+</h:form>
+</f:subview>
Added: branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/TogglePanel/TogglePanel.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/TogglePanel/TogglePanel.xhtml (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/RichPanels/TogglePanel/TogglePanel.xhtml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -0,0 +1,203 @@
+<f:subview id="togglePanelSubviewID"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+ <h:form id="tooggleTest">
+ <rich:togglePanel id="panel1" switchType="#{togglePanel.switchType}"
+ initialState="asus" stateOrder="asus,blank"
+ style="width:300px!important">
+ <f:facet name="blank">
+ <rich:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <rich:toggleControl id="toggleControl_blank"
+ for="tooggleTest:panel1">
+ <h:outputText value="Expand" style="font-weight: bold;" />
+ <h:graphicImage url="/pics/collapse.gif"
+ style="border-width: 0px;" />
+ </rich:toggleControl>
+ </h:panelGroup>
+ </f:facet>
+ </rich:panel>
+ </f:facet>
+
+ <f:facet name="asus">
+ <rich:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <rich:toggleControl id="toggleControl_panel1"
+ for="tooggleTest:panel1">
+ <h:outputText value="Collapse" style="font-weight: bold;" />
+ <h:graphicImage url="/pics/expand.gif"
+ style="border-width: 0px;" />
+ </rich:toggleControl>
+ </h:panelGroup>
+ </f:facet>
+ <h:panelGrid columns="2" border="0"
+ style="width: 100%;background-color: white;">
+ <h:graphicImage url="/pics/asus.jpg" height="300" width="300"
+ alt="asus.jpg" />
+ <h:panelGroup>
+ <h:outputText style="font: 18px;font-weight: bold;"
+ value="Asus F 3 Tc" />
+ <f:verbatim>
+ Processor: AMD Turion 64 X 2 - 1600 Mhz<br />
+ RAM: 1024 Mb<br />
+ HDD: 100 Gb<br />
+ Screen: 15.4 WXGA<br />
+ Video: NVIDIA GeForce Go 7300<br />
+ Drive: DVD- RW DL<br />
+ </f:verbatim>
+ </h:panelGroup>
+ </h:panelGrid>
+ </rich:panel>
+ </f:facet>
+ </rich:togglePanel>
+
+ <f:verbatim>
+ <br />
+ <br />
+ </f:verbatim>
+
+ <rich:togglePanel id="panel2" switchType="#{togglePanel.switchType}"
+ initialState="#{togglePanel.initialState}"
+ stateOrder="#{togglePanel.stateOrder}">
+ <f:facet name="asus">
+ <rich:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="Customizable toggle panel"
+ style="font-weight: bold;" />
+ <rich:toggleControl id="toggleControl_panel_1"
+ for="tooggleTest:panel2">
+ <h:outputText value="Next"></h:outputText>
+ <h:graphicImage url="/pics/expand.gif"
+ style="border-width: 0px;" />
+ </rich:toggleControl>
+ </h:panelGroup>
+ </f:facet>
+ <h:panelGrid columns="2" border="0"
+ style="width: 100%;background-color: white;">
+ <h:graphicImage url="/pics/asus.jpg" height="300" width="300"
+ alt="asus.jpg" />
+ <h:panelGroup>
+ <h:outputText style="font: 18px;font-weight: bold;"
+ value="Asus F 3 Tc" />
+ <f:verbatim>
+ Processor: AMD Turion 64 X 2 - 1600 Mhz<br />
+ RAM: 1024 Mb<br />
+ HDD: 100 Gb<br />
+ Screen: 15.4 WXGA<br />
+ Video: NVIDIA GeForce Go 7300<br />
+ Drive: DVD- RW DL<br />
+ </f:verbatim>
+ </h:panelGroup>
+ </h:panelGrid>
+ </rich:panel>
+ </f:facet>
+
+ <f:facet name="benq">
+ <rich:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="Customizable toggle panel"
+ style="font-weight: bold;" />
+ <rich:toggleControl id="toggleControl_panel_2"
+ for="tooggleTest:panel2">
+ <h:outputText value="Next"></h:outputText>
+ <h:graphicImage url="/pics/expand.gif"
+ style="border-width: 0px;" />
+ </rich:toggleControl>
+ </h:panelGroup>
+ </f:facet>
+ <h:panelGrid columns="2" border="0"
+ style="width: 100%;background-color: yellow;">
+ <h:graphicImage url="/pics/benq.jpg" height="300" width="300"
+ alt="benq.jpg" />
+ <h:panelGroup>
+ <h:outputText style="font: 18px;font-weight: bold;"
+ value="BenQ A 52" />
+ <f:verbatim>
+ Processor: Core Duo T2250 (1.73GHz)<br />
+ RAM: 1024 Mb<br />
+ HDD: 100 Gb<br />
+ Screen: 15.4 WXGA<br />
+ Video: ATI Mobility Radeon X 200<br />
+ Drive: DVD- RW D<br />
+ </f:verbatim>
+ </h:panelGroup>
+ </h:panelGrid>
+ </rich:panel>
+ </f:facet>
+
+ <f:facet name="toshiba">
+ <rich:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="Customizable toggle panel"
+ style="font-weight: bold;" />
+ <rich:toggleControl id="toggleControl_panel_3"
+ for="tooggleTest:panel2">
+ <h:outputText value="Next"></h:outputText>
+ <h:graphicImage url="/pics/expand.gif"
+ style="border-width: 0px;" />
+ </rich:toggleControl>
+ </h:panelGroup>
+ </f:facet>
+ <h:panelGrid columns="2" border="0"
+ style="width: 100%;background-color: orange;">
+ <h:graphicImage url="/pics/toshiba.jpg" height="300" width="300"
+ alt="toshiba.jpg" />
+ <h:panelGroup>
+ <h:outputText style="font: 18px;font-weight: bold;"
+ value="Toshiba Satellite A 100-784" />
+ <f:verbatim>
+ Processor: Intel Core Duo T2250 - 1.73GHz<br />
+ RAM: 1024 Mb<br />
+ HDD: 100 Gb<br />
+ Screen: 15.4 WXGA<br />
+ Video: Intel Graphics Media 950<br />
+ Drive: DVD- RW DL<br />
+ </f:verbatim>
+ </h:panelGroup>
+ </h:panelGrid>
+ </rich:panel>
+ </f:facet>
+ </rich:togglePanel>
+ <f:verbatim>
+ <br />
+ <br />
+ </f:verbatim>
+ <rich:separator height="5px" width="500px" />
+
+ <h:panelGrid columns="2" cellpadding="5px" cellspacing="5px">
+ <h:outputText value="InitialState:"></h:outputText>
+ <h:selectOneRadio value="#{togglePanel.initialState}">
+ <f:selectItem itemLabel="Asus" itemValue="asus" />
+ <f:selectItem itemLabel="Benq" itemValue="benq" />
+ <f:selectItem itemLabel="toshiba" itemValue="toshiba" />
+ <a4j:support event="onchange" reRender="tooggleTest:panel2"></a4j:support>
+ </h:selectOneRadio>
+
+ <h:outputText value="StateOrder:"></h:outputText>
+ <h:selectOneRadio value="#{togglePanel.stateOrder}">
+ <f:selectItem itemLabel="Asus,Benq,Toshiba"
+ itemValue="asus,benq,toshiba" />
+ <f:selectItem itemLabel="Toshiba, Asus, Benq"
+ itemValue="toshiba,asus,benq" />
+ <a4j:support event="onchange" reRender="tooggleTest:panel2"></a4j:support>
+ </h:selectOneRadio>
+
+ <h:outputText value="switchType:"></h:outputText>
+ <h:selectOneRadio value="#{togglePanel.switchType}">
+ <f:selectItem itemLabel="client" itemValue="client" />
+ <f:selectItem itemLabel="server" itemValue="server" />
+ <f:selectItem itemLabel="ajax" itemValue="ajax" />
+ <a4j:support event="onclick" reRender="panel1,panel2"></a4j:support>
+ </h:selectOneRadio>
+ </h:panelGrid>
+ <ui:debug hotkey="L"></ui:debug>
+ </h:form>
+</f:subview>
Added: branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-RichPanelsBean.xml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-RichPanelsBean.xml (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-RichPanelsBean.xml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>richPanelsBean</managed-bean-name>
+ <managed-bean-class>richPanels.RichPanelsBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+</faces-config>
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml 2007-10-24 00:15:41 UTC (rev 3492)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -121,6 +121,10 @@
<to-view-id>/pages/Rich/Rich.xhtml</to-view-id>
</navigation-case>
<navigation-case>
+ <from-outcome>RichPanels</from-outcome>
+ <to-view-id>/pages/RichPanels/RichPanels.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
<from-outcome>Map</from-outcome>
<to-view-id>/pages/Select/Map.xhtml</to-view-id>
</navigation-case>
Added: branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichPanels/RichPanels.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichPanels/RichPanels.xhtml (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichPanels/RichPanels.xhtml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view>
+ <head>
+ <title></title>
+ <link rel="stylesheet"
+ href="#{facesContext.externalContext.requestContextPath}/styles/styles.css"
+ type="text/css" />
+ </head>
+ <body>
+ <div id="divOpthID" align="right" style="z-index: 200">
+ <ui:include src="/pages/RichPanelsMenu/RichPanelsMenu.xhtml"/>
+ </div>
+
+ <ui:include src="${richPanelsBean.src}" />
+ </body>
+</f:view>
+</html>
+
+
+
+
+
Added: branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichPanelsMenu/RichPanelsMenu.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichPanelsMenu/RichPanelsMenu.xhtml (rev 0)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/pages/RichPanelsMenu/RichPanelsMenu.xhtml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -0,0 +1,23 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich">
+
+<h:form id="forvDivOpthID2">
+ <h:panelGrid columns="2">
+ <h:selectOneMenu binding="#{skinBean.component}"></h:selectOneMenu>
+ <h:commandLink action="#{skinBean.change}" value="set skin" />
+
+ <h:outputText value="Select component:" />
+ <h:selectOneMenu value="#{richPanelsBean.src}" onchange="submit();">
+ <f:selectItem itemValue="/RichPanels/Panel/Panel.xhtml" itemLabel="Panel" />
+ <f:selectItem itemValue="/RichPanels/ModalPanel/ModalPanel.xhtml" itemLabel="Modal Panel" />
+ <f:selectItem itemValue="/RichPanels/PanelBar/PanelBar.xhtml" itemLabel="Panel Bar" />
+ <f:selectItem itemValue="/RichPanels/SimpleTogglePanel/SimpleTogglePanel.xhtml" itemLabel="Simple Toggle Panel" />
+ <f:selectItem itemValue="/RichPanels/TogglePanel/TogglePanel.xhtml" itemLabel="Toggle Panel" />
+ <f:selectItem itemValue="/RichPanels/TabPanel/TabPanel.xhtml" itemLabel="Tab Panel" />
+ </h:selectOneMenu>
+ </h:panelGrid>
+ <h:commandLink value="Back" action="main"></h:commandLink>
+</h:form>
+</html>
\ No newline at end of file
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/pages/main.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/pages/main.xhtml 2007-10-24 00:15:41 UTC (rev 3492)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/pages/main.xhtml 2007-10-24 08:34:35 UTC (rev 3493)
@@ -19,6 +19,7 @@
<h:commandLink value="Div" action="TestDiv"></h:commandLink>
<h:commandLink value="Select" action="Map"></h:commandLink>
<h:commandLink value="Customize page" action="CustomizePage"></h:commandLink>
+ <h:commandLink value="RichPanels" action="RichPanels"></h:commandLink>
</h:panelGrid>
</rich:panel>
</h:form>
17 years, 2 months
JBoss Rich Faces SVN: r3492 - in trunk/extensions/portlet/src: main/java/javax/portlet/faces/el and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-10-23 20:15:41 -0400 (Tue, 23 Oct 2007)
New Revision: 3492
Added:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AbstractAjaxBridge.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesServlet.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java
trunk/extensions/portlet/src/main/resources/META-INF/services/
trunk/extensions/portlet/src/main/resources/META-INF/services/javax.faces.context.FacesContextFactory
Modified:
trunk/extensions/portlet/src/main/java/javax/portlet/faces/GenericFacesPortlet.java
trunk/extensions/portlet/src/main/java/javax/portlet/faces/el/PortletELResolver.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletRequestWrapper.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/FaceletPortletViewHandler.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortalStateManager.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/component/UIPortletViewRoot.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ELContextImpl.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/FacesContextWrapper.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ServletContextImpl.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ServletSessionWrapper.java
trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java
Log:
Continue to implement JSR-301 bridge.
Modified: trunk/extensions/portlet/src/main/java/javax/portlet/faces/GenericFacesPortlet.java
===================================================================
--- trunk/extensions/portlet/src/main/java/javax/portlet/faces/GenericFacesPortlet.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/javax/portlet/faces/GenericFacesPortlet.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -20,7 +20,7 @@
import javax.portlet.RenderResponse;
import javax.portlet.WindowState;
-import org.ajax4jsf.portlet.AjaxFacesPortlet;
+import org.ajax4jsf.portlet.AjaxPortletBridge;
/**
* JSR 301 generic faces pottlet implementation.
@@ -33,7 +33,7 @@
private static final String BRIDGE_SERVICE_CLASSPATH = "META-INF/services/javax.portlet.faces.Bridge";
public static final String BRIDGE_CLASS = "javax.portlet.faces.BridgeClassName";
- private static final String DEFAULT_BRIDGE_CLASS = AjaxFacesPortlet.class
+ private static final String DEFAULT_BRIDGE_CLASS = AjaxPortletBridge.class
.getName();
private volatile String bridgeClassName = null;
private volatile Bridge facesPortletBrige = null;
Modified: trunk/extensions/portlet/src/main/java/javax/portlet/faces/el/PortletELResolver.java
===================================================================
--- trunk/extensions/portlet/src/main/java/javax/portlet/faces/el/PortletELResolver.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/javax/portlet/faces/el/PortletELResolver.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -18,13 +18,10 @@
import javax.el.ELResolver;
import javax.el.PropertyNotFoundException;
import javax.el.PropertyNotWritableException;
-
-import javax.faces.context.FacesContext;
import javax.faces.context.ExternalContext;
-
+import javax.faces.context.FacesContext;
import javax.portlet.PortletConfig;
import javax.portlet.PortletRequest;
-
import javax.portlet.faces.Bridge;
Added: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AbstractAjaxBridge.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AbstractAjaxBridge.java (rev 0)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AbstractAjaxBridge.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -0,0 +1,163 @@
+/**
+ *
+ */
+package org.ajax4jsf.portlet;
+
+import javax.faces.FacesException;
+import javax.faces.FactoryFinder;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.FacesContextFactory;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.lifecycle.LifecycleFactory;
+import javax.faces.webapp.FacesServlet;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.ServletResponse;
+
+import org.ajax4jsf.portlet.context.AbstractExternalContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author asmirnov
+ *
+ */
+public abstract class AbstractAjaxBridge {
+ protected static final Log log = LogFactory.getLog(AbstractAjaxBridge.class);
+
+ /**
+ * <p>
+ * The key used to store/retrive the PortletConfig object.
+ * </p>
+ */
+ public static final String PORTLET_CONFIG = "javax.portlet.PortletConfig";
+
+ private Lifecycle lifecycle;
+
+ private FacesContextFactory facesContextFactory;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.portlet.GenericPortlet#init(javax.portlet.PortletConfig)
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.portlet.Brige#init(javax.portlet.PortletConfig)
+ */
+ public void init() throws FacesException {
+ // get faces lifecycle instance. Name of the Lifecycle can be
+ // changed by the init parameter, as described in the JSR 301 PLT
+ // 3.2
+ LifecycleFactory factory = (LifecycleFactory) FactoryFinder
+ .getFactory(FactoryFinder.LIFECYCLE_FACTORY);
+ String lifecycleId = getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR);
+ if (null == lifecycleId) {
+ lifecycleId = LifecycleFactory.DEFAULT_LIFECYCLE;
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Create instance of a JSF lifecycle " + lifecycleId);
+ }
+ this.lifecycle = factory.getLifecycle(lifecycleId);
+ // get faces context factory instance
+ this.facesContextFactory = (FacesContextFactory) FactoryFinder
+ .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
+ }
+
+ protected abstract String getInitParameter(String lifecycleIdAttr);
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.portlet.GenericPortlet#destroy()
+ */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.portlet.Brige#destroy()
+ */
+ public void destroy() {
+ this.lifecycle = null;
+ this.facesContextFactory = null;
+ }
+
+ /**
+ * Get currenf JSF lifecycle instance.
+ *
+ * @return
+ */
+ protected Lifecycle getLifecycle() {
+ return this.lifecycle;
+ }
+
+ /**
+ * Create new faces context instance.
+ *
+ * @param request
+ * @param response
+ * @return new instance of faces context.
+ */
+ protected FacesContext getFacesContext(Object request,
+ Object response) {
+ FacesContext facesContext = this.facesContextFactory.getFacesContext(
+ getContext(), request, response,
+ getLifecycle());
+ return facesContext;
+ }
+
+ protected abstract Object getContext();
+
+ protected void execute(FacesContext context) throws FacesException {
+ getLifecycle().execute(context);
+ }
+
+ protected void render(FacesContext context) throws FacesException {
+ getLifecycle().render(context);
+ }
+
+
+ /**
+ * @param facesContext
+ * @return
+ */
+ public static String getPortletNamespace(FacesContext facesContext) {
+ ExternalContext externalContext = facesContext.getExternalContext();
+ Object response = externalContext.getResponse();
+ String namespace = null;
+ if (response instanceof RenderResponse) {
+ namespace = ((RenderResponse) response).getNamespace();
+ } else if (response instanceof ServletResponse) {
+ namespace = (String) externalContext.getRequestParameterMap().get(
+ AbstractExternalContext.NAMESPACE_PARAMETER);
+ } else {
+ throw new IllegalStateException(
+ "portlet Namespace not availible at this phase");
+ }
+ return namespace;
+ }
+
+ /**
+ * @param facesContext
+ * @return
+ */
+ public static PortletMode getPortletMode(FacesContext facesContext) {
+ ExternalContext externalContext = facesContext.getExternalContext();
+ Object request = externalContext.getRequest();
+ PortletMode mode = null;
+ if (request instanceof PortletRequest) {
+ mode = ((PortletRequest) request).getPortletMode();
+ } else if (null != externalContext.getRequestParameterMap().get(
+ AbstractExternalContext.PORTLET_MODE_PARAMETER)) {
+ String modeName = (String) externalContext.getRequestParameterMap()
+ .get(AbstractExternalContext.PORTLET_MODE_PARAMETER);
+ if (null != modeName) {
+ mode = new PortletMode(modeName);
+ }
+ }
+ return mode;
+ }
+
+}
Property changes on: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AbstractAjaxBridge.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -28,12 +28,9 @@
import javax.portlet.RenderResponse;
import javax.portlet.faces.Bridge;
import javax.portlet.faces.BridgeException;
-import javax.portlet.faces.Bridge.PortletPhase;
import javax.servlet.ServletResponse;
import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.portlet.application.ComponentsLoader;
-import org.ajax4jsf.portlet.application.ComponentsLoaderImpl;
import org.ajax4jsf.portlet.application.PortletStateHolder;
import org.ajax4jsf.portlet.context.AbstractExternalContext;
import org.apache.commons.logging.Log;
Added: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesServlet.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesServlet.java (rev 0)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesServlet.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -0,0 +1,89 @@
+package org.ajax4jsf.portlet;
+
+import java.io.IOException;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class AjaxFacesServlet extends AbstractAjaxBridge implements Servlet {
+
+ private ServletConfig config;
+
+ @Override
+ protected Object getContext() {
+ return config.getServletContext();
+ }
+
+ @Override
+ protected String getInitParameter(String name) {
+ // TODO Auto-generated method stub
+ return config.getServletContext().getInitParameter(name);
+ }
+
+ public ServletConfig getServletConfig() {
+ return config;
+ }
+
+ public String getServletInfo() {
+ return (this.getClass().getName());
+ }
+
+ public void init(ServletConfig config) throws ServletException {
+ this.config = config;
+ try {
+ init();
+ } catch (FacesException e) {
+ throw new ServletException(e);
+ }
+ }
+
+ public void service(ServletRequest req, ServletResponse res)
+ throws ServletException, IOException {
+ HttpServletRequest httpRequest = (HttpServletRequest) req;
+ String pathInfo = httpRequest.getPathInfo();
+ // Protect hidden directories
+ if (pathInfo != null) {
+ pathInfo = pathInfo.toUpperCase();
+ if (pathInfo.startsWith("/WEB-INF/")
+ || pathInfo.equals("/WEB-INF")
+ || pathInfo.startsWith("/META-INF/")
+ || pathInfo.equals("/META-INF")) {
+ ((HttpServletResponse) res).
+ sendError(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+ }
+ FacesContext context = getFacesContext(req, res);
+ // Execute the request processing lifecycle for this request
+ try {
+ execute(context);
+ // Save request - scope information for a portlet render phase.
+ render(context);
+ } catch (FacesException e) {
+ Throwable t = e.getCause();
+ if (t == null) {
+ throw new ServletException(e.getMessage(), e);
+ } else {
+ if (t instanceof ServletException) {
+ throw ((ServletException) t);
+ } else if (t instanceof IOException) {
+ throw ((IOException) t);
+ } else {
+ throw new ServletException(t.getMessage(), t);
+ }
+ }
+ }
+ finally {
+ // Release the FacesContext instance for this request
+ context.release();
+ }
+ }
+
+}
Property changes on: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesServlet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java (rev 0)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -0,0 +1,182 @@
+/**
+ *
+ */
+package org.ajax4jsf.portlet;
+
+import java.io.PrintWriter;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.faces.Bridge;
+import javax.portlet.faces.BridgeDefaultViewNotSpecifiedException;
+import javax.portlet.faces.BridgeException;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.portlet.context.AbstractExternalContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class AjaxPortletBridge extends AbstractAjaxBridge implements Bridge {
+
+ private static final Log log = LogFactory.getLog(AjaxPortletBridge.class);
+ private PortletConfig portletConfig;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.portlet.faces.Bridge#destroy()
+ */
+ public void destroy() {
+ if (log.isDebugEnabled()) {
+ log.debug("Destroy portlet " + getPortletConfig().getPortletName());
+ }
+ super.destroy();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.portlet.faces.Bridge#init(javax.portlet.PortletConfig)
+ */
+ public void init(PortletConfig config) throws PortletException {
+ try {
+ if (log.isDebugEnabled()) {
+ log.debug("Start portlet initialisation for "
+ + config.getPortletName());
+ }
+ this.portletConfig = config;
+ init();
+ } catch (FacesException e) {
+ throw new PortletException("Initialization error", e);
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Done portlet initialisation for "
+ + config.getPortletName());
+ }
+ // getPortletContext().setAttribute(PORTLET_CONFIG, config);
+ }
+
+ public void doFacesRequest(ActionRequest request, ActionResponse response)
+ throws BridgeException {
+ initRequest(request, response, Bridge.PortletPhase.ActionPhase);
+ FacesContext facesContext = getFacesContext(request, response);
+ try {
+ execute(facesContext);
+ // saveView(facesContext);
+ } catch (Exception e) {
+ log.error("Error processing execute lifecycle", e);
+ throw new BridgeException("Error processing execute lifecycle ", e);
+ } finally {
+ facesContext.release();
+ }
+ }
+
+ public void doFacesRequest(RenderRequest request, RenderResponse response)
+ throws BridgeException {
+ initRequest(request, response, Bridge.PortletPhase.RenderPhase);
+ FacesContext facesContext = getFacesContext(request, response);
+ try {
+ if (null == response.getContentType()) {
+ String contenttype = request.getResponseContentType();
+ if (contenttype == null) {
+ contenttype = "text/html";
+ }
+ String encoding = response.getCharacterEncoding();
+ if (encoding == null) {
+ encoding = "UTF-8";
+ }
+ response.setContentType(contenttype);
+
+ }
+ PrintWriter writer = response.getWriter();
+ String namespace = response.getNamespace();
+ // Write anchor for update portlet pages by ajax.
+ // TODO - configure html element and style/class.
+ writer.println("<div id='" + namespace + "'>");
+ // writer.flush();
+ AjaxContext ajaxContext = AjaxContext
+ .getCurrentInstance(facesContext);
+ ajaxContext.getCommonAjaxParameters().put(
+ AbstractExternalContext.ACTION__PARAMETER,
+ response.createActionURL().toString());
+ ajaxContext.getCommonAjaxParameters().put(
+ AbstractExternalContext.PORTLET_MODE_PARAMETER,
+ request.getPortletMode().toString());
+ ajaxContext.getCommonAjaxParameters().put(
+ AbstractExternalContext.NAMESPACE_PARAMETER, namespace);
+ render(facesContext);
+ writer.println("</div>");
+ PortletSession portletSession = request.getPortletSession(true);
+ // Store namespace value in portlet scope session.
+ // ServletContext, in case of ajax requests,
+ // will restore session prefiv by it's value.
+ portletSession.setAttribute(
+ AbstractExternalContext.NAMESPACE_PARAMETER, namespace);
+ if (log.isDebugEnabled()) {
+ log
+ .debug("Finish rendering portlet for namespace "
+ + namespace);
+ }
+ // Disable portlet caching.
+ // TODO - detect ajax components on page, static views can be
+ // cached.
+ response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+ } catch (Exception e) {
+ log.error("Error processing execute lifecycle", e);
+ throw new BridgeException("Error processing execute lifecycle ", e);
+ } finally {
+ facesContext.release();
+ }
+ }
+
+ /**
+ * @param request
+ * @param response
+ * @param actionPhase
+ * @throws BridgeException
+ */
+ protected void initRequest(PortletRequest request,
+ PortletResponse response, PortletPhase actionPhase)
+ throws BridgeException {
+ if( null == request.getAttribute(Bridge.DEFAULT_VIEWID)){
+ throw new BridgeDefaultViewNotSpecifiedException();
+ }
+ request.setAttribute(Bridge.PORTLET_LIFECYCLE_PHASE, actionPhase);
+ }
+
+ /**
+ * @return the portletConfig
+ */
+ protected PortletConfig getPortletConfig() {
+ return portletConfig;
+ }
+
+ @Override
+ protected Object getContext() {
+ // TODO Auto-generated method stub
+ return portletConfig.getPortletContext();
+ }
+
+ @Override
+ protected String getInitParameter(String name) {
+ String initParameter = portletConfig.getInitParameter(name);
+ if(null == initParameter){
+ initParameter = portletConfig.getPortletContext().getInitParameter(name);
+ }
+ return initParameter;
+ }
+
+}
Property changes on: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletRequestWrapper.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletRequestWrapper.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletRequestWrapper.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -11,6 +11,7 @@
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
+
import javax.portlet.PortletRequest;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletInputStream;
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/FaceletPortletViewHandler.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/FaceletPortletViewHandler.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/FaceletPortletViewHandler.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -1,8 +1,8 @@
package org.ajax4jsf.portlet.application;
import java.io.IOException;
-import java.io.PrintWriter;
import java.io.Writer;
+
import javax.faces.FacesException;
import javax.faces.application.ViewHandler;
import javax.faces.context.ExternalContext;
@@ -11,6 +11,7 @@
import javax.faces.render.RenderKit;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
+
import com.sun.facelets.FaceletViewHandler;
/**
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortalStateManager.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortalStateManager.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortalStateManager.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -4,8 +4,6 @@
package org.ajax4jsf.portlet.application;
import javax.faces.application.StateManager;
-import javax.faces.application.StateManager.SerializedView;
-import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import org.ajax4jsf.application.AjaxStateManager;
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -4,20 +4,16 @@
package org.ajax4jsf.portlet.application;
import java.io.Serializable;
-import java.util.HashMap;
import java.util.Map;
-import javax.faces.FacesException;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import javax.portlet.PortletConfig;
import javax.portlet.PortletMode;
import javax.portlet.PortletRequest;
import javax.portlet.faces.Bridge;
import javax.portlet.faces.BridgeDefaultViewNotSpecifiedException;
import org.ajax4jsf.portlet.AjaxFacesPortlet;
-import org.ajax4jsf.portlet.context.AbstractExternalContext;
import org.apache.commons.collections.map.LRUMap;
/**
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -10,15 +10,10 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
-import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
-import javax.portlet.ActionRequest;
-import javax.portlet.RenderRequest;
/**
* @author asmirnov
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/component/UIPortletViewRoot.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/component/UIPortletViewRoot.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/component/UIPortletViewRoot.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -19,6 +19,11 @@
public class UIPortletViewRoot extends AjaxViewRoot implements
PortletNamingContainer, Serializable {
+
+ public UIPortletViewRoot() {
+ super();
+ }
+
/**
*
*/
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -53,24 +53,12 @@
*/
package org.ajax4jsf.portlet.context;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.Principal;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
-import java.util.Locale;
import java.util.Map;
-import java.util.Set;
-import javax.faces.FacesException;
+
import javax.faces.context.ExternalContext;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletResponse;
/**
*
@@ -105,6 +93,7 @@
public static final String NAMESPACE_PARAMETER ="org.ajax4jsf.portlet.NAMESPACE";
public static final String ACTION__PARAMETER = "org.ajax4jsf.portlet.ACTION_URL";
public static final Object PORTLET_MODE_PARAMETER = "org.ajax4jsf.portlet.MODE";
+ public static final Object PORTLET_NAME_PARAMETER = "org.ajax4jsf.portlet.NAME";
protected static final String[] EMPTY_STRING_ARRAY = new String[0];
// TODO - optimization.
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -23,9 +23,9 @@
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.Collection;
-import java.util.Iterator;
import java.util.Enumeration;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Map;
import java.util.Set;
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ELContextImpl.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ELContextImpl.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ELContextImpl.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -6,6 +6,7 @@
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
+
import javax.el.ELContext;
import javax.el.ELResolver;
import javax.el.FunctionMapper;
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -54,11 +54,12 @@
package org.ajax4jsf.portlet.context;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+
import javax.el.ELContext;
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
@@ -73,6 +74,8 @@
import javax.faces.lifecycle.Lifecycle;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitFactory;
+import javax.portlet.PortletResponse;
+import javax.portlet.faces.component.PortletNamingContainer;
/**
*
@@ -338,6 +341,14 @@
public void setViewRoot(UIViewRoot viewRoot) {
checkReleased();
this.viewRoot = viewRoot;
+ // JSR-301 PLT 6.1.2 FacesContext
+ if( viewRoot instanceof PortletNamingContainer ){
+ Object response = getExternalContext().getResponse();
+ if (response instanceof PortletResponse) {
+ PortletResponse portletResponse = (PortletResponse) response;
+ portletResponse.setProperty("X-JAVAX-PORTLET-IS-NAMESPACED" , "true");
+ }
+ }
}
public void addMessage(String clientID, FacesMessage message) {
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/FacesContextWrapper.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/FacesContextWrapper.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/FacesContextWrapper.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -4,6 +4,7 @@
package org.ajax4jsf.portlet.context;
import java.util.Iterator;
+
import javax.el.ELContext;
import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -10,14 +10,13 @@
import java.net.URL;
import java.security.Principal;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
+
import javax.faces.FacesException;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ServletContextImpl.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ServletContextImpl.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ServletContextImpl.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -10,24 +10,22 @@
import java.net.URL;
import java.security.Principal;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Locale;
-import java.util.Map;
import java.util.Set;
+
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import javax.portlet.PortletSession;
import javax.portlet.PortletSessionUtil;
-import javax.portlet.RenderResponse;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ServletSessionWrapper.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ServletSessionWrapper.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ServletSessionWrapper.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -4,6 +4,7 @@
package org.ajax4jsf.portlet.context;
import java.util.Enumeration;
+
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionContext;
Added: trunk/extensions/portlet/src/main/resources/META-INF/services/javax.faces.context.FacesContextFactory
===================================================================
--- trunk/extensions/portlet/src/main/resources/META-INF/services/javax.faces.context.FacesContextFactory (rev 0)
+++ trunk/extensions/portlet/src/main/resources/META-INF/services/javax.faces.context.FacesContextFactory 2007-10-24 00:15:41 UTC (rev 3492)
@@ -0,0 +1 @@
+org.ajax4jsf.portlet.context.FacesContextFactoryImpl
Modified: trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java
===================================================================
--- trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java 2007-10-23 19:18:11 UTC (rev 3491)
+++ trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java 2007-10-24 00:15:41 UTC (rev 3492)
@@ -15,6 +15,7 @@
import org.ajax4jsf.portlet.AbstractAjax4jsfPortletTestCase;
import org.ajax4jsf.portlet.AjaxFacesPortlet;
+import org.ajax4jsf.portlet.AjaxPortletBridge;
import junit.framework.TestCase;
@@ -277,7 +278,7 @@
setupActionRequest();
GenericFacesPortlet portlet = new GenericFacesPortlet();
portlet.init(portletConfig);
- assertEquals(AjaxFacesPortlet.class.getName(), portlet
+ assertEquals(AjaxPortletBridge.class.getName(), portlet
.getBrigeClassName());
}
17 years, 2 months
JBoss Rich Faces SVN: r3491 - in trunk/cdk: generator/src/main/resources and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-10-23 15:18:11 -0400 (Tue, 23 Oct 2007)
New Revision: 3491
Added:
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/velocity/
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/velocity/ResourceLoader.java
trunk/cdk/maven-cdk-plugin/src/main/resources/META-INF/
trunk/cdk/maven-cdk-plugin/src/main/resources/META-INF/plexus/
trunk/cdk/maven-cdk-plugin/src/main/resources/META-INF/plexus/components.xml
Removed:
trunk/cdk/generator/src/main/resources/VM_global_library.vm
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java
trunk/cdk/generator/src/main/resources/META-INF/templates12/VM_global_library.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/component.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/converterTag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/listener_tag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java
trunk/cdk/maven-cdk-plugin/src/main/resources/VM_global_library.vm
Log:
Refactoring of 1.2 templates
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2007-10-23 19:18:11 UTC (rev 3491)
@@ -21,16 +21,21 @@
package org.ajax4jsf.builder.config;
+import java.beans.PropertyDescriptor;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
import javax.naming.ConfigurationException;
import org.ajax4jsf.builder.generator.Logger;
+import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.digester.Digester;
import org.apache.commons.digester.ExtendedBaseRules;
import org.apache.tools.ant.BuildException;
@@ -415,20 +420,42 @@
if (bean.getSuperclass() != null) {
Class<?> componentSClass = Class.forName(bean
.getSuperclass(), false, getLoader());
-
+
if (listenerClass.isAssignableFrom(componentSClass)) {
PropertyBean listenerProperty = bean
.getProperty(listener.getName());
+
if (null == listenerProperty) {
- listenerProperty = new PropertyBean();
- listenerProperty.setName(listener.getName());
- bean.addProperty(listenerProperty);
-
+ listenerProperty = new PropertyBean();
+ listenerProperty.setName(listener.getName());
+ bean.addProperty(listenerProperty);
+ listenerProperty.setClassname("javax.el.MethodExpression");
}
+
+ Map<String, PropertyDescriptor> map =
+ getPropertyDescriptors(componentSClass);
+
+ PropertyDescriptor propertyDescriptor =
+ map.get(listener.getName());
+
+ if (propertyDescriptor != null) {
+ String componentPropertyName = propertyDescriptor.getPropertyType().getName();
+
+ if (!componentPropertyName.equals(listenerProperty.getClassname())) {
+ _log.error(
+ String.format("Overriding property type %s with %s for %s.%s",
+ listenerProperty.getClassname(),
+ componentPropertyName,
+ bean.getClassname(),
+ listener.getName()
+ ));
+ }
+
+ listenerProperty.setClassname(componentPropertyName);
+ }
+
// TODO - check existing property for compability with this listener.
- listenerProperty
- .setClassname("javax.faces.el.MethodBinding");
listenerProperty.setEl(true);
listenerProperty.setElonly(true);
listenerProperty.setAttachedstate(true);
@@ -460,6 +487,38 @@
}
+
+ private Map<String, PropertyDescriptor> getPropertyDescriptors(Class<?> clazz) {
+
+ if (clazz.equals(Object.class)) {
+ return Collections.emptyMap();
+ }
+
+ Map<String, PropertyDescriptor> m =
+ new TreeMap<String, PropertyDescriptor>();
+
+ Class<?> superclass = clazz.getSuperclass();
+ if (superclass != null) {
+ m.putAll(getPropertyDescriptors(superclass));
+ }
+
+ Class<?>[] interfaces = clazz.getInterfaces();
+ if (interfaces != null) {
+ for (Class<?> intrfc : interfaces) {
+ m.putAll(getPropertyDescriptors(intrfc));
+ }
+ }
+
+ PropertyDescriptor[] descriptors =
+ PropertyUtils.getPropertyDescriptors(clazz);
+
+ for (PropertyDescriptor propertyDescriptor : descriptors) {
+ m.put(propertyDescriptor.getName(), propertyDescriptor);
+ }
+
+ return m;
+ }
+
/*
* (non-Javadoc)
*
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java 2007-10-23 19:18:11 UTC (rev 3491)
@@ -37,6 +37,8 @@
"java.util.List",
"javax.faces.el.MethodBinding",
"javax.faces.el.ValueBinding",
+ "javax.el.MethodExpression",
+ "javax.el.ValueExpression",
"javax.faces.convert.Converter"
};
/**
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/VM_global_library.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/VM_global_library.vm 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/VM_global_library.vm 2007-10-23 19:18:11 UTC (rev 3491)
@@ -3,8 +3,8 @@
#if($a)$a#end
#end
-
+
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/component.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/component.vm 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/component.vm 2007-10-23 19:18:11 UTC (rev 3491)
@@ -96,7 +96,7 @@
if (null != this._${prop.name})
{
return this._${prop.name};
- #if( !$prop.isInstanceof("javax.el.MethodExpression") && !$prop.isInstanceof("javax.el.ValueExpression"))
+ #if( !$prop.isInstanceof("javax.el.MethodExpression") && !$prop.isInstanceof("javax.el.ValueExpression")&& !$prop.isInstanceof("javax.faces.el.ValueBinding")&& !$prop.isInstanceof("javax.faces.el.MethodBinding"))
}
ValueExpression ve = getValueExpression("${prop.name}");
if (null != ve){
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2007-10-23 19:18:11 UTC (rev 3491)
@@ -21,56 +21,13 @@
public class $tag.simpleClassName extends $tag.superclass {
-// Fields
-#foreach( $prop in $component.properties )
- #if( !$prop.existintag && !$prop.hidden)
- #if($prop.classname == "javax.el.MethodExpression" || $prop.classname == "javax.faces.el.MethodBinding")
- #set($type = "MethodExpression")
- #else
- #set($type = "ValueExpression")
- #end
-
- /*
- * $prop.name
- * ${prop.xmlEncodedDescription}
- */
- private $type _${prop.name};
- /**
- * $prop.description
- * Setter for $prop.name
- * @param $prop.name - new value
- */
- public void ${prop.setterName}( $type __${prop.name} ){
- this._${prop.name} = __${prop.name};
- }
-
- #if( $prop.alias)
- /**
- * ${prop.xmlEncodedDescription}
- * Setter for alias of $prop.name as $prop.alias
- * @param $prop.name - new value
- */
- public void set${prop.upperFirstChar($prop.alias)}( $type __${prop.alias} ){
- this.${prop.setterName}(__${prop.alias});
- }
- #end
- #end
-#end
-
-// Release
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.components.taglib.html.HtmlCommandButtonTagBase#release()
- */
+ #tagPropertyMethods12($component)
+
public void release()
{
// TODO Auto-generated method stub
super.release();
-#foreach( $prop in $component.properties )
- #if( !$prop.existintag && !$prop.hidden)
- this._${prop.name} = null;
- #end
-#end
+ #tagPropertyRelease($component)
}
/* (non-Javadoc)
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/converterTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/converterTag.vm 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/converterTag.vm 2007-10-23 19:18:11 UTC (rev 3491)
@@ -7,11 +7,16 @@
#foreach($import in $imports)
import $import ;
#end
+import javax.el.ELException;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
+import javax.el.MethodExpression;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.ValueBinding;
+import javax.el.ValueExpression;
import javax.faces.convert.Converter;
import javax.faces.webapp.UIComponentTag;
import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
import org.apache.commons.beanutils.ConvertUtils;
import javax.servlet.jsp.JspException;
import ${converter.classname};
@@ -19,44 +24,8 @@
public class $tag.simpleClassName extends $tag.superclass
{
-// Fields
-#foreach( $prop in $converter.properties )
-#if( !$prop.existintag )
- /*
- * $prop.name
- * ${prop.xmlEncodedDescription}
- */
- private String _$prop.name = null;
+#tagPropertyMethods12($converter)
-#end
-#end
-// Setters
-#foreach( $prop in $converter.properties )
-#if( !$prop.existintag )
- /*
- * $prop.description
- * Setter for $prop.name
- * @param $prop.name - new value
- */
- public void ${prop.setterName}(String __${prop.name})
- {
- this._${prop.name} = __${prop.name};
- }
-
-#end
-#if( $prop.alias)
- /*
- * ${prop.xmlEncodedDescription}
- * Setter for alias of $prop.name as $prop.alias
- * @param $prop.name - new value
- */
- public void set${prop.upperFirstChar($prop.alias)}(String __${prop.alias})
- {
- this.${prop.setterName}(__${prop.alias});
- }
-#end
-#end
-
protected Converter createConverter() throws JspException
{
${converter.simpleClassName} converter = (${converter.simpleClassName}) FacesContext.getCurrentInstance().getApplication().createConverter("${converter.id}");
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/listener_tag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/listener_tag.vm 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/listener_tag.vm 2007-10-23 19:18:11 UTC (rev 3491)
@@ -49,6 +49,8 @@
private String type;
private String binding;
+ #tagPropertyMethods12($listener)
+
public int doStartTag() throws JspException {
UIComponentTag parentTag = UIComponentTag
@@ -175,47 +177,8 @@
public void release() {
type = null;
binding = null;
+ #tagPropertyRelease($listener)
}
-// Fields
-#foreach( $prop in $listener.properties )
-#if( !$prop.existintag )
- /*
- * $prop.name
- * ${prop.xmlEncodedDescription}
- */
- private String _$prop.name = null;
-#end
-#end
-// Setters
-#foreach( $prop in $listener.properties )
-#if( !$prop.existintag )
- /*
- * $prop.description
- * Setter for $prop.name
- * @param $prop.name - new value
- */
- public void ${prop.setterName}(String __${prop.name})
- {
- this._${prop.name} = __${prop.name};
- }
-
-#end
-#if( $prop.alias)
- /*
- * ${prop.xmlEncodedDescription}
- * Setter for alias of $prop.name as $prop.alias
- * @param $prop.name - new value
- */
- public void set${prop.upperFirstChar($prop.alias)}(String __${prop.alias})
- {
- this.${prop.setterName}(__${prop.alias});
- }
-#end
-#end
-
-
-
-
}
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm 2007-10-23 19:18:11 UTC (rev 3491)
@@ -18,43 +18,8 @@
public class $tag.simpleClassName extends $tag.superclass {
- // Fields
-#foreach( $prop in $validator.properties )
-#if( !$prop.existintag )
- /*
- * $prop.name
- * ${prop.xmlEncodedDescription}
- */
- private String _$prop.name = null;
-#end
-#end
-// Setters
-#foreach( $prop in $validator.properties )
-#if( !$prop.existintag )
- /*
- * $prop.description
- * Setter for $prop.name
- * @param $prop.name - new value
- */
- public void ${prop.setterName}( String __${prop.name} )
- {
- this._${prop.name} = __${prop.name};
- }
-
-#end
-#if( $prop.alias)
- /*
- * ${prop.xmlEncodedDescription}
- * Setter for alias of $prop.name as $prop.alias
- * @param $prop.name - new value
- */
- public void set${prop.upperFirstChar($prop.alias)}( String __${prop.alias} )
- {
- this.${prop.setterName}(__${prop.alias});
- }
-#end
-#end
+#tagPropertyMethods12($validator)
protected Validator createValidator() throws JspException
{
Deleted: trunk/cdk/generator/src/main/resources/VM_global_library.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/VM_global_library.vm 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/generator/src/main/resources/VM_global_library.vm 2007-10-23 19:18:11 UTC (rev 3491)
@@ -1,6 +0,0 @@
-#macro( quietnull $a)
-#if($a)$a#end
-#end
-
-
-
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2007-10-23 19:18:11 UTC (rev 3491)
@@ -40,6 +40,7 @@
import org.apache.velocity.exception.MethodInvocationException;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
+import org.codehaus.plexus.velocity.DefaultVelocityComponent;
import org.codehaus.plexus.velocity.VelocityComponent;
/**
@@ -178,6 +179,9 @@
}
library.setJsfVersion(version);
}
+
+ //velocity = new DefaultVelocityComponent();
+
getLog().debug("Generate files for a JSF "+library.getJsfVersion());
Renderkit[] renderkits = library.getRenderkits();
if (null != renderkits) {
@@ -264,16 +268,16 @@
ClassLoader classLoader = Thread.currentThread()
.getContextClassLoader();
try {
- List compileClasspathElements = project
+ List<?> compileClasspathElements = project
.getCompileClasspathElements();
String outputDirectory = project.getBuild().getOutputDirectory();
URL[] urls = new URL[compileClasspathElements.size() + 1];
int i = 0;
- urls[i++] = new File(outputDirectory).toURL();
- for (Iterator iter = compileClasspathElements.iterator(); iter
+ urls[i++] = new File(outputDirectory).toURI().toURL();
+ for (Iterator<?> iter = compileClasspathElements.iterator(); iter
.hasNext();) {
String element = (String) iter.next();
- urls[i++] = new File(element).toURL();
+ urls[i++] = new File(element).toURI().toURL();
}
if (useCCL) {
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java 2007-10-23 19:18:11 UTC (rev 3491)
@@ -81,6 +81,11 @@
*/
public void execute() throws MojoExecutionException, MojoFailureException {
getLog().debug("GenerateMojo components");
+
+ //FIXME: configure plexus component instead of programmatic property set.
+
+ // velocity.getEngine().setProperty("velocimacro.library", getTemplatesPath() + "/VM_global_library.vm");
+
if (null != executedProject) {
Taglib taglib = checkLibraryConfig();
ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
Added: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/velocity/ResourceLoader.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/velocity/ResourceLoader.java (rev 0)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/velocity/ResourceLoader.java 2007-10-23 19:18:11 UTC (rev 3491)
@@ -0,0 +1,58 @@
+/**
+ *
+ */
+package org.ajax4jsf.builder.velocity;
+
+import java.io.InputStream;
+
+import org.apache.commons.collections.ExtendedProperties;
+import org.apache.velocity.exception.ResourceNotFoundException;
+import org.apache.velocity.runtime.resource.Resource;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ResourceLoader extends
+ org.apache.velocity.runtime.resource.loader.ResourceLoader {
+
+ public void init( ExtendedProperties configuration)
+ {
+ rsvc.info("ClasspathResourceLoader : initialization starting.");
+
+ rsvc.info("ClasspathResourceLoader : initialization complete.");
+ }
+
+ public synchronized InputStream getResourceStream( String name )
+ throws ResourceNotFoundException
+ {
+ InputStream result = null;
+
+ if (name == null || name.length() == 0)
+ {
+ throw new ResourceNotFoundException ("No template name provided");
+ }
+
+ try
+ {
+ ClassLoader classLoader = getClass().getClassLoader();
+
+ result= classLoader.getResourceAsStream( name );
+ }
+ catch( Exception fnfe )
+ {
+ throw new ResourceNotFoundException( fnfe.getMessage() );
+ }
+
+ return result;
+ }
+
+ public boolean isSourceModified(Resource resource)
+ {
+ return false;
+ }
+
+ public long getLastModified(Resource resource)
+ {
+ return 0;
+ }}
Added: trunk/cdk/maven-cdk-plugin/src/main/resources/META-INF/plexus/components.xml
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/META-INF/plexus/components.xml (rev 0)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/META-INF/plexus/components.xml 2007-10-23 19:18:11 UTC (rev 3491)
@@ -0,0 +1,32 @@
+<component-set>
+ <components>
+ <component>
+ <role>org.codehaus.plexus.velocity.VelocityComponent</role>
+ <implementation>org.codehaus.plexus.velocity.DefaultVelocityComponent</implementation>
+ <configuration>
+ <properties>
+ <property>
+ <name>resource.loader</name>
+ <value>classpath,cdk</value>
+ </property>
+ <property>
+ <name>classpath.resource.loader.class</name>
+ <value>org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader</value>
+ </property>
+ <property>
+ <name>cdk.resource.loader.class</name>
+ <value>org.ajax4jsf.builder.velocity.ResourceLoader</value>
+ </property>
+ <property>
+ <name>velocimacro.messages.on</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>resource.manager.logwhenfound</name>
+ <value>false</value>
+ </property>
+ </properties>
+ </configuration>
+ </component>
+ </components>
+</component-set>
Modified: trunk/cdk/maven-cdk-plugin/src/main/resources/VM_global_library.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/VM_global_library.vm 2007-10-23 15:51:34 UTC (rev 3490)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/VM_global_library.vm 2007-10-23 19:18:11 UTC (rev 3491)
@@ -2,5 +2,54 @@
#if($a)$a#end
#end
+## generate getters and setters for Tag Properties
+#macro(tagPropertyMethods12 $source)
+ // Fields
+ #foreach( $prop in $source.properties )
+ #if( !$prop.existintag && !$prop.hidden)
+ #if($prop.classname == "javax.el.MethodExpression" || $prop.classname == "javax.faces.el.MethodBinding")
+ #set($type = "MethodExpression")
+ #else
+ #set($type = "ValueExpression")
+ #end
+
+ /*
+ * $prop.name
+ * ${prop.xmlEncodedDescription}
+ */
+ private $type _${prop.name};
+ /**
+ * $prop.description
+ * Setter for $prop.name
+ * @param $prop.name - new value
+ */
+ public void ${prop.setterName}( $type __${prop.name} ){
+ this._${prop.name} = __${prop.name};
+ }
+
+ #if( $prop.alias)
+ /**
+ * ${prop.xmlEncodedDescription}
+ * Setter for alias of $prop.name as $prop.alias
+ * @param $prop.name - new value
+ */
+ public void set${prop.upperFirstChar($prop.alias)}( $type __${prop.alias} ){
+ this.${prop.setterName}(__${prop.alias});
+ }
+ #end
+ #end
+ #end
+#end
+## release Tag Properties
+#macro(tagPropertyRelease $source)
+ #foreach( $prop in $source.properties )
+ #if( !$prop.existintag && !$prop.hidden)
+ this._${prop.name} = null;
+ #end
+ #end
+#end
+
+
+
17 years, 2 months
JBoss Rich Faces SVN: r3490 - trunk/ui/message/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-10-23 11:51:34 -0400 (Tue, 23 Oct 2007)
New Revision: 3490
Modified:
trunk/ui/message/src/main/java/org/richfaces/renderkit/html/HtmlRichMessagesRenderer.java
Log:
fix RF-1141 add check facesMsg != null in renderBody method
Modified: trunk/ui/message/src/main/java/org/richfaces/renderkit/html/HtmlRichMessagesRenderer.java
===================================================================
--- trunk/ui/message/src/main/java/org/richfaces/renderkit/html/HtmlRichMessagesRenderer.java 2007-10-23 15:18:41 UTC (rev 3489)
+++ trunk/ui/message/src/main/java/org/richfaces/renderkit/html/HtmlRichMessagesRenderer.java 2007-10-23 15:51:34 UTC (rev 3490)
@@ -272,7 +272,7 @@
public void renderBody(UIRichMessages uiMessages, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
- if(uiMessages.isPassed()){
+ if(uiMessages.isPassed() || facesMsg != null ){
if(isWroteTable){
writer.startElement(HTML.TR_ELEMENT, uiMessages);
17 years, 2 months
JBoss Rich Faces SVN: r3489 - trunk/cdk/generator/src/main/resources/META-INF/templates12.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-10-23 11:18:41 -0400 (Tue, 23 Oct 2007)
New Revision: 3489
Modified:
trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm
Log:
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm 2007-10-23 14:44:37 UTC (rev 3488)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm 2007-10-23 15:18:41 UTC (rev 3489)
@@ -1,96 +1,14 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<taglib xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_${taglib.jspversion.r...'.', '_')}.xsd"
- version="${taglib.jspversion}">
- <tlib-version>${taglib.tlibversion}</tlib-version>
-## <jsp-version>${taglib.jspversion}</jsp-version>
-#if(${taglib.shortname})
- <short-name>${taglib.shortname}</short-name>
-#end
- <uri>${taglib.uri}</uri>
-#if(${taglib.description})
- <description>${taglib.description}</description>
-#end
-${taglib.includeContent}
-
-#foreach( $component in ${components})
- #if($component.tag)
- <tag>
- #if(${component.tag.description})
- <description>${component.tag.xmlEncodedDescription}</description>
- #else
- <description>${component.xmlEncodedDescription}</description>
- #end
- #if(${component.tag.displayname})
- <display-name>${component.tag.xmlEncodedDisplayname}</display-name>
- #elseif(${component.displayname})
- <display-name>${component.xmlEncodedDisplayname}</display-name>
- #end
- <name>${component.tag.name}</name>
- <tag-class>${component.tag.classname}</tag-class>
- <body-content>${component.tag.bodyContent}</body-content>
- #foreach( $prop in ${component.properties} )
+##Create tag attributes for object's properties
+#macro(tagAttributes $source)
+ #foreach( $prop in ${source.properties} )
#if( !${prop.hidden} && !${prop.disabled} )
<attribute>
- <description>${prop.xmlEncodedDescription}</description>
<name>${prop.name}</name>
#if(${prop.required})
<required>true</required>
#end
- #if(${prop.el})
- #if( !$prop.isInstanceof("javax.faces.el.MethodBinding") && !$prop.isInstanceof("javax.el.MethodExpression") )
- <deferred-value>
- <type>${prop.classname}</type>
- </deferred-value>
- #else
- <deferred-method>
- <method-signature>${prop.returntype} ${prop.name}(${prop.methodargs})</method-signature>
- </deferred-method>
- #end
- #else
- <rtexprvalue>false</rtexprvalue>
- #end
- </attribute>
- #if( $prop.alias )
- <attribute>
- <name>${prop.alias}</name>
<rtexprvalue>false</rtexprvalue>
- <description>Alias for ${prop.name} : ${prop.xmlEncodedDescription}</description>
- </attribute>
- #end
- #end
- #end
-</tag>
-#end
-#end
-
-#*
-#foreach( $validator in ${validators})
- #if($validator.tag)
- <tag>
- <name>${validator.tag.name}</name>
- <tag-class>${validator.tag.classname}</tag-class>
- <body-content>${validator.tag.bodyContent}</body-content>
- #if(${validator.tag.displayname})
- <display-name>${validator.tag.xmlEncodedDisplayname}</display-name>
- #elseif(${validator.displayname})
- <display-name>${validator.xmlEncodedDisplayname}</display-name>
- #end
- #if(${validator.tag.description})
- <description>${validator.tag.xmlEncodedDescription}</description>
- #elseif(${validator.xmlEncodedDescription})
- <description>${validator.xmlEncodedDescription}</description>
- #end
- #foreach( $prop in ${validator.properties} )
- #if( !${prop.hidden} && !${prop.disabled} )
- <attribute>
- <name>${prop.name}</name>
- #if(${prop.required})
- <required>true</required>
- #end
- <rtexprvalue>false</rtexprvalue>
<description>${prop.xmlEncodedDescription}</description>
</attribute>
#if( $prop.alias )
@@ -102,87 +20,59 @@
#end
#end
#end
-</tag>
#end
-#end
-#foreach( $converter in ${converters})
- #if($converter.tag)
- <tag>
- <name>${converter.tag.name}</name>
- <tag-class>${converter.tag.classname}</tag-class>
- <body-content>${converter.tag.bodyContent}</body-content>
- #if(${converter.tag.displayname})
- <display-name>${converter.tag.xmlEncodedDisplayname}</display-name>
- #elseif(${converter.displayname})
- <display-name>${converter.xmlEncodedDisplayname}</display-name>
- #end
- #if(${converter.tag.description})
- <description>${converter.tag.xmlEncodedDescription}</description>
- #elseif(${converter.xmlEncodedDescription})
- <description>${converter.xmlEncodedDescription}</description>
- #end
- #foreach( $prop in ${converter.properties} )
- #if( !${prop.hidden} && !${prop.disabled} )
- <attribute>
- <name>${prop.name}</name>
- #if(${prop.required})
- <required>true</required>
- #end
- <rtexprvalue>false</rtexprvalue>
- <description>${prop.xmlEncodedDescription}</description>
- </attribute>
- #if( $prop.alias )
- <attribute>
- <name>${prop.alias}</name>
- <rtexprvalue>false</rtexprvalue>
- <description>Alias for ${prop.name} : ${prop.xmlEncodedDescription}</description>
- </attribute>
+##Create tag for dedicated object in config
+#macro(tag $source)
+ #if($source.tag)
+ <tag>
+ #if(${source.tag.description})
+ <description>${source.tag.xmlEncodedDescription}</description>
+ #else
+ <description>${source.xmlEncodedDescription}</description>
+ #end
+ #if(${source.tag.displayname})
+ <display-name>${source.tag.xmlEncodedDisplayname}</display-name>
+ #elseif(${source.displayname})
+ <display-name>${source.xmlEncodedDisplayname}</display-name>
+ #end
+ <name>${source.tag.name}</name>
+ <tag-class>${source.tag.classname}</tag-class>
+ <body-content>${source.tag.bodyContent}</body-content>
+
+ #tagAttributes($source)
+
+ </tag>
#end
- #end
- #end
-</tag>
+
#end
-#end
-#foreach( $listener in ${listeners})
- #if($listener.tag)
- <tag>
- <name>${listener.tag.name}</name>
- <tag-class>${listener.tag.classname}</tag-class>
- <body-content>${listener.tag.bodyContent}</body-content>
- #if(${listener.tag.displayname})
- <display-name>${listener.tag.xmlEncodedDisplayname}</display-name>
- #elseif(${listener.displayname})
- <display-name>${listener.xmlEncodedDisplayname}</display-name>
- #end
- #if(${listener.tag.description})
- <description>${listener.tag.xmlEncodedDescription}</description>
- #elseif(${listener.xmlEncodedDescription})
- <description>${listener.xmlEncodedDescription}</description>
- #end
- #foreach( $prop in ${listener.properties} )
- #if( !${prop.hidden} && !${prop.disabled} )
- <attribute>
- <name>${prop.name}</name>
- #if(${prop.required})
- <required>true</required>
- #end
- <rtexprvalue>false</rtexprvalue>
- <description>${prop.xmlEncodedDescription}</description>
- </attribute>
- #if( $prop.alias )
- <attribute>
- <name>${prop.alias}</name>
- <rtexprvalue>false</rtexprvalue>
- <description>Alias for ${prop.name} : ${prop.xmlEncodedDescription}</description>
- </attribute>
+##Generate tags for each category of config beans
+#macro(generateBunchOfTags $category)
+ #foreach($item in $category)
+ #tag($item)
#end
- #end
- #end
-</tag>
#end
+
+<taglib xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_${taglib.jspversion.r...'.', '_')}.xsd"
+ version="${taglib.jspversion}">
+ <tlib-version>${taglib.tlibversion}</tlib-version>
+## <jsp-version>${taglib.jspversion}</jsp-version>
+#if(${taglib.shortname})
+ <short-name>${taglib.shortname}</short-name>
#end
-*#
+ <uri>${taglib.uri}</uri>
+#if(${taglib.description})
+ <description>${taglib.description}</description>
+#end
+${taglib.includeContent}
+
+#generateBunchOfTags(${components})
+#generateBunchOfTags(${validators})
+#generateBunchOfTags(${converters})
+#generateBunchOfTags(${listeners})
+
</taglib>
17 years, 2 months
JBoss Rich Faces SVN: r3488 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-10-23 10:44:37 -0400 (Tue, 23 Oct 2007)
New Revision: 3488
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
http://jira.jboss.com/jira/browse/RF-1042 - added new section
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2007-10-23 12:13:55 UTC (rev 3487)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2007-10-23 14:44:37 UTC (rev 3488)
@@ -164,7 +164,7 @@
</emphasis> tag allows you to add Ajax functionality to standard JSF components and send
Ajax request onto a chosen JavaScript event: "onkeyup",
"onmouseover", etc. </para>
- <para>Most important attributes of components that provide Ajax request calling features are:</para>
+ <!--para>Most important attributes of components that provide Ajax request calling features are:</para>
<itemizedlist>
<listitem>
<emphasis>
@@ -211,8 +211,143 @@
<emphasis>
<property>"ignoreDupResponses"</property>
</emphasis> is used to abort unfinished request on new event. </listitem>
- </itemizedlist>
+ </itemizedlist-->
</section>
+
+ <section id="AjaxRequestOptimization">
+ <?dbhtml filename="AjaxRequestOptimization"?>
+ <title>Ajax Request Optimization</title>
+ <section id="Re-Rendering">
+ <?dbhtml filename="Re-Rendering"?>
+ <title>Re-Rendering</title>
+ <para>Ajax attributes are common for Ajax components such as <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis>, <emphasis role="bold">
+ <property><a4j:commandButton></property>
+ </emphasis>, <emphasis role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis>, <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis>, <emphasis role="bold">
+ <property><a4j:push></property>
+ </emphasis> and so on. Also, most RichFaces components with built-in Ajax support have
+ these attributes for a similar purpose. Ajax components attributes help RichFaces to
+ expose its features. Most of the attributes have default values. Thus, you can start
+ working with RichFaces without knowing the usage of these attribute. However, their usage
+ allows to tune the required Ajax behavior very smoothly.</para>
+
+ <para><emphasis>
+ <property>"reRender"</property>
+ </emphasis> is a key attribute. The attribute allows to point to area(s) on a page that
+ should be updated as a response on Ajax interaction. The value of the <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute is an id of the JSF component or an id list. </para>
+ <para>A simple example is placed below:</para>
+
+ <programlisting role="XML"><![CDATA[...
+ <a4j:commandButton value="update" reRender="infoBlock"/>
+ ...
+ <h:panelGrid id="infoBlock">
+ ...
+ </h:panelGrid>
+...
+]]></programlisting>
+
+ <para>The value of <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute of the <emphasis role="bold">
+ <property><a4j:commandButton></property>
+ </emphasis> tag defines which part(s) of your page is (are) to be updated. In this case,
+ the only part of the page to update is the <emphasis role="bold">
+ <property><h:panelGrid></property>
+ </emphasis> tag because its ID value matches to the value of <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute. As you see, it's not difficult to update multiple elements
+ on the page, only list their IDs as the value of <emphasis>
+ <property>"reRender"</property>
+ </emphasis>.</para>
+
+ <para><emphasis>
+ <property>"reRender"</property>
+ </emphasis> uses <ulink
+ url="http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/c..."
+ >UIComponent.findComponent() algorithm</ulink> (with some additional exceptions) to find
+ the component in the component tree. As can you see, the algorithm presumes several steps.
+ Each other step is used if the previous step is not successful. Therefore, you can define
+ how fast the component is found mentioning it more precisely. The following example shows
+ the difference in approaches (both buttons will work successfully):</para>
+
+ <programlisting role="XML"><![CDATA[...
+ <h:form id="form1">
+ ...
+ <a4j: commandButton value="Usual Way" reRender="infoBlock, infoBlock2" />
+ <a4j:commandButton value="Shortcut" reRender=":infoBlockl,:sv:infoBlock2" />
+ ...
+ </h:form>
+ <h:panelGrid id="infoBlock">
+ ...
+ </h:panelGrid>
+ ...
+ <f:subview id="sv">
+ <h:panelGrid id="infoBlock2">
+ ...
+ </h:panelGrid>
+ ...
+ </f:subview>
+...
+]]></programlisting>
+
+ <para>It's also possible to use JSF EL expression as a value of the reRender
+ attribute. It might be a property of types Set, Collection, Array or simple String. The EL
+ for reRender is resolved right before the Render Response phase. Hence, you can calculate
+ what should be re-rendered on any previous phase during the Ajax request processing.</para>
+
+ <para>Most common problem with using reRender is pointing it to the component that has a <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute. Note, that JSF does not mark the place in the browser DOM where the
+ outcome of the component should be placed in case the <emphasis>
+ <property>"rendered"</property>
+ </emphasis> condition returns false. Therefore, after the component becomes rendered
+ during the Ajax request, RichFaces delivers the rendered code to the client, but does not
+ update a page, because the place for update is unknown. You need to point to one of the
+ parent components that has no <emphasis>
+ <property>"rendered"</property>
+ </emphasis> attribute. As an alternative, you can wrap the component with <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> layout=<property>"none"</property>.</para>
+
+ <para><emphasis>
+ <property>"ajaxRendered" </property>
+ </emphasis> attribute of the <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis> set to <property>"true"</property> allows to define the area
+ of the page that will be re-rendered even if it is not pointed in the reRender attribute
+ explicitly. It might be useful if you have an area on a page that should be updated as a
+ response on any Ajax request. For example, the following code allows to output error
+ messages regardless of what Ajax request causes the Validation phase failed. </para>
+ <programlisting role="XML"><![CDATA[...
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages />
+ </a4j:outputPanel>
+...
+]]></programlisting>
+
+ <para><emphasis>
+ <property>"limitToList"</property>
+ </emphasis> attribute allows to dismiss the behavior of the <emphasis role="bold">
+ <property><a4j:outputPanel></property>
+ </emphasis>
+ <emphasis>
+ <property>"ajaxRendered" </property>
+ </emphasis> attribute. limitToList = <property>"false"</property> means
+ to update only the area(s) that mentioned in the
+ <emphasis/>"reRender"<property/> attribute explicitly. All output panels
+ with ajaxRendered=<property>"true"</property> will be ignored.</para>
+ </section>
+
+
+ </section>
+
<section id="DecideWhatToSend">
<?dbhtml filename="DecideWhatToSend.html"?>
<title>Decide What to Send</title>
@@ -234,6 +369,8 @@
"false" ("false" is default value). Otherwise, your Ajax
updates are limited to elements of the active region. </para>
</section>
+
+
<section id="DecideWhatToChange">
<?dbhtml filename="DecideWhatToChange.html"?>
<title>Decide What to Change</title>
@@ -292,7 +429,8 @@
<note>
<title>Note:</title>Fast Filter is deprecated and available only for backward compatibility
with previous RichFaces versions. Fast Filter usage isn't recomended, because there
- is another way to use its functionality by means of <link linkend="Neko">Neko filter type</link>.</note>
+ is another way to use its functionality by means of <link linkend="Neko">Neko filter
+ type</link>.</note>
<para>In RichFaces 3.1 filter configuration becomes more flexible. It's possible to
configure different filters for different sets of pages for the same application.</para>
@@ -305,9 +443,9 @@
</listitem>
</itemizedlist>
- <para>"TIDY" filter type based on the Tidy parser. This filter is recommended for applications with
- complicated or non-standard markup when all necessary code corrections are made by the filter
- when a response comes from the server.</para>
+ <para>"TIDY" filter type based on the Tidy parser. This filter is recommended
+ for applications with complicated or non-standard markup when all necessary code corrections
+ are made by the filter when a response comes from the server.</para>
<itemizedlist>
<listitem>
@@ -315,11 +453,11 @@
</listitem>
</itemizedlist>
- <para>"NEKO" filter type corresponds to the former "Fast Filter" and it's
- based on the Neko parser. In case of using this filter code isn't strictly verified.
- Use this one if you are sure that your application markup is really strict for this filter.
- Otherwise it could cause lot's of errors and corrupt a layout as a result. This
- filter considerably accelerates all Ajax requests processing.</para>
+ <para>"NEKO" filter type corresponds to the former "Fast
+ Filter" and it's based on the Neko parser. In case of using this filter code
+ isn't strictly verified. Use this one if you are sure that your application markup is
+ really strict for this filter. Otherwise it could cause lot's of errors and corrupt a
+ layout as a result. This filter considerably accelerates all Ajax requests processing.</para>
<itemizedlist>
<listitem>
@@ -368,9 +506,9 @@
<para>The example shows that ORDER parameter defines the order in which particular filter types
are used for pages code correction. </para>
- <para> First of all "NONE" type is specified for the filter. Then two different
- sets of pages are defined for which two filter types (NONE and NEKO) are used correspondingly.
- If a page relates to the first set that is defined in the following way: </para>
+ <para> First of all "NONE" type is specified for the filter. Then two
+ different sets of pages are defined for which two filter types (NONE and NEKO) are used
+ correspondingly. If a page relates to the first set that is defined in the following way: </para>
<programlisting role="XML"><![CDATA[<param-value>/pages/performance\.xhtml,/pages/default.*\.xhtml</param-value>,
]]></programlisting>
@@ -383,9 +521,9 @@
<programlisting role="XML"><![CDATA[<param-value>/pages/repeat\.xhtml</param-value>,
]]></programlisting>
- <para>then "NEKO" filter type is used for correction. If it's not related to the second set,
- "TIDY" type is set for the filter ("TIDY" filter type is used for code
- correction). </para>
+ <para>then "NEKO" filter type is used for correction. If it's not
+ related to the second set, "TIDY" type is set for the filter
+ ("TIDY" filter type is used for code correction). </para>
</section>
17 years, 2 months
JBoss Rich Faces SVN: r3487 - trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-10-23 08:13:55 -0400 (Tue, 23 Oct 2007)
New Revision: 3487
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
Log:
http://jira.jboss.com/jira/browse/RF-1152
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2007-10-23 11:56:58 UTC (rev 3486)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2007-10-23 12:13:55 UTC (rev 3487)
@@ -47,7 +47,7 @@
.dr-mpnl-pnl-a {
position: absolute;
- left: -32000px;
+ left: 32000px;
}
</f:verbatim>
17 years, 2 months