What you are looking for is demonstrated in myfaces example,
openDataTable.jsp
<h:inputText rendered="#{openDataList.valueModifiable}"
value="#{openDataList.columnValue}" />
<h:outputText rendered="#{!openDataList.valueModifiable}"
value="#{openDataList.columnValue}" />
You set whether the column is editable in the backing bean.
Regards,
Yee
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 8 November 2005 3:21 PM
To: [email protected]; [EMAIL PROTECTED]
Subject: AW: Drawing first column of t:columns as outputtext, the others as
inputtext
Hi guys!
This is not the problem. I have already implemented nearly the same
structure than you did.
My problem is, that I only want to display the first row of the whole
datatable as a outputtext and the all other rows should be displayed as
inputtext.
Just imagine, I have a long Value in the 3rd row... To do this with my code,
this row would be displayed as a outputtext and not, like I want it as a
inputtext.
So is there a possibility to tell JSF, that it should only display the first
row as a outputtext?
For your imagination: (Numbers 1 should be display as outputtext, 2 and 3 as
inputtext)
1 2 3
1 2 3
1 2 3
1=Java.lang.Long
2=Java.lang.String
3=Java.lang.Long
Regards
Andy
-----Ursprüngliche Nachricht-----
Von: Yee CN [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 8. November 2005 05:51
An: 'MyFaces Discussion'
Betreff: RE: Drawing first column of t:columns as outputtext, the others
as inputtext
I have done similar, this is what I did:
<t:columns id="columns" value="#{userRolesDataModelBean.columnHeaders}"
var="columnHeader"
style="width:#{userRolesDataModelBean.columnWidth}px;text-align:
center" >
<f:facet name="header">
<h:outputText value="#{columnHeader.label}" />
</f:facet>
<h:selectBooleanCheckbox id="selboolean"
rendered="#{userRolesDataModelBean.booleanValue}"
value="#{userRolesDataModelBean.columnValue}"/>
<h:outputText rendered="#{userRolesDataModelBean.stringValue}"
value="#{userRolesDataModelBean.columnValue}"/>
</t:columns>
And the following 3 additional methods in UserRolesDataModelBean
public String getColumnDataType() {
return getColumnValue().getClass().getName();
}
public boolean isBooleanValue() {
return getColumnDataType() == "java.lang.Boolean" ;
}
public boolean isStringValue() {
return getColumnDataType() == "java.lang.String" ;
}
Regards
Yee
-----Original Message-----
From: Mike Kienenberger [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 8 November 2005 12:51 AM
To: MyFaces Discussion
Subject: Re: Drawing first column of t:columns as outputtext, the others as
inputtext
Here's an example from my own project. The first column is a row
header, and the rest of the columns are checkboxes.
<x:dataTable id="datatable"
value="#{backingBean.rowDataModel}"
var="row">
<h:column>
<h:outputText value="#{row.rowName}"/>
</h:column>
<x:columns
value="#{backingBean.columnDataModel}"
var="column">
<f:facet name="header">
<h:outputText value="#{column.columnName}"/>
</f:facet>
<h:selectBooleanCheckbox value="#{backingBean.relationshipValue}"/>
</x:columns>
</x:dataTable>
On 11/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
> Can you give me an example(code) with additional flag, so that I know it's
really the first column..
>
> Thx
> Andy
>
> -----Ursprüngliche Nachricht-----
> Von: Mathias Brökelmann [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 7. November 2005 14:59
> An: MyFaces Discussion
> Betreff: Re: Drawing first column of t:columns as outputtext, the others
> as inputtext
>
>
> either use h:column for this specific column or use some additional
> boolean flag since your boolean expression in rendered attribute can
> can be combined with boolean operators.
>
> 2005/11/7, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> >
> >
> > Hi all!
> >
> > I'm drawing a dynamic table with t:columns.
> > Is it now possible to draw the first column as a outputtext and the
second
> > and so on as Inputtext.
> > The first columns is always of type long, so I can perhaps do it like:
> >
> > <h:outputText rendered="#{userRolesBean.longValue}"
> > value="#{userRolesBean.columnValue}"/>
> >
> > But the problem is, that in the second column, there can also be a data
of
> > type long... So is it possible only to draw the first column as a
> > outputtext, no matter what datatype this column has?
> >
> > Regards
> > Andy
> > ______________________________________________________________________
> > This email and any files transmitted with it are confidential and
intended
> > solely for the use of the individual or entity to whom they are
addressed.
> > If you have received this email in error please notify your system
manager.
> > This footnote also confirms that this email message has been swept for
the
> > presence of computer viruses.
> > ______________________________________________________________________
> >
>
>
> --
> Mathias
>
>
> ______________________________________________________________________
>
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> your system manager.
>
> This footnote also confirms that this email message has been swept
> for the presence of computer viruses.
> ______________________________________________________________________
>
______________________________________________________________________
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
your system manager.
This footnote also confirms that this email message has been swept
for the presence of computer viruses.
______________________________________________________________________