JBoss Rich Faces SVN: r1037 - in trunk/sandbox/panelmenu/src/main: java/org/richfaces/component/panelmenu and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-06-06 07:28:57 -0400 (Wed, 06 Jun 2007)
New Revision: 1037
Added:
trunk/sandbox/panelmenu/src/main/java/org/richfaces/conveter/
trunk/sandbox/panelmenu/src/main/java/org/richfaces/conveter/UIPanelMenuGroupValueConverter.java
Modified:
trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java
trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuItem.java
trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java
trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuItemRenderer.java
trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java
trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java
trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
Log:
code review bugfix
Modified: trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java
===================================================================
--- trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java 2007-06-06 09:12:49 UTC (rev 1036)
+++ trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuGroup.java 2007-06-06 11:28:57 UTC (rev 1037)
@@ -22,6 +22,7 @@
package org.richfaces.component.panelmenu;
import javax.faces.component.ActionSource;
+import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.el.MethodBinding;
@@ -29,7 +30,10 @@
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
import javax.faces.event.FacesEvent;
+import javax.faces.event.PhaseId;
+import org.richfaces.conveter.UIPanelMenuGroupValueConverter;
+
public abstract class UIPanelMenuGroup extends UIInput implements ActionSource{
public static final String COMPONENT_TYPE = "org.richfaces.panelMenuGroup";
@@ -45,17 +49,14 @@
public abstract String getIconExpanded();
public abstract void setIconExpanded(String expanded);
- public abstract boolean isExpanded();
- public abstract void setExpanded(boolean expanded);
-
public abstract String getIconCollapsed();
public abstract void setIconCollapsed(String iconCollapsed);
public abstract String getIconDisabled();
public abstract void setIconDisabled(String iconDisabled);
public abstract boolean isDisabled();
public abstract void setDisabled(boolean disabled);
- public abstract Object getValue();
- public abstract void setValue(Object value);
+// public abstract Object getValue();
+// public abstract void setValue(Object value);
public abstract String getTarget();
public abstract void setTarget(String target);
public abstract String getHoverClass();
@@ -79,24 +80,39 @@
public abstract String getLabel();
public abstract void setLabel(String label);
+ public abstract boolean isExpanded();
+ public abstract void setExpanded(boolean expanded);
+
+ public UIPanelMenuGroup(){
+ setConverter(new UIPanelMenuGroupValueConverter());
+ }
+
+ public boolean isTopLevel(){
+ UIComponent parent = getParent();
+ while( !(parent instanceof UIPanelMenu) && !(parent instanceof UIPanelMenuGroup)) {
+ parent = parent.getParent();
+ }
+ if(parent instanceof UIPanelMenu){
+ return true;
+ } else {
+ return false;
+ }
+ }
+
public void addActionListener(ActionListener listener) {
- // TODO Auto-generated method stub
addFacesListener(listener);
}
public MethodBinding getAction() {
- // TODO Auto-generated method stub
return action;
}
public MethodBinding getActionListener() {
- // TODO Auto-generated method stub
return (this.actionListener);
}
public ActionListener[] getActionListeners() {
- // TODO Auto-generated method stub
ActionListener al[] = (ActionListener [])
getFacesListeners(ActionListener.class);
return (al);
@@ -104,20 +120,17 @@
}
public void removeActionListener(ActionListener listener) {
- // TODO Auto-generated method stub
removeFacesListener(listener);
}
public void setAction(MethodBinding action) {
- // TODO Auto-generated method stub
this.action = action;
}
-
public void setActionListener(MethodBinding actionListener) {
- // TODO Auto-generated method stub
this.actionListener = actionListener;
}
+
public void restoreState(FacesContext context, Object state) {
Object values[] = (Object[]) state;
super.restoreState(context, values[0]);
@@ -126,7 +139,6 @@
values[2]);
}
-
public Object saveState(FacesContext context) {
Object values[] = new Object[3];
values[0] = super.saveState(context);
@@ -134,8 +146,19 @@
values[2] = saveAttachedState(context, actionListener);
return values;
}
+
+ public void queueEvent(FacesEvent event) {
+ if(event instanceof ActionEvent){
+ if (isImmediate()) {
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ } else {
+ event.setPhaseId(PhaseId.INVOKE_APPLICATION);
+ }
+ }
+ super.queueEvent(event);
+ }
+
public void broadcast(FacesEvent event) throws AbortProcessingException {
- // TODO Auto-generated method stub
super.broadcast(event);
if(event instanceof ActionEvent){
FacesContext context = getFacesContext();
Modified: trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuItem.java
===================================================================
--- trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuItem.java 2007-06-06 09:12:49 UTC (rev 1036)
+++ trunk/sandbox/panelmenu/src/main/java/org/richfaces/component/panelmenu/UIPanelMenuItem.java 2007-06-06 11:28:57 UTC (rev 1037)
@@ -22,6 +22,7 @@
package org.richfaces.component.panelmenu;
import javax.faces.component.UICommand;
+import javax.faces.component.UIComponent;
public abstract class UIPanelMenuItem extends UICommand {
@@ -54,5 +55,18 @@
public abstract String getIconStyle();
public abstract void setIconStyle(String iconStyle);
public abstract String getTarget();
- public abstract void setTarget(String target);
+ public abstract void setTarget(String target);
+
+ public boolean isTopLevel(){
+ UIComponent parent = getParent();
+ while( !(parent instanceof UIPanelMenu) && !(parent instanceof UIPanelMenuGroup)) {
+ parent = parent.getParent();
+ }
+ if(parent instanceof UIPanelMenu){
+ return true;
+ } else {
+ return false;
+ }
+ }
+
}
Added: trunk/sandbox/panelmenu/src/main/java/org/richfaces/conveter/UIPanelMenuGroupValueConverter.java
===================================================================
--- trunk/sandbox/panelmenu/src/main/java/org/richfaces/conveter/UIPanelMenuGroupValueConverter.java (rev 0)
+++ trunk/sandbox/panelmenu/src/main/java/org/richfaces/conveter/UIPanelMenuGroupValueConverter.java 2007-06-06 11:28:57 UTC (rev 1037)
@@ -0,0 +1,19 @@
+package org.richfaces.conveter;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+public class UIPanelMenuGroupValueConverter implements Converter {
+
+ public Object getAsObject(FacesContext context, UIComponent component,
+ String value) {
+ return value != null ? new Boolean(value) : null;
+ }
+
+ public String getAsString(FacesContext context, UIComponent component,
+ Object value) {
+ return value.toString();
+ }
+
+}
Property changes on: trunk/sandbox/panelmenu/src/main/java/org/richfaces/conveter/UIPanelMenuGroupValueConverter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java
===================================================================
--- trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java 2007-06-06 09:12:49 UTC (rev 1036)
+++ trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuGroupRenderer.java 2007-06-06 11:28:57 UTC (rev 1037)
@@ -22,24 +22,26 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.util.Iterator;
import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.convert.ConverterException;
import javax.faces.event.ActionEvent;
+import javax.faces.event.ValueChangeEvent;
import org.ajax4jsf.framework.ajax.AjaxEvent;
-import org.ajax4jsf.framework.util.style.CSSFormat;
import org.richfaces.component.UISwitchablePanel;
import org.richfaces.component.panelmenu.UIPanelMenu;
import org.richfaces.component.panelmenu.UIPanelMenuGroup;
import org.richfaces.event.SwitchablePanelSwitchEvent;
public class PanelMenuGroupRenderer extends PanelMenuRendererBase {
+
protected Class getComponentClass() {
- //TODO by nick - dima - add concrete component class
- return UIComponent.class;
+ return UIPanelMenuGroup.class;
}
protected void doDecode(FacesContext context, UIComponent component) {
@@ -49,16 +51,20 @@
if(requestMap.containsKey("panelMenuState"+clientId)){
Object property = requestMap.get("panelMenuState"+clientId);
-
if (property.equals("opened")) {
- group.setExpanded(true);
+ group.setSubmittedValue("true");
+ //group.setSubmittedValue(new Boolean(true));
+ //group.setExpanded(true);
} else if (property.equals("closed")) {
- ((UIPanelMenuGroup)component).setExpanded(false);
+ group.setSubmittedValue("false");
+ //group.setSubmittedValue(new Boolean(false));
+ //group.setExpanded(false);
}
}
if(isSubmitted(context, component)){
- new SwitchablePanelSwitchEvent(findMenu(component), null, component).queue();
+ //new SwitchablePanelSwitchEvent(findMenu(component), null, component).queue();
+ //new ValueChangeEvent(group, group.getValue(), group.getSubmittedValue()).queue();
new ActionEvent(component).queue();
if (UISwitchablePanel.AJAX_METHOD.equals(getItemMode(component))) {
new AjaxEvent(component).queue();
@@ -73,10 +79,7 @@
String align = "";
UIPanelMenu panelMenu = findMenu(component);
- //TODO by nick - dima - add isTopLevel() method to group component
- //TODO by nick - dima - btw, components can be enclosed in other components such as ui:repeat, so panelManu will be
- // parent of parent of ...
- boolean isTopLevel = component.getParent() instanceof UIPanelMenu;
+ boolean isTopLevel = ((UIPanelMenuGroup)component).isTopLevel();
if (isTopLevel){
align = panelMenu.getIconItemTopPosition();
@@ -99,19 +102,16 @@
if(panelMenu == null){
return;
}
-
- //TODO by nick - dima - add isTopLevel() method to group component
- boolean isTopLevel = component.getParent() instanceof UIPanelMenu;
+ UIPanelMenuGroup panelMenuGroup = (UIPanelMenuGroup)component;
+ boolean isTopLevel = panelMenuGroup.isTopLevel();
//TODO by nick - dima - component value should be used here
- boolean isOpened = isOpened(context,component).equals("opened") ? true : false;
+ boolean isOpened = isOpened(context,component);
String source = "";
String iconNode = "";
- //TODO by nick - dima - access through attributes map is usually slower as done through reflection. Should be replaced with abstract
- // getter invocation
- Object iconCollapsed = component.getAttributes().get("iconCollapsed");
- Object iconExpanded = component.getAttributes().get("iconExpanded");
+ Object iconCollapsed = panelMenuGroup.getIconCollapsed();
+ Object iconExpanded = panelMenuGroup.getIconExpanded();
String icon = (isOpened ? iconExpanded : iconCollapsed).toString();
if (icon.equals("")){
source = getIconByType("custom", isTopLevel,context, component);
@@ -124,14 +124,15 @@
}
int h = 16; //width(context);
- StringBuffer imageBuffer = new StringBuffer();
- //TODO by nick - dima - use writer.startElement()/writer.endElement()/getUtils().writeAttribute() calls to output image
- imageBuffer.append("<img src=\"" + source + "\" ");
- imageBuffer.append("alt=\"\" vspace=\"0\" hspace=\"0\" ");
- imageBuffer.append("style=\"display:block;\" ");
- imageBuffer.append("width=\"" + String.valueOf(h) + "\" ");
- imageBuffer.append("height=\"" + String.valueOf(h) + "\" />");
- writer.write(imageBuffer.toString());
+ writer.startElement("img", component);
+ writer.writeAttribute("src", source, null);
+ writer.writeAttribute("alt", "", null);
+ writer.writeAttribute("vspace", "0", null);
+ writer.writeAttribute("hspace", "0", null);
+ writer.writeAttribute("style", "display:block; ", null);
+ writer.writeAttribute("width", String.valueOf(h), null);
+ writer.writeAttribute("height", String.valueOf(h), null);
+ writer.endElement("img");
}
public String getFullStyleClass(FacesContext context, UIComponent component) {
@@ -166,29 +167,28 @@
return styleBuffer.toString();
}
- public String getHideStyle(FacesContext context, UIComponent component) {
- // TODO Auto-generated method stub
- if (!(component.getParent() instanceof UIPanelMenu)) {
- CSSFormat format = new CSSFormat();
- format.add("display", "none");
- if(component.getParent() instanceof UIPanelMenuGroup) {
- UIPanelMenuGroup parent = (UIPanelMenuGroup)component.getParent();
- //TODO by nick - dima - take opened value from component itself
- PanelMenuGroupRenderer renderer = (PanelMenuGroupRenderer) context.getRenderKit().getRenderer(parent.getFamily(), parent.getRendererType());
- try {
- if ( renderer.isOpened(context, parent).equals("opened") ){
- return "";
- } else
- return format.toString();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } else return format.toString();
- }
- return "";
-
- }
+// public String getHideStyle(FacesContext context, UIComponent component) {
+// if (!(component.getParent() instanceof UIPanelMenu)) {
+// CSSFormat format = new CSSFormat();
+// format.add("display", "none");
+// if(component.getParent() instanceof UIPanelMenuGroup) {
+// UIPanelMenuGroup parent = (UIPanelMenuGroup)component.getParent();
+// //TODO by nick - dima - take opened value from component itself
+// PanelMenuGroupRenderer renderer = (PanelMenuGroupRenderer) context.getRenderKit().getRenderer(parent.getFamily(), parent.getRendererType());
+// try {
+// if ( renderer.isOpened(context, parent).equals("opened") ){
+// return "";
+// } else
+// return format.toString();
+// } catch (IOException e) {
+// // TODO Auto-generated catch block
+// e.printStackTrace();
+// }
+// } else return format.toString();
+// }
+// return "";
+//
+// }
public void insertLabel(FacesContext context, UIComponent component) throws IOException {
Object label = component.getAttributes().get("label");
@@ -196,5 +196,59 @@
context.getResponseWriter().write(label.toString());
}
}
+
+ public Object getConvertedValue(FacesContext context,
+ UIComponent component, Object submittedValue)
+ throws ConverterException {
+
+ UIPanelMenuGroup group = (UIPanelMenuGroup)component;
+ if(group.getConverter() != null){
+ return group.getConverter().getAsObject(context, component, (String)submittedValue);
+ } else {
+ return submittedValue;
+ }
+
+ }
+ public boolean isOpened(FacesContext context, UIComponent component)throws IOException {
+ //String clientId = component.getClientId(context);
+ ///Map requestParameterMap = context.getExternalContext().getRequestParameterMap();
+
+ UIPanelMenuGroup group = (UIPanelMenuGroup)component;
+
+ Boolean value = (Boolean)group.getValue();
+ if (value != null) {
+ return value.booleanValue();
+ } else {
+ boolean isParentDisabled = isParentDisabled(component);
+ if(component instanceof UIPanelMenuGroup){
+ if( ((UIPanelMenuGroup)component).isExpanded() && !((UIPanelMenuGroup)component).isDisabled() && !isParentDisabled ){
+ return true;
+ } else {
+ //check expanded attributes in children groups, if exists
+ boolean isChildrenExpanded = isChildrenExpanded(component);
+ return isChildrenExpanded && !isParentDisabled && !((UIPanelMenuGroup)component).isDisabled();// ? "opened" : "closed";
+ }
+ }
+ }
+ return false;
+ }
+/*
+ protected boolean isChildrenExpanded(UIComponent component){
+ if (component.getChildren() != null){
+ Iterator itr = component.getChildren().iterator();
+ while(itr.hasNext()){
+ UIComponent child = (UIComponent)itr.next();
+ if(child instanceof UIPanelMenuGroup){
+ if( ((UIPanelMenuGroup)child).isExpanded() ){
+ return true;
+ } else {
+ return isChildrenExpanded(child);
+ }
+ }
+ }
+ }
+ return false;
+ }
+*/
}
Modified: trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuItemRenderer.java
===================================================================
--- trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuItemRenderer.java 2007-06-06 09:12:49 UTC (rev 1036)
+++ trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuItemRenderer.java 2007-06-06 11:28:57 UTC (rev 1037)
@@ -22,15 +22,11 @@
package org.richfaces.renderkit;
import java.io.IOException;
-import java.util.Map;
-
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.ActionEvent;
-
import org.ajax4jsf.framework.ajax.AjaxEvent;
-import org.ajax4jsf.framework.renderer.compiler.TemplateContext;
import org.ajax4jsf.framework.util.style.CSSFormat;
import org.richfaces.component.UISwitchablePanel;
import org.richfaces.component.panelmenu.UIPanelMenu;
@@ -41,7 +37,7 @@
public class PanelMenuItemRenderer extends PanelMenuRendererBase {
protected Class getComponentClass() {
//TODO by nick - dima - add concrete component class
- return UIComponent.class;
+ return UIPanelMenuItem.class;
}
protected void doEncodeBegin(ResponseWriter writer, FacesContext context,UIComponent component) throws IOException {
@@ -73,8 +69,8 @@
return;
}
String align = "";
- //TODO by nick - dima - add isTopLevel() method to item component
- boolean isTopLevel = component.getParent() instanceof UIPanelMenu;
+ UIPanelMenuItem panelMenuItem = (UIPanelMenuItem)component;
+ boolean isTopLevel = panelMenuItem.isTopLevel();
if (isTopLevel){
align = panelMenu.getIconItemTopPosition();
@@ -121,14 +117,15 @@
if (!iconType.equals("none")){
int h = 16; //width(context);
- //TODO by nick - dima - use writer.startElement()/writer.endElement()/getUtils().writeAttribute() calls to output image
- StringBuffer imageBuffer = new StringBuffer();
- imageBuffer.append("<img src=\"" + source + "\" ");
- imageBuffer.append("alt=\"\" vspace=\"0\" hspace=\"0\" ");
- imageBuffer.append("style=\"display:block;\" ");
- imageBuffer.append("width=\"" + String.valueOf(h) + "\" ");
- imageBuffer.append("height=\"" + String.valueOf(h) + "\" />");
- writer.write(imageBuffer.toString());
+ writer.startElement("img", component);
+ writer.writeAttribute("src", source, null);
+ writer.writeAttribute("alt", "", null);
+ writer.writeAttribute("vspace", "0", null);
+ writer.writeAttribute("hspace", "0", null);
+ writer.writeAttribute("style", "display:block; ", null);
+ writer.writeAttribute("width", String.valueOf(h), null);
+ writer.writeAttribute("height", String.valueOf(h), null);
+ writer.endElement("img");
}
}
@@ -166,27 +163,27 @@
//TODO by nick - dima - looks like duplicate code methods. can we add it to super class?
- public String getHideStyle(FacesContext context, UIComponent component) {
- // TODO Auto-generated method stub
- if (!(component.getParent() instanceof UIPanelMenu)) {
- CSSFormat format = new CSSFormat();
- format.add("display", "none");
- if(component.getParent() instanceof UIPanelMenuGroup) {
- UIPanelMenuGroup parent = (UIPanelMenuGroup)component.getParent();
- PanelMenuGroupRenderer renderer = (PanelMenuGroupRenderer) context.getRenderKit().getRenderer(parent.getFamily(), parent.getRendererType());
- try {
- if ( renderer.isOpened(context, parent).equals("opened") ){
- return "";
- } else
- return format.toString();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } else return format.toString();
- }
- return "";
- }
+// public String getHideStyle(FacesContext context, UIComponent component) {
+// // TODO Auto-generated method stub
+// if (!(component.getParent() instanceof UIPanelMenu)) {
+// CSSFormat format = new CSSFormat();
+// format.add("display", "none");
+// if(component.getParent() instanceof UIPanelMenuGroup) {
+// UIPanelMenuGroup parent = (UIPanelMenuGroup)component.getParent();
+// PanelMenuGroupRenderer renderer = (PanelMenuGroupRenderer) context.getRenderKit().getRenderer(parent.getFamily(), parent.getRendererType());
+// try {
+// if ( renderer.isOpened(context, parent).equals("opened") ){
+// return "";
+// } else
+// return format.toString();
+// } catch (IOException e) {
+// // TODO Auto-generated catch block
+// e.printStackTrace();
+// }
+// } else return format.toString();
+// }
+// return "";
+// }
}
Modified: trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java
===================================================================
--- trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java 2007-06-06 09:12:49 UTC (rev 1036)
+++ trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRenderer.java 2007-06-06 11:28:57 UTC (rev 1037)
@@ -266,6 +266,26 @@
}
private void setExpandedIfNeeded(FacesContext context,UIComponent child,StringBuffer buffer){
+ if(child instanceof UIPanelMenuItem){
+ buffer.append(",false");
+ } else {
+ UIPanelMenuGroup group = (UIPanelMenuGroup)child;
+ if(group.getValue() != null){
+ buffer.append(",").append(group.getValue().toString());
+ } else {
+ PanelMenuGroupRenderer r = (PanelMenuGroupRenderer)context.getRenderKit().getRenderer(group.getFamily(), group.getRendererType());
+ boolean isNodeOpened;
+ try {
+ isNodeOpened = r.isOpened(context, child);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ isNodeOpened = false;
+ }
+ buffer.append(",").append(String.valueOf(isNodeOpened));
+ }
+ }
+/*
String value = "";
try {
value = context.getExternalContext().getRequestParameterMap().get("panelMenuState"+child.getClientId(context)).toString();
@@ -288,7 +308,8 @@
buffer.append(isChildrenExpanded(child) ? ",true" : ",false");
//buffer.append(",false");
}
- }
+ }
+*/
}
private void addImages(StringBuffer buffer,FacesContext context,UIComponent component,String id){
Modified: trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java
===================================================================
--- trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java 2007-06-06 09:12:49 UTC (rev 1036)
+++ trunk/sandbox/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java 2007-06-06 11:28:57 UTC (rev 1037)
@@ -25,12 +25,12 @@
import java.util.Iterator;
import java.util.Map;
-import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase;
+import org.ajax4jsf.framework.renderer.RendererUtils;
import org.ajax4jsf.framework.renderer.compiler.TemplateContext;
import org.ajax4jsf.framework.skin.Skin;
import org.ajax4jsf.framework.util.style.CSSFormat;
@@ -47,6 +47,7 @@
import org.richfaces.renderkit.iconImages.PanelMenuIconDoubleArrowUp;
import org.richfaces.renderkit.iconImages.PanelMenuIconSpacer;
import org.richfaces.renderkit.iconImages.PanelMenuIconSquare;
+import org.ajax4jsf.framework.renderer.RendererUtils.HTML;
/**
* @author hans
@@ -56,14 +57,27 @@
public void insertTDs(FacesContext context , UIComponent component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
int level = calculateLevel(component);
- StringBuffer buffer = new StringBuffer();
+ //StringBuffer buffer = new StringBuffer();
String src = getIconByType("custom",false,context,component);
int w = 16; //width(context);
- //TODO by nick - dima - use writer.startElement()/writer.endElement()/getUtils().writeAttribute() calls to output image
+
+ RendererUtils utils = getUtils();
+
for (int i=0;i<level;i++){
- buffer.append("<td><img src=\"" + src + "\" alt=\"\" hspace=\"0\" vspace=\"0\" height=\""+w+"\" width=\""+w+"\" style=\"display:block;\" /></td>\n");
+ writer.startElement(HTML.td_ELEM, component);
+ writer.startElement("img", component);
+ writer.writeAttribute("src", src, null);
+ writer.writeAttribute("alt", "", null);
+ writer.writeAttribute("hspace", "0", null);
+ writer.writeAttribute("vspace", "0", null);
+ writer.writeAttribute("height", String.valueOf(w), null);
+ writer.writeAttribute("width", String.valueOf(w), null);
+ writer.writeAttribute("style", "display:block; ", null);
+ writer.endElement("img");
+ writer.endElement(HTML.td_ELEM);
+ //buffer.append("<td><img src=\"" + src + "\" alt=\"\" hspace=\"0\" vspace=\"0\" height=\""+w+"\" width=\""+w+"\" style=\"display:block;\" /></td>\n");
}
- writer.write(buffer.toString());
+ //writer.write(buffer.toString());
}
protected int calculateLevel (UIComponent component){
@@ -72,10 +86,10 @@
while(parent != null){
if(parent instanceof UIPanelMenu){
return level;
+ } else if(parent instanceof UIPanelMenuGroup){
+ level++;
}
parent = parent.getParent();
- //TODO by nick - dima - inc level counter only if parent is panelMenu(Group) component
- level++;
}
return level;
}
@@ -142,14 +156,37 @@
return (UIPanelMenu) parent;
}
+// public String getHideStyle(FacesContext context, UIComponent component) {
+// if (!(component.getParent() instanceof UIPanelMenu)) {
+// CSSFormat format = new CSSFormat();
+// format.add("display", "none");
+// return format.toString();
+// }
+// return "";
+// }
public String getHideStyle(FacesContext context, UIComponent component) {
if (!(component.getParent() instanceof UIPanelMenu)) {
CSSFormat format = new CSSFormat();
format.add("display", "none");
- return format.toString();
+ if(component.getParent() instanceof UIPanelMenuGroup) {
+ UIPanelMenuGroup parent = (UIPanelMenuGroup)component.getParent();
+ //TODO by nick - dima - take opened value from component itself
+ PanelMenuGroupRenderer renderer = (PanelMenuGroupRenderer) context.getRenderKit().getRenderer(parent.getFamily(), parent.getRendererType());
+ try {
+ if ( renderer.isOpened(context, parent) ){
+ return "";
+ } else
+ return format.toString();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ } else return format.toString();
}
return "";
+
}
+
public void insertValue(FacesContext context, UIComponent component) throws IOException {
Object value = component.getAttributes().get("value");
@@ -159,28 +196,28 @@
}
- public String isOpened(FacesContext context, UIComponent component)throws IOException {
- String clientId = component.getClientId(context);
- Map requestParameterMap = context.getExternalContext().getRequestParameterMap();
- Object value = requestParameterMap.get("panelMenuState"+clientId);
- if (value != null) {
- if (value.equals("opened")) {
- return "opened";
- }
- } else {
- boolean isParentDisabled = isParentDisabled(component);
- if(component instanceof UIPanelMenuGroup){
- if( ((UIPanelMenuGroup)component).isExpanded() && !((UIPanelMenuGroup)component).isDisabled() && !isParentDisabled ){
- return "opened";
- } else {
- //check expanded attributes in children groups, if exists
- boolean isChildrenExpanded = isChildrenExpanded(component);
- return isChildrenExpanded && !isParentDisabled && !((UIPanelMenuGroup)component).isDisabled() ? "opened" : "closed";
- }
- }
- }
- return "closed";
- }
+// public String isOpened(FacesContext context, UIComponent component)throws IOException {
+// String clientId = component.getClientId(context);
+// Map requestParameterMap = context.getExternalContext().getRequestParameterMap();
+// Object value = requestParameterMap.get("panelMenuState"+clientId);
+// if (value != null) {
+// if (value.equals("opened")) {
+// return "opened";
+// }
+// } else {
+// boolean isParentDisabled = isParentDisabled(component);
+// if(component instanceof UIPanelMenuGroup){
+// if( ((UIPanelMenuGroup)component).isExpanded() && !((UIPanelMenuGroup)component).isDisabled() && !isParentDisabled ){
+// return "opened";
+// } else {
+// //check expanded attributes in children groups, if exists
+// boolean isChildrenExpanded = isChildrenExpanded(component);
+// return isChildrenExpanded && !isParentDisabled && !((UIPanelMenuGroup)component).isDisabled() ? "opened" : "closed";
+// }
+// }
+// }
+// return "closed";
+// }
protected boolean isChildrenExpanded(UIComponent component){
if (component.getChildren() != null){
Modified: trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
===================================================================
--- trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-06-06 09:12:49 UTC (rev 1036)
+++ trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-06-06 11:28:57 UTC (rev 1037)
@@ -136,7 +136,9 @@
hide: function(){
this.obj.style.display = 'none';
- this.inputState.value="closed";
+// if(this.inputState){
+// this.inputState.value="closed";
+// }
},
expand: function(){
@@ -167,8 +169,8 @@
},
show: function(){
- if (this.type!="node")
- this.inputState.value="opened";
+// if (this.type!="node")
+// this.inputState.value="opened";
this.tdhider.style.display="";
this.tablehider.style.display="";
this.obj.style.display = "";
Modified: trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
===================================================================
--- trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2007-06-06 09:12:49 UTC (rev 1036)
+++ trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2007-06-06 11:28:57 UTC (rev 1037)
@@ -36,11 +36,11 @@
<tr style="display:none">
<td>
<!-- TODO by nick - dima - no need for clientId here -->
- <f:clientid var="clientId"/>
+ <!--f:clientid var="clientId"/-->
<f:call name="insertScript"/>
</td>
</tr>
</tbody>
</table>
<f:call name="utils.encodeEndFormIfNessesary"/>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
===================================================================
--- trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2007-06-06 09:12:49 UTC (rev 1036)
+++ trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2007-06-06 11:28:57 UTC (rev 1037)
@@ -22,6 +22,8 @@
itemClass = " dr-pmenu-disabled-element rich-pmenu-disabled-element ";
}
variables.setVariable("itemClass", itemClass);
+
+ String isNodeOpened = isOpened(context, component) ? "opened" : "closed";
]]>
</jsp:scriptlet>
<table cellpadding="0" cellspacing="0" border="0" width="100%"
@@ -34,9 +36,9 @@
</f:call>
<!-- TODO by nick - dima - encodeAttributes & encodePassThru conflict -->
<f:call name="utils.encodePassThru" />
- <tr>
- <!-- TODO by nick - dima - just id="#{clientId}" -->
- <f:call name="utils.encodeId" />
+ <tr id="#{clientId}">
+ <!-- TODO by nick - dima - just id="_#_{clientId}" -->
+ <!--f:call name="utils.encodeId" /-->
<f:call name="insertTDs" />
<td>
<f:call name="insertImage">
@@ -47,7 +49,7 @@
<td style="width:100%" class="item_content"
id="icon#{clientId}" >
<input type="hidden" name="panelMenuState#{clientId}"
- value="#{this:isOpened(context, component)}" >
+ value="#{isNodeOpened}" >
</input>
<!-- TODO by nick - dima - one input should be enough -->
<input type="hidden" name="panelMenuAction#{clientId}"
Modified: trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
===================================================================
--- trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2007-06-06 09:12:49 UTC (rev 1036)
+++ trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2007-06-06 11:28:57 UTC (rev 1037)
@@ -44,9 +44,6 @@
</f:call>
</td>
<td style="width:100%" class="item_content">
- <input type="hidden" name="panelMenuState#{clientId}"
- value="#{this:isOpened(context, component)}" >
- </input>
<input type="hidden" name="panelMenuAction#{clientId}"
value="" >
</input>
17 years, 7 months
JBoss Rich Faces SVN: r1036 - trunk/docs/userguide.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-06 05:12:49 -0400 (Wed, 06 Jun 2007)
New Revision: 1036
Modified:
trunk/docs/userguide/f.xsl
Log:
prev version
Modified: trunk/docs/userguide/f.xsl
===================================================================
--- trunk/docs/userguide/f.xsl 2007-06-05 18:49:32 UTC (rev 1035)
+++ trunk/docs/userguide/f.xsl 2007-06-06 09:12:49 UTC (rev 1036)
@@ -7,6 +7,7 @@
<xsl:template match="javaee:taglib | taglib">
<xsl:variable name="excluded-tag-names">header2,header3,header4,header5,header6</xsl:variable>
+
<xsl:for-each select="javaee:tag | tag">
<xsl:sort select="name" />
<xsl:sort select="javaee:name" />
@@ -34,9 +35,7 @@
</xsl:variable>
<section id="tag_name">
- <xsl:attribute name="id"><xsl:value-of select="$tag_name"/></xsl:attribute>
- <xsl:attribute name="xreflang"><xsl:value-of select="concat($tag_name,'Chapter')"/></xsl:attribute>
-
+ <xsl:attribute name="id"><xsl:value-of select="$tag_name"/></xsl:attribute>
<xsl:processing-instruction name="dbhtml">
<xsl:text>filename="</xsl:text><xsl:value-of select="$tag_name" /><xsl:text>.html" </xsl:text>
</xsl:processing-instruction>
17 years, 7 months
JBoss Rich Faces SVN: r1035 - trunk/docs/userguide/en/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-05 14:49:32 -0400 (Tue, 05 Jun 2007)
New Revision: 1035
Removed:
trunk/docs/userguide/en/modules/RFClibrary.xml
Log:
deleted
Deleted: trunk/docs/userguide/en/modules/RFClibrary.xml
===================================================================
--- trunk/docs/userguide/en/modules/RFClibrary.xml 2007-06-05 18:48:50 UTC (rev 1034)
+++ trunk/docs/userguide/en/modules/RFClibrary.xml 2007-06-05 18:49:32 UTC (rev 1035)
@@ -1,5 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<para id="RichFacesComponentsLibrary" xreflabel="RichFacesComponentsLibrary">
-<?dbhtml filename="RichFacesComponentsLibrary.html"?>
-</para>
-
17 years, 7 months
JBoss Rich Faces SVN: r1034 - trunk/docs/userguide/en/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-05 14:48:50 -0400 (Tue, 05 Jun 2007)
New Revision: 1034
Modified:
trunk/docs/userguide/en/modules/RFCarchitectover.xml
Log:
changed links
Modified: trunk/docs/userguide/en/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/modules/RFCarchitectover.xml 2007-06-05 18:48:15 UTC (rev 1033)
+++ trunk/docs/userguide/en/modules/RFCarchitectover.xml 2007-06-05 18:48:50 UTC (rev 1034)
@@ -475,7 +475,7 @@
</table>
<para>To get detailed information on particular parameter possibilities,
- see the <ulink url="Rich_Faces_Components_Library.html">chapter</ulink> where each component has skin parameters described
+ see the <ulink url="../html/RichFacesComponentsLibrary.html">chapter</ulink> where each component has skin parameters described
corresponding to its elements.</para>
</section>
17 years, 7 months
JBoss Rich Faces SVN: r1033 - trunk/docs/userguide/en/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-05 14:48:15 -0400 (Tue, 05 Jun 2007)
New Revision: 1033
Modified:
trunk/docs/userguide/en/included/dataTable.xml
Log:
changed links
Modified: trunk/docs/userguide/en/included/dataTable.xml
===================================================================
--- trunk/docs/userguide/en/included/dataTable.xml 2007-06-05 18:47:02 UTC (rev 1032)
+++ trunk/docs/userguide/en/included/dataTable.xml 2007-06-05 18:48:15 UTC (rev 1033)
@@ -69,7 +69,7 @@
<listitem>Skin support. The <property>table</property> completely meets a three-class principle of Rich Faces skinability</listitem>
<listitem>Support of AJAX updates for a limited set of strings</listitem>
</itemizedlist>
- <para>Skins support is described in the <ulink url="Skinnability.html">corresponding section</ulink>.
+ <para>Skins support is described in the <ulink url="../html/ArchitectureOverview.html">corresponding section</ulink>.
AJAX support is possible because the component is created basing on the <emphasis role="bold"><property><a4j:repeat></property></emphasis> component and
as a result the component has its possibilities of AJAX updates for a limited set of strings.
The component is implemented with the <emphasis role="italic"><property>"ajaxKeys"</property></emphasis> attribute for a <property>table</property> and in contrast to
17 years, 7 months
JBoss Rich Faces SVN: r1032 - trunk/docs/userguide/en/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-05 14:47:02 -0400 (Tue, 05 Jun 2007)
New Revision: 1032
Modified:
trunk/docs/userguide/en/included/column.xml
trunk/docs/userguide/en/included/columnGroup.xml
trunk/docs/userguide/en/included/dropDownMenu.desc.xml
trunk/docs/userguide/en/included/dropDownMenu.xml
trunk/docs/userguide/en/included/menuGroup.desc.xml
trunk/docs/userguide/en/included/menuItem.desc.xml
trunk/docs/userguide/en/included/menuItem.xml
trunk/docs/userguide/en/included/menuSeparator.desc.xml
trunk/docs/userguide/en/included/subTable.xml
trunk/docs/userguide/en/included/tree.xml
trunk/docs/userguide/en/included/treeNode.xml
Log:
changed links, styles
Modified: trunk/docs/userguide/en/included/column.xml
===================================================================
--- trunk/docs/userguide/en/included/column.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/column.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -160,7 +160,7 @@
<para>Hence, additionally to a standard output of a particular row provided with the <emphasis role="bold"><property><h:column></property></emphasis>
component, it becomes possible to group easily the rows with special HTML attribute.</para>
<para>The columns also could be grouped in a particular way with the help of the <emphasis role="bold"><property><h:columnGroup></property></emphasis>
- component that is described in <ulink url="columnGroup.html">the following chapter</ulink>.</para>
+ component that is described in <link linkend="columnGroup">the following chapter</link>.</para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/included/columnGroup.xml
===================================================================
--- trunk/docs/userguide/en/included/columnGroup.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/columnGroup.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -67,7 +67,7 @@
</section>
<section>
<title>Details of Usage</title>
- <para>The <property>columnGroup</property> component combines columns set wrapping them into the <emphasis role="bold"><property><tr></property></emphasis> element and outputting them
+ <para>The <emphasis role="bold"><property><rich:columnGroup></property></emphasis> component combines columns set wrapping them into the <emphasis role="bold"><property><tr></property></emphasis> element and outputting them
into one row. Columns are combined in a group the same way as when the <emphasis role="italic"><property>"breakBefore"</property></emphasis> attribute is used for
columns to add a moving to the next rows, but the first variant is clearer from a source code. Hence, the
following simple examples are very same.</para>
Modified: trunk/docs/userguide/en/included/dropDownMenu.desc.xml
===================================================================
--- trunk/docs/userguide/en/included/dropDownMenu.desc.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/dropDownMenu.desc.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -9,7 +9,7 @@
<section>
<title>Description</title>
- <para>The <rich:dropDownMenu> component is used for creating
+ <para>The <emphasis role="bold"><property><rich:dropDownMenu></property></emphasis> component is used for creating
multilevel drop-down menus.</para>
<figure>
Modified: trunk/docs/userguide/en/included/dropDownMenu.xml
===================================================================
--- trunk/docs/userguide/en/included/dropDownMenu.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/dropDownMenu.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -99,7 +99,7 @@
</rich:dropDownMenu>
...</programlisting>
- <para>The <rich:dropDownMenu> "mode" attribute can be set to three
+ <para>The <emphasis role="bold"><property><rich:dropDownMenu></property></emphasis> "mode" attribute can be set to three
possible parameters:</para>
<itemizedlist>
@@ -130,7 +130,7 @@
Menu items don't fire any submits themselves. The behavior is fully
defined by the components nested inside items.</para>
- <note><title>Note:</title> As the <rich:dropDownMenu> component
+ <note><title>Note:</title> As the <emphasis role="bold"><property><rich:dropDownMenu></property></emphasis> component
doesn't provide its own form, use it between <h:form> and
</h:form> tags.</note>
Modified: trunk/docs/userguide/en/included/menuGroup.desc.xml
===================================================================
--- trunk/docs/userguide/en/included/menuGroup.desc.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/menuGroup.desc.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -7,7 +7,7 @@
</sectioninfo>
<section>
<title>Description</title>
- <para>The <rich:menuGroup> component is used to define an expandable group of items inside a pop-up list or another group.</para>
+ <para>The <emphasis role="bold"><property><rich:menuGroup></property></emphasis> component is used to define an expandable group of items inside a pop-up list or another group.</para>
<figure>
<title><rich:menuGroup> component</title>
<mediaobject>
Modified: trunk/docs/userguide/en/included/menuItem.desc.xml
===================================================================
--- trunk/docs/userguide/en/included/menuItem.desc.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/menuItem.desc.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -7,7 +7,7 @@
</sectioninfo>
<section>
<title>Description</title>
- <para>The <emphasis role="bold"><rich:menuItem></emphasis> component is used for the definition of a single item inside a pop-up list.</para>
+ <para>The <emphasis role="bold"><property><rich:menuItem></property></emphasis> component is used for the definition of a single item inside a pop-up list.</para>
<figure>
<title><rich:menuItem> component</title>
<mediaobject>
Modified: trunk/docs/userguide/en/included/menuItem.xml
===================================================================
--- trunk/docs/userguide/en/included/menuItem.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/menuItem.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -78,7 +78,7 @@
...
]]></programlisting>
- <para>The <rich: menuItem> "mode" attribute can be set to three
+ <para>The <emphasis role="bold"><property><rich: menuItem></property></emphasis> "mode" attribute can be set to three
possible parameters:</para>
<itemizedlist>
Modified: trunk/docs/userguide/en/included/menuSeparator.desc.xml
===================================================================
--- trunk/docs/userguide/en/included/menuSeparator.desc.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/menuSeparator.desc.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -7,7 +7,7 @@
</sectioninfo>
<section>
<title>Description</title>
- <para>The <rich:menuSeparator> component is used for the definition of a horizontal separator that can be placed between groups or items.</para>
+ <para>The <emphasis role="bold"><property><rich:menuSeparator></property></emphasis> component is used for the definition of a horizontal separator that can be placed between groups or items.</para>
<figure>
<title><rich:menuSeparator></title>
<mediaobject>
Modified: trunk/docs/userguide/en/included/subTable.xml
===================================================================
--- trunk/docs/userguide/en/included/subTable.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/subTable.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -72,7 +72,7 @@
<listitem>Skin support. The table completely meets a three-class principle of Rich Faces skinability</listitem>
<listitem>Support of AJAX updates for a limited set of rows</listitem>
</itemizedlist>
- <para>Skins support is described in the <ulink url="Skinnability.html">corresponding section</ulink>. AJAX support is
+ <para>Skins support is described in the <ulink url="../html/ArchitectureOverview.html">corresponding section</ulink>. AJAX support is
possible because the component is created basing on the <emphasis role="bold"><property><a4j:repeat></property></emphasis> component and as a result the
component has its possibilities of AJAX updates for a limited set of rows. The component is implemented
with the <emphasis role="italic"><property>"ajaxKeys"</property></emphasis> attribute for a table and in contrast to the <emphasis role="bold"><property><a4j:repeat></property></emphasis> outputs the standard HTML
Modified: trunk/docs/userguide/en/included/tree.xml
===================================================================
--- trunk/docs/userguide/en/included/tree.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/tree.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -139,10 +139,10 @@
<para>The tree component functionality provides a built-in support for Drag and Drop operations.
The main usage principles are the same as for Rich Faces Drag and Drop wrapper components. Hence,
to get additional information on the topic, read the corresponding chapters:
- <ulink url="dndParam.html"><emphasis role="italic"><property>"rich:dndParam"</property>,</emphasis></ulink>
- <ulink url="dragSupport.html"><emphasis role="italic"><property>"rich:dragSupport"</property>,</emphasis></ulink>
- <ulink url="dragIndicator.html"><emphasis role="italic"><property>"rich:dragIndicator"</property>,</emphasis></ulink>
- <ulink url="dropSupport.html"><emphasis role="italic"><property>"rich:dropSupport"</property>.</emphasis></ulink>
+ <link linkend="dndParam">"rich:dndParam"</link>
+ <link linkend="dragSupport">"rich:dragSupport"</link>
+ <link linkend="dragIndicator">"rich:dragIndicator"</link>
+ <link linkend="dropSupport">"rich:dropSupport"</link>
<property>Tree nodes</property> could be drag or drop elements, so tree has both attributes
groups.</para>
<table>
@@ -230,7 +230,7 @@
<para>There is only one skin parameter for the <property>tree</property> since
<emphasis role="bold"><property><rich:tree></property></emphasis>
itself is a wrapper component for <property>tree</property> nodes. Look and feel is
- described in details in the <ulink url="treeNode.html">"treeNode" chapter</ulink>.</para>
+ described in details in the <link linkend="treeNode">"treeNode" chapter</link>.</para>
<table>
<title>Skin parameters for wrapper element</title>
<tgroup cols="2">
Modified: trunk/docs/userguide/en/included/treeNode.xml
===================================================================
--- trunk/docs/userguide/en/included/treeNode.xml 2007-06-05 18:44:38 UTC (rev 1031)
+++ trunk/docs/userguide/en/included/treeNode.xml 2007-06-05 18:47:02 UTC (rev 1032)
@@ -121,9 +121,9 @@
<para>Different nodes for rendering could be defined depending on some conditions on the tree level.
Each condition represents some rendering template. To get more information on various <property>treeNodes</property>
definition for nodes,
- <ulink url="tree.html">see the tree component chapter</ulink>.</para>
+ <link linkend="tree">see the tree component chapter</link>.</para>
<para>Switching between expanded/collapsed modes is also managed on the tree level and defined
- in <ulink url="tree.html">the corresponding section</ulink>.</para>
+ in <link linkend="tree">the corresponding section</link>.</para>
<para>Default nodes of the tree level as well as ones defined with the <property>treeNodes</property> component could
send AJAX requests when selected with the mouse, it's managed with the
<emphasis role="italic"><property>"ajaxSubmitSelection"</property></emphasis> attribute
@@ -132,7 +132,7 @@
<section>
<title>Built-in Drag and Drop</title>
<para>The main information on Drag and Drop operations is given in
- <ulink url="tree.html">the corresponding paragraph</ulink> of
+ <link linkend="tree">the corresponding paragraph</link> of
the <property>tree</property> component chapter. It's only necessary to mention that each node could also be a Drag
element as well as a Drop container, i.e. the container and the element have all attributes,
listeners and ways of behavior similar to the ones of the <emphasis role="bold"><property><rich:draggable></property></emphasis> and <emphasis role="bold"><property><rich:dropZone></property></emphasis> components
@@ -140,7 +140,7 @@
<section>
<title>Events Handling</title>
<para>Just as Drag and Drop operations it corresponds to the one described on
- <ulink url="tree.html">the tree component level</ulink> for a default Node.</para>
+ <link linkend="tree.html">the tree component level</link> for a default Node.</para>
</section>
<section>
<title>Look-and-Feel Customization</title>
17 years, 7 months
JBoss Rich Faces SVN: r1031 - trunk/docs/userguide/en.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-05 14:44:38 -0400 (Tue, 05 Jun 2007)
New Revision: 1031
Modified:
trunk/docs/userguide/en/master.xml
Log:
fixed problem with generating RichFacesComponentsLibrary.html
Modified: trunk/docs/userguide/en/master.xml
===================================================================
--- trunk/docs/userguide/en/master.xml 2007-06-05 18:43:10 UTC (rev 1030)
+++ trunk/docs/userguide/en/master.xml 2007-06-05 18:44:38 UTC (rev 1031)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"../../../../jbosstools/trunk/documentation/resources/support/docbook-dtd/docbookx.dtd"
+"../../resources/support/docbook-dtd/docbookx.dtd"
[ <!ENTITY rfcintro SYSTEM "modules/rfcintro.xml">
<!ENTITY rfcdocumentroadmap SYSTEM "modules/rfcdocumentroadmap.xml">
<!ENTITY rfctechreqs SYSTEM "modules/rfctechreqs.xml">
@@ -55,12 +55,11 @@
&rfcsetwebappl;
&rfcarchitectover;
-<chapter role="NotInToc">
+<chapter role="NotInToc" id="RichFacesComponentsLibrary" xreflabel="RichFacesComponentsLibrary">
+<?dbhtml filename="RichFacesComponentsLibrary.html"?>
<title>The RichFaces Components</title>
<para>The library encompasses ready-made components built based on the <emphasis role="italic"><property>Ajax4jsf Component Factory</property></emphasis>. To find out more about the Component Factory, go to the
<ulink url="http://www.jboss.org/projects/jbossajax4jsf">Ajax4jsf project</ulink>.</para>
- &rfclibrary;
-
&dataFilterSlider_table;
&dataScroller_table;
&dataTable_table;
17 years, 7 months
JBoss Rich Faces SVN: r1030 - trunk/docs/userguide.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-05 14:43:10 -0400 (Tue, 05 Jun 2007)
New Revision: 1030
Modified:
trunk/docs/userguide/f.xsl
Log:
edited for using links
Modified: trunk/docs/userguide/f.xsl
===================================================================
--- trunk/docs/userguide/f.xsl 2007-06-05 18:10:20 UTC (rev 1029)
+++ trunk/docs/userguide/f.xsl 2007-06-05 18:43:10 UTC (rev 1030)
@@ -7,7 +7,6 @@
<xsl:template match="javaee:taglib | taglib">
<xsl:variable name="excluded-tag-names">header2,header3,header4,header5,header6</xsl:variable>
-
<xsl:for-each select="javaee:tag | tag">
<xsl:sort select="name" />
<xsl:sort select="javaee:name" />
@@ -35,7 +34,9 @@
</xsl:variable>
<section id="tag_name">
- <xsl:attribute name="id"><xsl:value-of select="$tag_name"/></xsl:attribute>
+ <xsl:attribute name="id"><xsl:value-of select="$tag_name"/></xsl:attribute>
+ <xsl:attribute name="xreflang"><xsl:value-of select="concat($tag_name,'Chapter')"/></xsl:attribute>
+
<xsl:processing-instruction name="dbhtml">
<xsl:text>filename="</xsl:text><xsl:value-of select="$tag_name" /><xsl:text>.html" </xsl:text>
</xsl:processing-instruction>
17 years, 7 months
JBoss Rich Faces SVN: r1029 - in trunk/richfaces: tree/src/main/java/org/richfaces/component and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-06-05 14:10:20 -0400 (Tue, 05 Jun 2007)
New Revision: 1029
Added:
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/form.js
Modified:
trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/css/tree.xcss
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
trunk/richfaces/tree/src/main/templates/htmlTree.jspx
trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx
trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-85 fixed
Added: trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/form.js
===================================================================
--- trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/form.js (rev 0)
+++ trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/form.js 2007-06-05 18:10:20 UTC (rev 1029)
@@ -0,0 +1,19 @@
+if (!window.Richfaces) {
+ window.Richfaces = {};
+}
+
+Richfaces.jsFormSubmit = function(linkId, formName, target, params) {
+ var form = document.getElementById(formName);
+ if (form) {
+ var formTarget = form.target;
+ var paramNames = new Array();
+ if (params) {
+ for (var n in params) {
+ paramNames.push(n);
+ }
+ }
+
+ _JSFFormSubmit(linkId,formName,target,params);
+ _clearJSFFormParameters(formName, formTarget, paramNames);
+ }
+}
\ No newline at end of file
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java 2007-06-05 17:55:47 UTC (rev 1028)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java 2007-06-05 18:10:20 UTC (rev 1029)
@@ -28,8 +28,6 @@
import javax.faces.application.Application;
import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
import javax.faces.component.UIOutput;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
@@ -86,9 +84,6 @@
public final static String SWITCH_AJAX = "ajax";
- public final static String EXPANDED_STATE_PARAMETER_NAME = NamingContainer.SEPARATOR_CHAR
- + "expanded";
-
public final static String SELECTED_NODE_PARAMETER_NAME = NamingContainer.SEPARATOR_CHAR
+ "selectedNode";
@@ -97,8 +92,6 @@
public static final String SELECTION_INPUT_ATTRIBUTE = "_selectionInput";
- public static final String TOGGLE_LINK_ATTRIBUTE = "_toggleLink";
-
public final static String TREE_DATA_LOCATOR_BINDING = "treeDataLocator";
public final static String DEFAULT_SELECTED_CSS_CLASS = "dr-tree-i-sel";
@@ -344,23 +337,7 @@
if (!this.isRendered())
return;
- UIComponent formComponent = this;
- do {
- formComponent = formComponent.getParent();
- } while (formComponent != null && !(formComponent instanceof UIForm));
-
- Map requestParameterMap = faces.getExternalContext()
- .getRequestParameterMap();
- if (formComponent != null) {
- String id = formComponent.getClientId(faces)
- + NamingContainer.SEPARATOR_CHAR + "_idcl";
- String string = (String) requestParameterMap.get(id);
-
- if (string != null) {
- this.getAttributes().put(TOGGLE_LINK_ATTRIBUTE, string);
- }
- }
-
+ Map requestParameterMap = faces.getExternalContext().getRequestParameterMap();
if (requestParameterMap.get(getBaseClientId(faces)
+ SELECTED_NODE_PARAMETER_NAME) != null) {
getAttributes().put(
@@ -368,12 +345,6 @@
requestParameterMap.get(getBaseClientId(faces)
+ SELECTED_NODE_PARAMETER_NAME));
}
- getAttributes().put(
- EXPANDED_STATE_PARAMETER_NAME,
- new Boolean((String) requestParameterMap
- .get(getBaseClientId(faces)
- + EXPANDED_STATE_PARAMETER_NAME)));
-
Object selectionInputValue = requestParameterMap
.get(getSelectionStateInputName(faces));
if (selectionInputValue instanceof String) {
@@ -394,8 +365,6 @@
} finally {
getAttributes().remove(SELECTION_INPUT_ATTRIBUTE);
getAttributes().remove(SELECTED_NODE_PARAMETER_NAME);
- getAttributes().remove(TOGGLE_LINK_ATTRIBUTE);
- getAttributes().remove(EXPANDED_STATE_PARAMETER_NAME);
}
// if (treePersister != null) {
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2007-06-05 17:55:47 UTC (rev 1028)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2007-06-05 18:10:20 UTC (rev 1029)
@@ -9,7 +9,6 @@
import java.util.Map;
import java.util.Set;
-import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -37,6 +36,8 @@
*/
public abstract class NodeRendererBase extends CompositeRenderer {
+ protected static final String NODE_EXPANDED_INPUT_SUFFIX = "NodeExpanded";
+
private static class TreeNodeOptions extends ScriptOptions {
public TreeNodeOptions(UIComponent component) {
@@ -45,7 +46,7 @@
Map params = new HashMap();
if (((Boolean) (component.getAttributes().get("isLastElement")))
- .booleanValue()) {
+ .booleanValue()) {
UITree tree = ((UITreeNode) component).getUITree();
@@ -72,11 +73,9 @@
if ("handle".equals(to) && treeNode.getUITree().isToggleOnClick() ||
"mainRow".equals(to) && !treeNode.getUITree().isToggleOnClick())
return "";
-
+
UITree tree = treeNode.getUITree();
String id = treeNode.getClientId(context);
- String toggleId = id + NamingContainer.SEPARATOR_CHAR
- + UITree.TOGGLE_LINK_ATTRIBUTE;
if (UITree.SWITCH_AJAX.equals(tree.getSwitchType())) {
JSFunction function = AjaxRendererUtils.buildAjaxFunction(tree.getNodeFacet(),
@@ -85,12 +84,9 @@
tree.getNodeFacet());
Map parameters = (Map) eventOptions.get("parameters");
parameters.remove(id);
- parameters.put(toggleId, toggleId);
- parameters.put(tree.getBaseClientId(context)
- + UITree.EXPANDED_STATE_PARAMETER_NAME, String.valueOf(tree
+ parameters.put(id + NODE_EXPANDED_INPUT_SUFFIX, String.valueOf(!tree
.isExpanded()));
-
if (((Boolean) (treeNode.getAttributes().get("isLastElement")))
.booleanValue()) {
parameters.put(tree.getBaseClientId(context)
@@ -103,20 +99,21 @@
buffer.append(";");
return buffer.toString();
} else if (UITree.SWITCH_SERVER.equals(tree.getSwitchType())) {
+ String paramName = id + NODE_EXPANDED_INPUT_SUFFIX;
+
StringBuffer result = new StringBuffer();
result.append('{');
+ result.append("var form = A4J.findForm(this);");
result.append("var params = new Object();");
result.append("params['");
- result.append(tree.getBaseClientId(context)
- + UITree.EXPANDED_STATE_PARAMETER_NAME);
-
+ result.append(paramName);
result.append("'] = ");
- result.append(tree.isExpanded());
+ result.append(!tree.isExpanded());
result.append(';');
- result.append("_JSFFormSubmit('");
- result.append(toggleId);
+ result.append("Richfaces.jsFormSubmit('");
+ result.append(id);
result.append("', ");
- result.append("A4J.findForm(this).id, ");
+ result.append("form.id, ");
result.append("'', ");
result.append("params);};");
@@ -127,7 +124,7 @@
}
public void initializeLines(FacesContext context, UITreeNode treeNode)
- throws IOException {
+ throws IOException {
ComponentVariables variables = ComponentsVariableResolver.getVariables(
this, treeNode);
@@ -142,16 +139,16 @@
}
if (tree.isExpanded()) {
variables
- .setVariable("lineFirst", "dr-tree-h-ic-line-exp");
+ .setVariable("lineFirst", "dr-tree-h-ic-line-exp");
} else {
variables.setVariable("lineFirst",
- "dr-tree-h-ic-line-clp");
+ "dr-tree-h-ic-line-clp");
}
}
}
public void initializeResources(FacesContext context, UITreeNode treeNode)
- throws IOException {
+ throws IOException {
ComponentVariables variables = ComponentsVariableResolver.getVariables(
this, treeNode);
@@ -181,8 +178,8 @@
resource += " " + cssClass;
}
variables.setVariable("selectedClass", resource);
-
-
+
+
resource = ViewUtil.getResourceURL(treeNode.getIcon());
if (resource == null) {
resource = ViewUtil.getResourceURL(tree.getIcon());
@@ -209,12 +206,12 @@
if (resource != null) {
variables.setVariable("expanded", resource);
}
-
+
resource = ViewUtil.getResourceURL(treeNode.getIconLeaf());
if (resource == null) {
resource = ViewUtil.getResourceURL(tree.getIconLeaf());
}
-
+
if (resource != null) {
variables.setVariable("leaf", resource);
}
@@ -224,18 +221,22 @@
if (node.getUITree().isExpanded() ^ expandHandle) {
return "display: none;";
}
-
+
return "";
}
-
+
public String getHandleCollapsedDisplayStyle(FacesContext context, UITreeNode node) {
return getHandleDisplayStyle(context, node, false);
}
-
+
public String getHandleExpandedDisplayStyle(FacesContext context, UITreeNode node) {
return getHandleDisplayStyle(context, node, true);
}
+ public String getExpandedValue(FacesContext context, UITreeNode node) {
+ return Boolean.toString(node.getUITree().isExpanded());
+ }
+
protected void doDecode(FacesContext context, UIComponent component) {
super.doDecode(context, component);
@@ -247,32 +248,30 @@
TreeState componentState = (TreeState) tree.getComponentState();
TreeRowKey key = (TreeRowKey) tree.getRowKey();
- String toggleId = id + NamingContainer.SEPARATOR_CHAR
- + UITree.TOGGLE_LINK_ATTRIBUTE;
- if (null != requestMap.get(toggleId)
- || toggleId.equals(tree.getAttributes().get(
- UITree.TOGGLE_LINK_ATTRIBUTE))) {
+ String nodeExpandedId = id + NODE_EXPANDED_INPUT_SUFFIX;
+ Object nodeExpandedValue = requestMap.get(nodeExpandedId);
+ if (nodeExpandedValue != null) {
+ boolean nodeExpanded = Boolean.valueOf(nodeExpandedValue.toString()).booleanValue();
+ if (tree.isExpanded() ^ nodeExpanded) {
+ if (nodeExpanded) {
+ new ExpandNodeCommandEvent(tree, key).queue();
+ } else {
+ new CollapseNodeCommandEvent(tree, key).queue();
+ }
- if (((Boolean) tree.getAttributes().get(
- UITree.EXPANDED_STATE_PARAMETER_NAME)).booleanValue()) {
+ new NodeExpandedEvent(node).queue();
+ new NodeExpandedEvent(tree).queue();
- new CollapseNodeCommandEvent(tree, key).queue();
- } else {
- new ExpandNodeCommandEvent(tree, key).queue();
- }
+ if (UITree.SWITCH_AJAX.equals(tree.getSwitchType()) && AjaxRendererUtils.isAjaxRequest(context)) {
+ Set ajaxKeys = tree.getAjaxKeys();
+ if (ajaxKeys == null) {
+ ajaxKeys = new HashSet();
- new NodeExpandedEvent(node).queue();
- new NodeExpandedEvent(tree).queue();
+ tree.setAjaxKeys(ajaxKeys);
+ }
- if (AjaxRendererUtils.isAjaxRequest(context)) {
- Set ajaxKeys = tree.getAjaxKeys();
- if (ajaxKeys == null) {
- ajaxKeys = new HashSet();
-
- tree.setAjaxKeys(ajaxKeys);
+ ajaxKeys.add(key);
}
-
- ajaxKeys.add(key);
}
}
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/css/tree.xcss
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/css/tree.xcss 2007-06-05 17:55:47 UTC (rev 1028)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/css/tree.xcss 2007-06-05 18:10:20 UTC (rev 1029)
@@ -7,6 +7,10 @@
.dr-tree {
}
+.dr-tree-h-input {
+ display: none;
+}
+
.dr-tree-h-ic {
width: 16px;
padding : 1px
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-06-05 17:55:47 UTC (rev 1028)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-06-05 18:10:20 UTC (rev 1029)
@@ -49,6 +49,7 @@
getElements: function() {
($(this.id)).object = this;
+ this.nodeStateInput = $(this.id + "NodeExpanded");
this.childs = [];
var childsRowId = this.id + Tree.ID_DEVIDER + Tree.ID_CHILDS_ROW;
var mainRowId = this.id + Tree.ID_DEVIDER + Tree.ID_MAIN_ROW;
@@ -117,6 +118,10 @@
Element.addClassName(this.elements.icon, Tree.CLASS_ITEM_COLLAPSED);
}
+ if (this.nodeStateInput) {
+ this.nodeStateInput.value = "false";
+ }
+
this.fireCollapsionEvent();
} else {
this.elements.handleImgExpanded.style.display="";
@@ -126,6 +131,10 @@
Element.addClassName(this.elements.icon, Tree.CLASS_ITEM_EXPANDED);
}
+ if (this.nodeStateInput) {
+ this.nodeStateInput.value = "true";
+ }
+
this.fireExpansionEvent();
}
Modified: trunk/richfaces/tree/src/main/templates/htmlTree.jspx
===================================================================
--- trunk/richfaces/tree/src/main/templates/htmlTree.jspx 2007-06-05 17:55:47 UTC (rev 1028)
+++ trunk/richfaces/tree/src/main/templates/htmlTree.jspx 2007-06-05 18:10:20 UTC (rev 1029)
@@ -18,6 +18,7 @@
/org/ajax4jsf/framework/ajax/scripts/AJAX.js,
/org/richfaces/renderkit/html/scripts/utils.js,
/org/ajax4jsf/renderkit/html/scripts/form.js,
+ /org/richfaces/renderkit/html/scripts/form.js,
/org/richfaces/renderkit/html/scripts/events.js,
/org/richfaces/renderkit/html/scripts/tree.js,
/org/richfaces/renderkit/html/scripts/tree-selection.js,
Modified: trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx 2007-06-05 17:55:47 UTC (rev 1028)
+++ trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx 2007-06-05 18:10:20 UTC (rev 1029)
@@ -37,6 +37,19 @@
<div>
<jsp:scriptlet>
<![CDATA[
+ if (org.richfaces.component.UITree.SWITCH_CLIENT.equals(component.getUITree().getSwitchType())) {
+ ]]>
+ </jsp:scriptlet>
+ <input class="dr-tree-h-input" type="hidden" id="#{clientId}NodeExpanded" name="#{clientId}NodeExpanded" value="#{this:getExpandedValue(context,component)}" />
+ <jsp:scriptlet>
+ <![CDATA[
+ }
+ ]]>
+ </jsp:scriptlet>
+
+
+ <jsp:scriptlet>
+ <![CDATA[
if (component.getUITree().isLeaf()) {
]]>
</jsp:scriptlet>
Modified: trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
===================================================================
--- trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2007-06-05 17:55:47 UTC (rev 1028)
+++ trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2007-06-05 18:10:20 UTC (rev 1029)
@@ -84,6 +84,7 @@
javaScripts.add("/org/ajax4jsf/renderkit/html/scripts/form.js");
+ javaScripts.add("/org/richfaces/renderkit/html/scripts/form.js");
javaScripts.add("/org/richfaces/renderkit/html/scripts/events.js");
javaScripts.add("/org/richfaces/renderkit/html/scripts/tree.js");
javaScripts.add("/org/richfaces/renderkit/html/scripts/tree-selection.js");
17 years, 7 months
JBoss Rich Faces SVN: r1028 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-06-05 13:55:47 -0400 (Tue, 05 Jun 2007)
New Revision: 1028
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-06-05 17:55:28 UTC (rev 1027)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-06-05 17:55:47 UTC (rev 1028)
@@ -32,7 +32,6 @@
import org.richfaces.model.SortOrder;
import org.richfaces.model.impl.ArrayDataModelExt;
import org.richfaces.model.impl.ListDataModelExt;
-import org.richfaces.model.selection.Selection;
@@ -44,24 +43,23 @@
public abstract class UIScrollableGrid extends UIRepeat implements AjaxComponent, Sortable{
- private Integer _requestedRows = new Integer(0) ;
- private Integer _dataIndex = new Integer(0);
-
- private Integer _startRow = new Integer(0);
-
private transient Collection partialUpdateChildren;
-
+
private Collection responseData = new ArrayList();
+
+ public abstract SortOrder getSortOrder();
+ public abstract void setSortOrder(SortOrder sortOrder) ;
+
+ public abstract int getDefaultRows();
+
+ public abstract void setDefaultRows(int defaultRows);
+
public Collection getResponseData() {
return responseData;
}
- public abstract SortOrder getSortOrder();
-
- public abstract void setSortOrder(SortOrder sortOrder) ;
-
public void setResponseData(Collection responseData) {
this.responseData = responseData;
}
@@ -121,37 +119,11 @@
return model;
}
- public Integer getDataIndex() {
- return _dataIndex;
- }
-
- public void setDataIndex(Integer dataIndex) {
- this._dataIndex = dataIndex;
- }
-
- public Integer getRequestedRows() {
- return _requestedRows;
- }
-
- public void setRequestedRows(Integer row_count) {
- this._requestedRows = row_count;
- }
-
- public Integer getStartRow() {
- return _startRow;
- }
-
- public void setStartRow(Integer startRow) {
- this._startRow = startRow;
- }
-
+
public Object saveState(FacesContext context) {
Object values[] = new Object[5];
values[0] = super.saveState(context);
- values[1] = _requestedRows;
- values[2] = _startRow;
- values[3] = _dataIndex;
return (Object)values;
}
@@ -160,9 +132,6 @@
Object values[] = (Object[])state;
super.restoreState(context, values[0]);
- _requestedRows = (Integer)values[1];
- _startRow = (Integer)values[2];
- _dataIndex = (Integer)values[3];
}
protected Iterator dataChildren() {
@@ -261,8 +230,15 @@
return partialUpdateChildren;
}
+
+
public void encodeEnd(FacesContext context) throws IOException {
super.encodeEnd(context);
partialUpdateChildren = null;
}
+
+ public int getRows() {
+ int rows = super.getRows();
+ return rows != 0 ? rows : getDefaultRows();
+ }
}
17 years, 7 months