[richfaces-svn-commits] JBoss Rich Faces SVN: r2227 - in trunk/ui/calendar/src/main: templates/org/richfaces and 1 other directory.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Mon Aug 13 12:14:23 EDT 2007
Author: akushunin
Date: 2007-08-13 12:14:23 -0400 (Mon, 13 Aug 2007)
New Revision: 2227
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
OptionalHeader and Footer added
Modified: trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-08-13 16:12:46 UTC (rev 2226)
+++ trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-08-13 16:14:23 UTC (rev 2227)
@@ -32,8 +32,6 @@
import java.util.TimeZone;
import javax.faces.application.FacesMessage;
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
@@ -59,7 +57,7 @@
* JSF component class
*
*/
-public abstract class UICalendar extends UIInput implements TemplateComponent, NamingContainer {
+public abstract class UICalendar extends UIInput {
public static final String COMPONENT_TYPE = "org.richfaces.Calendar";
@@ -143,6 +141,14 @@
public abstract void setBoundaryDatesMode(String boundaryDatesMode);
+ public abstract String getOptionalHeader();
+
+ public abstract void setOptionalHeader(String optionalHeader);
+
+ public abstract String getOptionalFooter();
+
+ public abstract void setOptionalFooter(String optionalFooter);
+
//TODO onclick add users onclick
// currentDate processing -------------------------------------------------
@@ -281,31 +287,6 @@
}
- private transient boolean inTemplateEncode = false;
-
- public void startTemplateEncode() {
- if (getChildCount() > 0) {
- Iterator children = getChildren().iterator();
- while (children.hasNext()) {
- UIComponent child = (UIComponent) children.next();
- child.setId(child.getId());
- }
- }
- inTemplateEncode = true;
- }
-
- public void endTemplateEncode() {
- inTemplateEncode = false;
- }
-
- public String getClientId(FacesContext context) {
- if (inTemplateEncode) {
- return TemplateComponent.TEMPLATE_CLIENT_ID;
- } else {
- return super.getClientId(context);
- }
- }
-
public void broadcast(FacesEvent event) throws AbortProcessingException {
// TODO Auto-generated method stub
if (event instanceof AjaxEvent) {
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-08-13 16:12:46 UTC (rev 2226)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-08-13 16:14:23 UTC (rev 2227)
@@ -37,8 +37,31 @@
<f:call name="writeSymbols" />,
firstWeekDay: #{this:getFirstWeekDay(context, component)},
minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)},
- headerOptionalMarkup: [new E('b',{},[new T('User defined header')])],
- footerOptionalMarkup: [new E('b',{},[new T('User defined footer')])],
+
+ <jsp:scriptlet> /*<![CDATA[*/
+ if (component.getFacet("optionalHeader")!= null&& component.getFacet("optionalHeader").isRendered()){
+ /*]]>*/ </jsp:scriptlet>
+ headerOptionalMarkup: [new E('b',{},
+ <jsp:scriptlet> /*<![CDATA[*/
+ writeMarkupScriptBody(context, component.getFacet("optionalHeader"), false);
+ /*]]>*/ </jsp:scriptlet>
+ )],
+ <jsp:scriptlet> /*<![CDATA[*/
+ }
+ /*]]>*/ </jsp:scriptlet>
+
+ <jsp:scriptlet> /*<![CDATA[*/
+ if (component.getFacet("optionalFooter")!= null&& component.getFacet("optionalFooter").isRendered()){
+ /*]]>*/ </jsp:scriptlet>
+ footerOptionalMarkup: [new E('b',{},
+ <jsp:scriptlet> /*<![CDATA[*/
+ writeMarkupScriptBody(context, component.getFacet("optionalFooter"), false);
+ /*]]>*/ </jsp:scriptlet>
+ )],
+ <jsp:scriptlet> /*<![CDATA[*/
+ }
+ /*]]>*/ </jsp:scriptlet>
+
<jsp:scriptlet>/*<![CDATA[*/
if (component.getChildCount() != 0) {
/*]]>*/</jsp:scriptlet>
@@ -47,10 +70,12 @@
writeMarkupScriptBody(context, component, true);
}
/*]]>*/</jsp:scriptlet>
+
<f:call name="writeFacetMarkupScriptBody"><f:parameter value="weekDay" /></f:call>
<f:call name="writeFacetMarkupScriptBody"><f:parameter value="weekNumber" /></f:call>
<f:call name="writeFacetMarkupScriptBody"><f:parameter value="header" /></f:call>
<f:call name="writeFacetMarkupScriptBody"><f:parameter value="footer" /></f:call>
+
}).load(
<jsp:scriptlet>/*<![CDATA[*/
writePreloadBody(context, component);
More information about the richfaces-svn-commits
mailing list