JBoss Rich Faces SVN: r190 - trunk/richfaces-samples/tabPanelDemo/src/main/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-28 11:04:55 -0400 (Wed, 28 Mar 2007)
New Revision: 190
Modified:
trunk/richfaces-samples/tabPanelDemo/src/main/java/org/richfaces/Bean.java
trunk/richfaces-samples/tabPanelDemo/src/main/java/org/richfaces/TabChangeListener.java
Log:
Diagnostic printing for ValueChangeEvent added
Modified: trunk/richfaces-samples/tabPanelDemo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/richfaces-samples/tabPanelDemo/src/main/java/org/richfaces/Bean.java 2007-03-28 12:44:40 UTC (rev 189)
+++ trunk/richfaces-samples/tabPanelDemo/src/main/java/org/richfaces/Bean.java 2007-03-28 15:04:55 UTC (rev 190)
@@ -129,7 +129,9 @@
this.value3 = value3;
}
- public void valueChanged(ValueChangeEvent valueChangeEvent) {
+ public void valueChanged(ValueChangeEvent event) {
System.out.println("Bean.valueChanged()");
+ System.out.println("Old value: " + event.getOldValue());
+ System.out.println("New value: " + event.getNewValue());
}
}
\ No newline at end of file
Modified: trunk/richfaces-samples/tabPanelDemo/src/main/java/org/richfaces/TabChangeListener.java
===================================================================
--- trunk/richfaces-samples/tabPanelDemo/src/main/java/org/richfaces/TabChangeListener.java 2007-03-28 12:44:40 UTC (rev 189)
+++ trunk/richfaces-samples/tabPanelDemo/src/main/java/org/richfaces/TabChangeListener.java 2007-03-28 15:04:55 UTC (rev 190)
@@ -21,6 +21,8 @@
throws AbortProcessingException {
System.out.println("TabChangeListener.processValueChange()");
+ System.out.println("Old value: " + event.getOldValue());
+ System.out.println("New value: " + event.getNewValue());
}
}
17 years, 1 month
JBoss Rich Faces SVN: r189 - trunk/richfaces/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-03-28 08:44:40 -0400 (Wed, 28 Mar 2007)
New Revision: 189
Modified:
trunk/richfaces/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
Log:
RFA-331 fixed
Modified: trunk/richfaces/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
===================================================================
--- trunk/richfaces/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2007-03-28 11:59:03 UTC (rev 188)
+++ trunk/richfaces/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2007-03-28 12:44:40 UTC (rev 189)
@@ -73,6 +73,7 @@
showSlide: function(slide) {
if (this.current) this.current.hideContent();
var h=this.getContentHeight();
+ if (this.current) this.current.hideHeader();
slide.content.style.height=(h>0?h:0)+"px";
if (h<=1 && (this.panel.style.height=="" || this.panel.style.height.indexOf("%")!=-1)) {
@@ -166,6 +167,9 @@
hideContent: function() {
this.content.style.display="none";
this.content.firstChild.style.height="100%";
+ },
+
+ hideHeader: function() {
this.header_act.style.display="none";
this.header.style.display="";
},
17 years, 1 month
JBoss Rich Faces SVN: r188 - in trunk/richfaces-samples/dropdownmenu-sample/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-03-28 07:59:03 -0400 (Wed, 28 Mar 2007)
New Revision: 188
Modified:
trunk/richfaces-samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java
trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp
Log:
dropdownmenu development
Modified: trunk/richfaces-samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java
===================================================================
--- trunk/richfaces-samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java 2007-03-28 09:47:37 UTC (rev 187)
+++ trunk/richfaces-samples/dropdownmenu-sample/src/main/java/org/richfaces/samples/dropdownmenu/Bean.java 2007-03-28 11:59:03 UTC (rev 188)
@@ -26,7 +26,7 @@
*/
public class Bean {
- private String width = "300px";
+ private String width = "200px";
public String getWidth() {
return width;
Modified: trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp 2007-03-28 09:47:37 UTC (rev 187)
+++ trunk/richfaces-samples/dropdownmenu-sample/src/main/webapp/pages/index.jsp 2007-03-28 11:59:03 UTC (rev 188)
@@ -16,23 +16,49 @@
<h:selectOneRadio binding="#{skinBean.component}"/>
<h:commandLink action="#{skinBean.change}" value="set skin"/>
- <ddm:dropDownMenu id="dropDownMenu" popupWidth="#{bean.width}" value="Label">
- <mc:menuItem id="menuItem11" value="Active1"/>
- <mc:menuItem id="menuItem12" value="Active2"/>
- <mc:menuItem id="menuItem13" value="Active3" icon="/images/ico1.gif"/>
- <mc:menuItem id="menuItem14" value="Active4"/>
- <mc:menuItem id="menuItem15" value="Active5">
- <f:facet name="icon">
- <h:graphicImage value="/images/ico2.gif" style="vertical-align: middle; margin-right : 10px;"/>
+ <h:panelGrid id="grid" columns="2" cellspacing="4">
+ <ddm:dropDownMenu id="MenuItem1" popupWidth="#{bean.width}" value="Item1">
+ <mc:menuItem id="menuItem11" value="Active11: ajax" mode="ajax"/>
+ <mc:menuItem id="menuItem12" value="Active12"/>
+ <mc:menuItem id="menuItem13" value="Active13" icon="/images/ico1.gif"/>
+ <mc:menuItem id="menuItem14" value="Active14"/>
+ <mc:menuItem id="menuItem15" value="Active15" icon="/images/ico2.gif"/>
+
+ <mc:menuSeparator id="menuSeparator11"/>
+
+ <mc:menuItem id="menuItem16" value="Disable16" disabled="true"/>
+ <mc:menuItem id="menuItem17" value="">
+ <h:inputText value="#{bean.width}"/>
+ </mc:menuItem>
+ </ddm:dropDownMenu>
+
+ <ddm:dropDownMenu id="MenuItem2" popupWidth="#{bean.width}">
+ <f:facet name="label">
+ <f:verbatim>Item2</f:verbatim>
</f:facet>
- </mc:menuItem>
- <mc:menuSeparator id="menuSeparator1"/>
+ <mc:menuItem id="menuItem21" value="Active21: none" mode="none"/>
+ <mc:menuItem id="menuItem22" value="Active22"/>
+ <mc:menuItem id="menuItem23" value="Active23">
+ <f:facet name="icon">
+ <h:graphicImage value="/images/ico1.gif"/>
+ </f:facet>
+ </mc:menuItem>
- <mc:menuItem id="menuItem16" value="Disable6" disabled="true"/>
- <mc:menuItem id="menuItem17" value="Active7"/>
- </ddm:dropDownMenu>
+ <mc:menuItem id="menuItem24" value="Active24"/>
+ <mc:menuItem id="menuItem25" value="Active25">
+ <f:facet name="icon">
+ <h:graphicImage value="/images/ico2.gif"/>
+ </f:facet>
+ </mc:menuItem>
+ <mc:menuSeparator id="menuSeparator21"/>
+
+ <mc:menuItem id="menuItem26" value="Disable26" disabled="true"/>
+ <mc:menuItem id="menuItem27" value="Active27"/>
+ </ddm:dropDownMenu>
+ </h:panelGrid>
+
<br/>
<br/>
17 years, 1 month
JBoss Rich Faces SVN: r187 - tags/3_0_0/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pkotikov
Date: 2007-03-28 05:47:37 -0400 (Wed, 28 Mar 2007)
New Revision: 187
Modified:
tags/3_0_0/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
https://jira.exadel.com/browse/RFA-207
Fixed in IE and FF.
Modified: tags/3_0_0/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- tags/3_0_0/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-28 08:11:09 UTC (rev 186)
+++ tags/3_0_0/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-28 09:47:37 UTC (rev 187)
@@ -130,7 +130,7 @@
this.cdiv.mpUseExpr = true;
}
},
-
+
initIframe : function() {
if (this.contentWindow) {
Element.setStyle(this.contentWindow.document.body, { "margin" : "0px 0px 0px 0px" });
@@ -193,8 +193,11 @@
this.cdiv.style.top = pos + "px";
}
},
-
+
show: function(opts) {
+
+ this.setModal();
+
var options = {};
if (!this.cdiv.mpSet) {
@@ -315,6 +318,58 @@
this.id.style.visibility = "";
},
+ setModal : function(){
+ //this function removes all links and inputs from tabbing navigation
+ //if element have tabindex it value saves in component
+ var links = document.links;
+ var forms = document.forms;
+ if(links)
+ for (var i=0; i<links.length; i++)
+ if(!this.isInMP(links[i])){
+ if (links[i].tabIndex)
+ links[i].prevTabIndex = document.links[i].tabIndex;
+ links[i].tabIndex = -1;
+ }
+ if (forms)
+ for (var i=0; i<forms.length; i++)
+ for (var j=0; j<forms[i].length; j++)
+ if(!this.isInMP(forms[i][j])){
+ if (forms[i][j].tabIndex)
+ forms[i][j].prevTabIndex = forms[i][j].tabIndex;
+ forms[i][j].tabIndex = -1;
+ }
+ },
+
+ removeModal : function(){
+ //this function restores state of elements tabindex
+ var links = document.links;
+ var forms = document.forms;
+ if(links)
+ for (var i=0; i<links.length; i++)
+ if(!this.isInMP(links[i]))
+ if (links[i].prevTabIndex)
+ links[i].tabIndex = links[i].prevTabIndex;
+ else
+ links[i].tabIndex = 0;
+ if (forms)
+ for (var i=0; i<document.forms.length; i++)
+ for (var j=0; j<document.forms[i].length; j++)
+ if(!this.isInMP(document.forms[i][j]))
+ if (forms[i][j].prevTabIndex)
+ forms[i][j].tabIndex = forms[i][j].prevTabIndex;
+ else
+ forms[i][j].tabIndex = 0;
+ },
+
+ isInMP : function(elem){
+ while (elem.parentNode.tagName.toLowerCase() != "body")
+ if (elem.parentNode.id == this.id.id + "Content")
+ return true;
+ else
+ elem = elem.parentNode;
+ return false;
+ },
+
startDrag: function(border) {
for (var k = 0; k < this.borders.length; k++ ) {
//this.borders[k].hide();
@@ -329,6 +384,9 @@
},
hide: function() {
+
+ this.removeModal();
+
this.traverseSelects(true);
if (this.div.style.removeExpression) {
17 years, 1 month
JBoss Rich Faces SVN: r186 - trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-03-28 04:11:09 -0400 (Wed, 28 Mar 2007)
New Revision: 186
Modified:
trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
Log:
MenuItem component development.
Modified: trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
===================================================================
--- trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss 2007-03-28 07:57:33 UTC (rev 185)
+++ trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss 2007-03-28 08:11:09 UTC (rev 186)
@@ -6,21 +6,28 @@
<f:verbatim><![CDATA[
.dr-menu-separator {
- font-size : 0px;
- border-top: 1px solid #bfbfc0;
- margin : 2px 0px 2px 24px;
-
+ font-size : 0px;
+ border-top: 1px solid #bfbfc0;
+ margin : 2px 0px 2px 24px;
}
.dr-menu-item {
padding : 1px 35px 1px 1px;
white-space : nowrap;
position : relative;
}
+.dr-menu-item-disabled {
+ border : 1px solid transparent;
+ cursor : default;
+ color : #839eca;
+}
.dr-menu-label {
font-family : arial;
font-size : 11px;
text-decoration : none;
}
+.dr-menu-label-disabled {
+ color : #839eca;
+}
.dr-menu-item-enabled {
border : 0px solid transparent;
padding : 2px 36px 2px 2px;
@@ -30,24 +37,12 @@
cursor : pointer;
background : url(menu_item_bg.gif) repeat-x top #a9c5e7;
}
-.dr-menu-item-disabled {
- border : 1px solid transparent;
- cursor : default;
- color : #839eca;
-}
-.dr-menu-label-disabled {
- color : #839eca;
-}
.dr-menu-icon {
margin-right : 10px;
}
.dr-menu-icon img {
vertical-align: middle;
}
-.dr-menu-item a {
- color : #000000;
- text-decoration : none;
-}
.dr-menu-node {
position : absolute;
background : url(node.gif) no-repeat top;
@@ -60,7 +55,6 @@
.dr-menu-item-disabled .dr-menu-node {
background-position : bottom;
}
-
.dr-menu-list-position {
top : 17;
left: -1
17 years, 1 month
JBoss Rich Faces SVN: r185 - trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-03-28 03:57:33 -0400 (Wed, 28 Mar 2007)
New Revision: 185
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
Log:
MenuItem component development.
Modified: trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
--- trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-03-28 07:56:33 UTC (rev 184)
+++ trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2007-03-28 07:57:33 UTC (rev 185)
@@ -27,6 +27,7 @@
import javax.faces.component.UIForm;
import javax.faces.context.FacesContext;
+import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
import org.ajax4jsf.framework.renderer.ComponentVariables;
import org.ajax4jsf.framework.renderer.ComponentsVariableResolver;
import org.ajax4jsf.framework.renderer.RendererUtils;
@@ -60,11 +61,11 @@
if (menuItem.isDisabled()) {
resource = "dr-menu-item dr-menu-item-disabled rich-menu-item rich-menu-item-disabled "
- + additionalClass(menuItem, "styleClass");
+ + getStringAttributeOrEmptyString(menuItem, "styleClass");
variables.setVariable("class", resource);
resource = "dr-menu-icon dr-menu-icon-disabled rich-menu-item-icon rich-menu-item-icon-disabled "
- + additionalClass(menuItem, "iconClass");
+ + getStringAttributeOrEmptyString(menuItem, "iconClass");
variables.setVariable("iconClass", resource);
resource = "dr-menu-label dr-menu-label-disabled rich-menu-item-label rich-menu-item-label-disabled";
@@ -75,32 +76,32 @@
StringBuffer scriptValue = new StringBuffer();
scriptValue.append("this.className='dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled ")
- .append(additionalClass(menuItem, "styleClass") + "'; ");
+ .append(getStringAttributeOrEmptyString(menuItem, "styleClass") + "'; ");
if (null == getIconFacet(menuItem)) {
scriptValue.append("document.getElementById('" + menuItem.getClientId(context) + ":icon').className='dr-menu-icon rich-menu-item-icon ")
- .append(additionalClass(menuItem, "iconClass") + "'; ");
+ .append(getStringAttributeOrEmptyString(menuItem, "iconClass") + "'; ");
}
scriptValue.append("document.getElementById('" + menuItem.getClientId(context) + ":anchor').className='dr-menu-label rich-menu-item-label'; ")
- .append(additionalClass(menuItem, "onmouseout"));
+ .append(getStringAttributeOrEmptyString(menuItem, "onmouseout"));
variables.setVariable("onmouseout", scriptValue);
scriptValue = new StringBuffer();
scriptValue.append("this.className='dr-menu-item dr-menu-item-hover rich-menu-item rich-menu-item-hover ")
- .append(additionalClass(menuItem, "styleClass") + "'; ");
+ .append(getStringAttributeOrEmptyString(menuItem, "styleClass") + "'; ");
if (null == getIconFacet(menuItem)) {
scriptValue.append("document.getElementById('" + menuItem.getClientId(context) + ":icon').className='dr-menu-icon dr-menu-icon-selected rich-menu-item-icon rich-menu-item-icon-selected ")
- .append(additionalClass(menuItem, "iconClass") + "'; ");
+ .append(getStringAttributeOrEmptyString(menuItem, "iconClass") + "'; ");
}
scriptValue.append("document.getElementById('" + menuItem.getClientId(context) + ":anchor').className='dr-menu-label dr-menu-label-selected rich-menu-item-label rich-menu-item-label-selected'; ")
- .append(additionalClass(menuItem, "onmouseout"));
+ .append(getStringAttributeOrEmptyString(menuItem, "onmouseout"));
variables.setVariable("onmouseover", scriptValue);
resource = "dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled "
- + additionalClass(menuItem, "styleClass");
+ + getStringAttributeOrEmptyString(menuItem, "styleClass");
variables.setVariable("class", resource);
resource = "dr-menu-icon rich-menu-item-icon "
- + additionalClass(menuItem, "iconClass");
+ + getStringAttributeOrEmptyString(menuItem, "iconClass");
variables.setVariable("iconClass", resource);
resource = "dr-menu-label rich-menu-item-label";
@@ -109,24 +110,32 @@
resource = null;
String mode = menuItem.getMode();
+ StringBuffer onClick = new StringBuffer();
if (mode.equalsIgnoreCase(UIMenuItem.MODE_AJAX)) {
- resource = "alert('Ajax submit mode');";
+ onClick.append(AjaxRendererUtils.buildOnClick(menuItem, context));
+ //resource = "alert('Ajax submit mode');";
} else if (mode.equalsIgnoreCase(UIMenuItem.MODE_SERVER)) {
UIForm form= rendererUtils.getNestingForm(context, menuItem);
- resource = "document.getElementById('" + form.getId() + "').submit();";
+ //resource = "document.getElementById('" + form.getId() + "').submit();";
+ onClick.append("document.getElementById('" + form.getId() + "').submit();");
}
- if (resource != null) {
- variables.setVariable("onclick", resource);
+ //if (resource != null) {
+ // variables.setVariable("onclick", resource);
+ //}
+ if (onClick.length() > 0) {
+ variables.setVariable("onclick", onClick.toString());
}
}
}
- private String additionalClass(UIMenuItem menuItem, String className) {
- Object classObject = menuItem.getAttributes().get(className);
- if (null != classObject) {
- return (String) classObject;
+ protected String getStringAttributeOrEmptyString(UIComponent component, String attributeName) {
+ String attributeValue = (String) component.getAttributes().get(attributeName);
+
+ if (null == attributeValue) {
+ attributeValue = "";
}
- return "";
+
+ return attributeValue;
}
protected UIComponent getIconFacet(UIMenuItem menuItem) {
@@ -136,10 +145,7 @@
} else {
iconFacet = menuItem.getFacet("icon");
}
- if (null != iconFacet) {
- return iconFacet;
- }
- return null;
+ return iconFacet;
}
}
17 years, 1 month
JBoss Rich Faces SVN: r184 - trunk/richfaces/menu-components/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-03-28 03:56:33 -0400 (Wed, 28 Mar 2007)
New Revision: 184
Modified:
trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
Log:
MenuItem component development.
Modified: trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
--- trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2007-03-28 07:56:01 UTC (rev 183)
+++ trunk/richfaces/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2007-03-28 07:56:33 UTC (rev 184)
@@ -28,21 +28,22 @@
>
<!-- f:call name="encodeAttributeParameters" / -->
- <jsp:scriptlet><![CDATA[
- UIComponent iconFacet = getIconFacet((org.richfaces.component.UIMenuItem) component);
- if (null != iconFacet) {
- renderChild(context, iconFacet);
- } else {
- ]]></jsp:scriptlet>
- <img id="#{clientId}:icon"
- class="#{iconClass}"
- width="16"
+ <span id="#{clientId}:icon"
+ class="#{iconClass}">
+ <jsp:scriptlet><![CDATA[
+ UIComponent iconFacet = getIconFacet((org.richfaces.component.UIMenuItem) component);
+ if (null != iconFacet) {
+ renderChild(context, iconFacet);
+ } else {
+ ]]></jsp:scriptlet>
+ <img width="16"
height="16"
style="#{component.attributes['iconStyle']}"
src="#{icon}" />
- <jsp:scriptlet><![CDATA[
+ <jsp:scriptlet><![CDATA[
}
- ]]></jsp:scriptlet>
+ ]]></jsp:scriptlet>
+ </span>
<a id="#{clientId}:anchor"
href="#"
17 years, 1 month
JBoss Rich Faces SVN: r183 - trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-03-28 03:56:01 -0400 (Wed, 28 Mar 2007)
New Revision: 183
Modified:
trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
Log:
MenuItem component development.
Modified: trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss
===================================================================
--- trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss 2007-03-28 07:51:46 UTC (rev 182)
+++ trunk/richfaces/menu-components/src/main/resources/org/richfaces/renderkit/html/css/menucomponents.xcss 2007-03-28 07:56:01 UTC (rev 183)
@@ -38,10 +38,12 @@
.dr-menu-label-disabled {
color : #839eca;
}
-.dr-menu-icon {
- vertical-align: middle;
+.dr-menu-icon {
margin-right : 10px;
}
+.dr-menu-icon img {
+ vertical-align: middle;
+}
.dr-menu-item a {
color : #000000;
text-decoration : none;
17 years, 1 month
JBoss Rich Faces SVN: r182 - trunk/richfaces/dropdown-menu/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: d.bulahov
Date: 2007-03-28 03:51:46 -0400 (Wed, 28 Mar 2007)
New Revision: 182
Modified:
trunk/richfaces/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx
Log:
add "label" facet
Modified: trunk/richfaces/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx 2007-03-28 07:51:42 UTC (rev 181)
+++ trunk/richfaces/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx 2007-03-28 07:51:46 UTC (rev 182)
@@ -26,7 +26,20 @@
style="#{component.attributes['style']};"
onmouseover="this.className='dr-menu-label dr-menu-label-select rich-menu-label rich-menu-label-select'"
onmouseout="this.className='dr-menu-label dr-menu-label-unselect rich-menu-label rich-menu-label-unselect'">
- <span class="dr-label-text-decor rich-label-text-decor">#{component.attributes['value']}</span>
+ <jsp:scriptlet>
+ <![CDATA[if(component.getFacet("label")!=null && component.getFacet("label").isRendered()) {]]>
+ </jsp:scriptlet>
+ <span class="dr-label-text-decor rich-label-text-decor">
+ <u:insertFacet name="label" />
+ </span>
+ <jsp:scriptlet>
+ <![CDATA[} else {]]>
+ </jsp:scriptlet>
+ <span class="dr-label-text-decor rich-label-text-decor">#{component.attributes['value']}</span>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+
<div id="#{clientId}_menu"
style="width: #{component.attributes['popupWidth']}; visibility: hidden; z-index:100;"
class="dr-menu-list-border dr-menu-list-position rich-menu-list-border rich-menu-list-position">
17 years, 1 month
JBoss Rich Faces SVN: r181 - trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-03-28 03:51:42 -0400 (Wed, 28 Mar 2007)
New Revision: 181
Modified:
trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
Log:
method getScript added
Modified: trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
===================================================================
--- trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2007-03-28 07:48:42 UTC (rev 180)
+++ trunk/richfaces/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2007-03-28 07:51:42 UTC (rev 181)
@@ -21,8 +21,17 @@
package org.richfaces.renderkit.html;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
import org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase;
import org.richfaces.component.UIMenuGroup;
+import org.richfaces.component.UIMenuItem;
@@ -35,5 +44,48 @@
public boolean getRendersChildren() {
return true;
}
+
+ public void getScript(FacesContext context, UIComponent component) throws IOException {
+ StringBuffer buffer =
+ new StringBuffer("new Exadel.Menu.Layer('")
+ .append(component.getClientId(context))
+ .append("',")
+ .append( "300 )");
+ //component.getAttributes().get("showDelay")
+ buffer.append(".asSubMenu('")
+ .append(component.getParent().getClientId(context)+"_menu")
+ .append("','")
+ .append("ref")
+ .append(component.getClientId(context))
+ .append("')");
+
+ List children = component.getChildren();
+ for(Iterator it = children.iterator();it.hasNext();) {
+ UIComponent kid = (UIComponent)it.next();
+ String itemId = null;
+ if (kid instanceof UIMenuItem) {
+ itemId = kid.getClientId(context);
+ } else if (kid instanceof UIMenuGroup) {
+ itemId = "ref" + kid.getClientId(context);
+ }
+ if(itemId != null){
+ buffer
+ .append(".addItem('")
+ .append(itemId)
+ .append("','")
+ .append("null")
+ .append("','")
+ .append("null")
+ .append("','")
+ .append("null")
+ .append("','")
+ .append("null")
+ .append("')");
+ }
+ }
+ ResponseWriter out = context.getResponseWriter();
+ String script =buffer.append(";").toString();
+ out.write(script);
+ }
}
17 years, 1 month