You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2005/12/28 09:46:00 UTC
svn commit: r359446 - in /myfaces/tomahawk/trunk:
src/java/org/apache/myfaces/component/html/ext/
src/java/org/apache/myfaces/taglib/html/ext/ tld/
Author: mmarinschek
Date: Wed Dec 28 00:45:48 2005
New Revision: 359446
URL: http://svn.apache.org/viewcvs?rev=359446&view=rev
Log:
implemented partial validation dependent on button/link actionFor attribute. Resolved the uniqueIdCreation problem.
Modified:
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandButton.java
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandButton.xml
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandLink.java
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlCommandButtonTag.java
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlCommandLinkTag.java
myfaces/tomahawk/trunk/tld/tomahawk.tld
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandButton.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandButton.java?rev=359446&r1=359445&r2=359446&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandButton.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandButton.java Wed Dec 28 00:45:48 2005
@@ -49,6 +49,7 @@
private String _enabledOnUserRole = null;
private String _visibleOnUserRole = null;
+ private String _actionFor = null;
public HtmlCommandButton()
{
@@ -79,6 +80,18 @@
return vb != null ? _ComponentUtils.getStringValue(getFacesContext(), vb) : null;
}
+ public void setActionFor(String actionFor)
+ {
+ _actionFor = actionFor;
+ }
+
+ public String getActionFor()
+ {
+ if (_actionFor != null) return _actionFor;
+ ValueBinding vb = getValueBinding("actionFor");
+ return vb != null ? _ComponentUtils.getStringValue(getFacesContext(), vb) : null;
+ }
+
public boolean isRendered()
{
@@ -88,11 +101,12 @@
public Object saveState(FacesContext context)
{
- Object values[] = new Object[3];
+ Object values[] = new Object[4];
values[0] = super.saveState(context);
values[1] = _enabledOnUserRole;
values[2] = _visibleOnUserRole;
- return ((Object) (values));
+ values[3] = _actionFor;
+ return values;
}
public void restoreState(FacesContext context, Object state)
@@ -101,6 +115,7 @@
super.restoreState(context, values[0]);
_enabledOnUserRole = (String)values[1];
_visibleOnUserRole = (String)values[2];
+ _actionFor = (String) values[3];
}
//------------------ GENERATED CODE END ---------------------------------------
}
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandButton.xml
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandButton.xml?rev=359446&r1=359445&r2=359446&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandButton.xml (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandButton.xml Wed Dec 28 00:45:48 2005
@@ -14,4 +14,8 @@
<name>visibleOnUserRole</name>
<type>java.lang.String</type>
</field>
+ <field>
+ <name>actionFor</name>
+ <type>java.lang.String</type>
+ </field>
</component>
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandLink.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandLink.java?rev=359446&r1=359445&r2=359446&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandLink.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlCommandLink.java Wed Dec 28 00:45:48 2005
@@ -53,6 +53,7 @@
private String _target = null;
private String _enabledOnUserRole = null;
private String _visibleOnUserRole = null;
+ private String _actionFor = null;
public HtmlCommandLink()
{
@@ -96,6 +97,18 @@
return vb != null ? _ComponentUtils.getStringValue(getFacesContext(), vb) : null;
}
+ public void setActionFor(String actionFor)
+ {
+ _actionFor = actionFor;
+ }
+
+ public String getActionFor()
+ {
+ if (_actionFor != null) return _actionFor;
+ ValueBinding vb = getValueBinding("actionFor");
+ return vb != null ? _ComponentUtils.getStringValue(getFacesContext(), vb) : null;
+ }
+
public boolean isRendered()
{
@@ -105,12 +118,13 @@
public Object saveState(FacesContext context)
{
- Object values[] = new Object[4];
+ Object values[] = new Object[5];
values[0] = super.saveState(context);
values[1] = _target;
values[2] = _enabledOnUserRole;
values[3] = _visibleOnUserRole;
- return ((Object) (values));
+ values[4] = _actionFor;
+ return values;
}
public void restoreState(FacesContext context, Object state)
@@ -120,6 +134,7 @@
_target = (String)values[1];
_enabledOnUserRole = (String)values[2];
_visibleOnUserRole = (String)values[3];
+ _actionFor = (String)values[4];
}
//------------------ GENERATED CODE END ---------------------------------------
}
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlCommandButtonTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlCommandButtonTag.java?rev=359446&r1=359445&r2=359446&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlCommandButtonTag.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlCommandButtonTag.java Wed Dec 28 00:45:48 2005
@@ -40,12 +40,14 @@
private String _enabledOnUserRole;
private String _visibleOnUserRole;
+ private String _actionFor;
public void release() {
super.release();
_enabledOnUserRole=null;
_visibleOnUserRole=null;
+ _actionFor=null;
}
protected void setProperties(UIComponent component)
@@ -53,6 +55,7 @@
super.setProperties(component);
setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
+ setStringProperty(component, "actionFor", _actionFor);
}
public void setEnabledOnUserRole(String enabledOnUserRole)
@@ -63,6 +66,11 @@
public void setVisibleOnUserRole(String visibleOnUserRole)
{
_visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public void setActionFor(String actionFor)
+ {
+ _actionFor = actionFor;
}
}
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlCommandLinkTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlCommandLinkTag.java?rev=359446&r1=359445&r2=359446&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlCommandLinkTag.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlCommandLinkTag.java Wed Dec 28 00:45:48 2005
@@ -45,11 +45,14 @@
private String _enabledOnUserRole;
private String _visibleOnUserRole;
+ private String _actionFor;
+
public void release() {
super.release();
_enabledOnUserRole=null;
_visibleOnUserRole=null;
+ _actionFor = null;
}
protected void setProperties(UIComponent component)
@@ -57,6 +60,8 @@
super.setProperties(component);
setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
+ setStringProperty(component, "actionFor", _actionFor);
+
}
@@ -68,5 +73,10 @@
public void setVisibleOnUserRole(String visibleOnUserRole)
{
_visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public void setActionFor(String actionFor)
+ {
+ _actionFor = actionFor;
}
}
Modified: myfaces/tomahawk/trunk/tld/tomahawk.tld
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/tld/tomahawk.tld?rev=359446&r1=359445&r2=359446&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/tld/tomahawk.tld (original)
+++ myfaces/tomahawk/trunk/tld/tomahawk.tld Wed Dec 28 00:45:48 2005
@@ -21,6 +21,7 @@
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd" [
<!ENTITY display_value_only_attributes SYSTEM "entities/display_value_only_attributes.xml">
<!ENTITY ext_forceId_attribute SYSTEM "entities/ext_forceId_attribute.xml">
+<!ENTITY ext_actionfor_attribute SYSTEM "entities/ext_actionfor_attribute.xml">
<!ENTITY ext_escape_attribute SYSTEM "entities/ext_escape_attribute.xml">
<!ENTITY faces_binding_attribute SYSTEM "entities/faces_binding_attribute.xml">
<!ENTITY faces_id_optional_attribute SYSTEM "entities/faces_id_optional_attribute.xml">
@@ -219,6 +220,7 @@
&standard_command_button_attributes;
&user_role_attributes;
&ext_forceId_attribute;
+ &ext_actionfor_attribute;
</tag>
<!-- commandLink -->