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/07/07 21:09:10 UTC
svn commit: r209634 -
/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/custom/datalist/HtmlDataList.java
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();