myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kuhn, Harald" <HK...@airplus.com>
Subject RE: [Trinidad] Problem mixing c:forEach and Trinidad tr:table and tr:column
Date Fri, 05 Oct 2007 08:08:34 GMT
Hi to all, 
 
finally I found a solution. 
The exception 
java.lang.ClassNotFoundException: com.sun.facelets.tag.jstl.core.IndexedValueExpression 
org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView 
SEVERE: No structure available and no root available 
appears always when you have defined the context parameter 
<param-name>org.apache.myfaces.trinidad.CLIENT_STATE_METHOD</param-name>
<param-value>all</param-value>
in your web.xml.
As far as you remove this parameters it works as expected. 
Except for the fact that you shouldn't use inline EL expressions within the column, as this
value is rendered an addtitional time for each ppr-request.
Example:
<tr:column sortable="true"
             noWrap="true"
       sortProperty="#{forEachColumn.spalte}"
   defaultSortOrder="ascending">
  <f:facet name="header">
    <tr:outputText value="#{bundle[forEachColumn.ueberschrift.header]}" />
  </f:facet>
 
  #{tableRow[forEachColumn.spalte]}
 
  <!-- this works fine !!!
    <tr:outputText value="#{tableRow[forEachColumn.spalte]}" />
  -->
</tr:column>
 
First request:
 
 
Second request (sort):
 
Third request (paging):
 
 
If you use <tr:outputText /> it works just fine.
 
I am not sure if this is a bug of MyFaces/Trinidad or the EL-implementation (of tomcat 6.0.14).
I just want to share my experience.
 
Best regards
 
  Harald


************************************** 
Harald Kuhn 
AirPlus International 
Business Information Services 
Phone:   +49 (0) 61 02 204-821 
Fax:     +49 (0) 61 02 204-139 
E-Mail:   HKuhn@airplus.com 
Internet:   <http://www.airplus.com/> www.airplus.com 
************************************** 



Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263 Neu-Isenburg · Germany
· Geschäftsführer: Patrick W. Diemer (Vorsitz), Lutz Logemann · Vorsitzender des Aufsichtsrates:
Stephan Gemkow · Handelsregister: Amtsgericht Offenbach/Main, HRB 8119

-----Original Message-----
From: Kuhn, Harald [mailto:HKuhn@airplus.com] 
Sent: Tuesday, September 25, 2007 9:07 AM
To: MyFaces Discussion
Subject: RE: [Trinidad] Problem mixing c:forEach and Trinidad tr:table and tr:column


Hi to all, 
 
is anybody out there, who has an idea on this issue?
It is absolutely possible to reference an EL-variable (forEachColumn or forEachStatus), that
is defined by c:forEach, within 
the body or the header facet of tr:column. 
But as soon as I reference one of these EL-variables within my EL-expression for the Attribute
sortProperty the mentioned Exception is thrown.
 
Are there any differences in EL-resolving between tag-attributes and the body of a tag?
 
As I am relatively new to JSF, I want to understand, why one part works and the other won't.
For my current project it would be important to get this solution to work.
 
Any help would be appreciated.
 
Kind regards
 
  Harald Kuhn

************************************** 
Harald Kuhn 
AirPlus International 
Business Information Services 
Phone:   +49 (0) 61 02 204-821 
Fax:     +49 (0) 61 02 204-139 
E-Mail:   HKuhn@airplus.com 
Internet:   <http://www.airplus.com/> www.airplus.com 
************************************** 



Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263 Neu-Isenburg · Germany
· Geschäftsführer: Patrick W. Diemer (Vorsitz), Lutz Logemann · Vorsitzender des Aufsichtsrates:
Stephan Gemkow · Handelsregister: Amtsgericht Offenbach/Main, HRB 8119

-----Original Message-----
From: Kuhn, Harald [mailto:HKuhn@airplus.com] 
Sent: Wednesday, September 19, 2007 2:30 PM
To: MyFaces Discussion
Subject: RE:[Trinidad] Problem mixing c:forEach and Trinidad tr:table and tr:column


Hi Gregg, 
 
thanks for your reply. But this is only a typo this message as I am able to reference 
#{forEachColumn.ueberschrift.header}
in the header facet and 
#{tableRow[forEachColumn.spalte]} 
in the body of <tr:document>.
 
The Exception appears as soon as I reference the "forEachColumn" within the attribute "sortProperty"
like:
<tr:column   sortable="true" 
         sortProperty="#{forEachColumn.spalte}"> 
 
So the question is. What is the difference between EL-Expression in the body (facet) of the
<tr:column> Tag and EL-Expression within attribute definition?
 
Kind regards
 
  Harald
 
************************************** 
Harald Kuhn 
AirPlus International 
Business Information Services 
Phone:   +49 (0) 61 02 204-821 
Fax:     +49 (0) 61 02 204-139 
E-Mail:   HKuhn@airplus.com 
Internet:   <http://www.airplus.com/> www.airplus.com 
************************************** 



Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263 Neu-Isenburg · Germany
· Geschäftsführer: Patrick W. Diemer (Vorsitz), Lutz Logemann · Vorsitzender des Aufsichtsrates:
Stephan Gemkow · Handelsregister: Amtsgericht Offenbach/Main, HRB 8119

-----Original Message-----
From: Gregg Leichtman [mailto:gsl1@erols.com] 
Sent: Wednesday, September 19, 2007 1:44 PM
To: MyFaces Discussion
Subject: Re: Problem mixing c:forEach and Trinidad tr:table and tr:column


* PGP Signed by an unknown key

If the code you are using is as you show it in the message, then appear to have a syntax error
in:



 <c:forEach var="forEachColumn" 
      varStatus="forEachStatus" 
         items="#dynamicTable.rowLayout.spalten}" > 


You appear to be missing a leading brace and it should probably be:

 <c:forEach var="forEachColumn" 
      varStatus="forEachStatus" 
         items="#{dynamicTable.rowLayout.spalten}" > 

                     -=> Gregg <=-

Kuhn, Harald wrote: 

Hi to all, 
 
are there any ideas regarding this issue?
 
Best regards
 
  Harald Kuhn
 

Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263 Neu-Isenburg · Germany
· Geschäftsführer: Patrick W. Diemer (Vorsitz), Lutz Logemann · Vorsitzender des Aufsichtsrates:
Stephan Gemkow · Handelsregister: Amtsgericht Offenbach/Main, HRB 8119

-----Original Message-----
From: Kuhn, Harald [mailto:HKuhn@airplus.com] 
Sent: Monday, September 17, 2007 9:07 AM
To: users@myfaces.apache.org
Subject: Problem mixing c:forEach and Trinidad tr:table and tr:column



Hi to all, 

I' ve some problems while trying to build a table dynamically. 
We have some meta-objects (named RowLayout) that describe, 

*	which columns will be displayed 

*	which heading is used 

*	is the column sortable and what is the name of the sortProperty. 


This approach works fine, as far as I use the EL-expressions "forEachColumn" and "forEachStatus"
within the body of a tr:column tag.

But, if I try to set the attribute sortProperty with an EL-expression I get a ClassNotFoundException.

As far as I could see, the mentioned class is present in facelets.jar. 

Here is the code snippet from my Facelet: 
<!-- OK 
            <tr:column   sortable="true" 
                     sortProperty="kategorie"> 

    NOT OK: 
            <tr:column   sortable="true" 
                      sortProperty="#{forEachColumn.spalte}"> 

java.lang.ClassNotFoundException: com.sun.facelets.tag.jstl.core.IndexedValueExpression 
org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView 
SEVERE: No structure available and no root available 
org.apache.myfaces.trinidadinternal.config.xmlHttp.XmlHttpConfigurator handleError 
SEVERE: Server Exception during PPR, #19 
java.lang.NullPointerException 
--> 
<tr:table value="#{dynamicTable.data}" 
            var="tableRow" 
      varStatus="tableStatus" 
     rowBandingInterval="1" 
           rows="5" 
         noWrap="true" 
       sortable="true"> 
 <c:forEach var="forEachColumn" 
      varStatus="forEachStatus" 
         items="#dynamicTable.rowLayout.spalten}" > 
    <tr:column   sortable="true" 
                   noWrap="true" 
             sortProperty="kategorie" 
         defaultSortOrder="ascending"> 
      <f:facet name="header"> 
         #{forEachColumn.ueberschrift.header} <br /> 
      </f:facet> 
      #{tableRow[forEachColumn.spalte]} 
    </tr:column> 
  </c:forEach> 
</tr:table> 

Everything works fine, if sortProperty is a literal (and no EL-expression). 
With an EL-expression instead, I get an ClassNotFoundException followed by a NullPointerException.


Our environment is: 
myFaces         1.2.1-SNAPSHOT 
trinidad                1.2.2 
facelets                1.1.13 

My question now is: 
Why can I use EL-expression within the body of tr:column, but not to set an attribute of tr:column?


Thanks for your help. 

Harald Kuhn 


Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263 Neu-Isenburg · Germany
· Geschäftsführer: Patrick W. Diemer (Vorsitz), Lutz Logemann · Vorsitzender des Aufsichtsrates:
Stephan Gemkow · Handelsregister: Amtsgericht Offenbach/Main, HRB 8119


* Unknown Key
* 0xD6F20367


Mime
View raw message