myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarinsc...@apache.org
Subject svn commit: r209634 - /myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/datalist/HtmlDataList.java
Date Thu, 07 Jul 2005 19:09:10 GMT
Author: mmarinschek
Date: Thu Jul  7 12:09:07 2005
New Revision: 209634

URL: http://svn.apache.org/viewcvs?rev=209634&view=rev
Log:
added forceId functionality to DataList component directly, not to UIData where I placed it
by mistake before

Modified:
    myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/datalist/HtmlDataList.java

Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/datalist/HtmlDataList.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/datalist/HtmlDataList.java?rev=209634&r1=209633&r2=209634&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/datalist/HtmlDataList.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/datalist/HtmlDataList.java Thu
Jul  7 12:09:07 2005
@@ -15,6 +15,8 @@
  */
 package org.apache.myfaces.custom.datalist;
 
+import org.apache.myfaces.component.html.util.HtmlComponentUtils;
+
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIData;
 import javax.faces.context.FacesContext;
@@ -29,6 +31,30 @@
 public class HtmlDataList
         extends UIData
 {
+
+    public String getClientId(FacesContext context)
+    {
+        String clientId = HtmlComponentUtils.getClientId(
+                this,getRenderer(context),context);
+
+        if(clientId==null)
+        {
+            return super.getClientId(context);
+        }
+        else
+        {
+            int rowIndex = getRowIndex();
+            if (rowIndex == -1)
+            {
+                return clientId;
+            }
+            else
+            {
+                return clientId + "_" + rowIndex;
+            }
+        }
+    }
+
     public void processDecodes(FacesContext context)
     {
         int first = getFirst();



Mime
View raw message