Re: Table PPR problem when trigger Outside

2007-09-05 Thread Bandaru

Hi,
  Thanks for your reply,I tried with Following Code as you mentioned But Not
Triggered,what may be the problem?

tr:selectBooleanCheckbox label=RemoveALL 
binding=#{backing_first.removeAll} 
  id=removeAll autoSubmit=true/ 
  tr:table binding=#{backing_first.MyTable} id=MyTable  
tr:column  tr:outputText value=backing_first.removeAll.value
id=remove1 
partialTriggers=::removeAll/ /column  ... 
/tr:table 

 Please,Suggest me.


dmgloss wrote:
 
 'partialTriggers=MyTable:removeAll' will certainly have no effect in
 code snippet you provided.
 If you refer checkbox just outside of tr:table from that table's column,
 then trigger component refid should begin with ::, not some other id.
 
 
 Hi,
Yes,I tried with 'partialTriggers=MyTable:removeAll' eventhough no
 Effect.
Please let me out from this issue.
  Thanks for Reply...
 
 
 
 Vadim Dmitriev wrote:
  
  Have you by any chanсe tried 'partialTriggers=::removeAll'?
  tr:table is NamingContainer, so partialTriggers must be of special form
  when you refer components outside it from one of it's columns  (or
  components inside tr:table from outer ones).
  
  
  
  
Hi,
I have a Requirement that when i select BooleanCheckBox which is
  outside the table with autosubmit,i need to trigger the value to
 inside
  the
  Table column,
 But the Value is Not trigged,I think the problem with the
  partialTriggering ID because When i place both components in the same
  Column,working fine.
   Sample Code:
  tr:selectBooleanCheckbox label=RemoveALL 
  binding=#{backing_first.removeAll}
id=removeAll autoSubmit=true/
tr:table binding=#{backing_first.MyTable} id=MyTable 
  tr:column  tr:outputText value=backing_first.removeAll.value
  id=remove1 
  partialTriggers=removeAll/ /column  ...
  /tr:table 
  
  Please Suggest me how can rectify the Problem..
  I have seen some of the posts but this requiremnt is reverse to that.  
  
  Thanking You,
  Ramesh.
  
  -- 
  View this message in context:
 
 http://www.nabble.com/Table-PPR-problem-when-trigger-Outside-tf4370599.html#a12457228
  Sent from the MyFaces - Users mailing list archive at Nabble.com.
  
  
  
 
 -- 
 View this message in context:
 http://www.nabble.com/Table-PPR-problem-when-trigger-Outside-tf4370599.html#a12459529
 Sent from the MyFaces - Users mailing list archive at Nabble.com.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Table-PPR-problem-when-trigger-Outside-tf4370599.html#a12492217
Sent from the MyFaces - Users mailing list archive at Nabble.com.



MyFaces and Tiles

2007-09-05 Thread Chris Pratt
I'm trying to get a simple app running with MyFaces and Tiles, but
it's not working.

I have the standard web.xml file that defines the TilesListener and
MyFaces StartupServletContextListener.  It also has the
TilesDispatcherServlet (mapped to *.tiles) and the FacesServlet
(mapped to *.jsf)

My WEB-INF\tiles.xml contains one definition (note the template ends in .jsf):

 definition name=index template=/layout/layout.jsf
   put-attribute name=title value=Crash Test Dummy type=string/
   put-attribute name=bodyContent value=/body/body.jsp type=template/
 /definition

And the WEB-INF\faces-config.xml contains one navigation-rule:

 navigation-rule
   from-view-id/index.jsp/from-view-id
   navigation-case
 from-outcomesuccess/from-outcome
 to-view-id/home.jsp/to-view-id
   /navigation-case
 /navigation-rule

The welcome-file is mapped to index.jsp that simply contains:

%@ page session=false%
%@ taglib uri=http://tiles.apache.org/tags-tiles; prefix=tiles %
tiles:insertDefinition name=index/

The layout simply imports the f and tiles taglibs, encloses everything
in f:view tags and inserts the bodyContent attribute (which is a
.jsp file with only one p of text in it).

But when I try to run the attached war file I get about 8000+ lines of
stack trace that mean absolutely nothing to me.

Has anybody been able to get this working?  I'd really appreciate some
pointers, I've been struggling with this for a couple of days already.
 The war file containing everything here is at
http://www.planetpratt.com/xfer/crash.war
 Thanks
 (*Chris*)


Re: [Trinidad] panelLabelAndMessage still needs extra message tag?!

2007-09-05 Thread Matthias Wessendorf
perhaps adding Trinidad to the download page of MyFaces isn't a bad idea.
I'll do that, once 1.2.2 is released, since I have to touch that page
at that time

-Matthias

On 9/5/07, Matthias Wessendorf [EMAIL PROTECTED] wrote:
 Hi,

   Also releases and corresponding downloads seem to be a little mixed
   up currently:
  
   http://myfaces.apache.org/ has latest news about 1.0._1_ and 1.2.1
  
   If you follow the download link from that main page you'll find
   core, tomahawk, tobago, but no trinidad.
  
   If you first select trinidad project then go to downloads you'll
   find only 1.0.2 even though the release notes available on the
   trinidad project page talk about 1.0.3.
  
   The trinidad download page has a link to nightly builds, but I haven't
   found any when following that link.
 
 
  Matthias, can you look at these?

 well, the new,... they are not really synced w/ the state of releases,
 yeah, that sucks, I know.
 I'll update.

 But, there is a download page for Trinidad...

 http://myfaces.apache.org/trinidad/download.html

 that is always! up-to-date. And it mentions the 1.0.2 and 1.2.1 (1.2.2
 will be released soon)

 Greetings,
 Matthias


 
  -- Adam
 
 
   Andrew Robinson wrote:
Fixed in 1.0.3-SNAPSHOT
   
On 9/4/07, Stephen Friedrich [EMAIL PROTECTED] wrote:
After reading the tag doc for panelLabelAndMessage I would have
thought that in the following example the tr:message would not
be needed.
   
However if I omit the tr:message then on validation failure it
fails silently without ever showing a message.
   
(Trinidad 1.2.1)
   
tr:panelLabelAndMessage styleClass=inputLabel_10
  label=#{Output.BRANCH} showRequired=true
 tr:selectOneChoice id=employeeBranchId
  value=#{_employeeList.employeeBranchId} required=true
  unselectedLabel= simple=true
 f:selectItems
  value=#{_employeeList.employeeBranchItems}/
 /tr:selectOneChoice
 tr:message for=employeeBranchId/
/tr:panelLabelAndMessage
   
   
   
  
  
 
 


 --
 Matthias Wessendorf

 further stuff:
 blog: http://matthiaswessendorf.wordpress.com/
 mail: matzew-at-apache-dot-org



-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org


Re: [Trinidad] panelLabelAndMessage still needs extra message tag?!

2007-09-05 Thread Stephen Friedrich
 The simplest way I can think of is to use panelLabelAndMessage
 containing a panelHorizontalLayout with two non-simple fields,
 where you haven't set the label on either (but do set the shortDesc
 attribute for accessibility).
  
 -- Adam

Well, actually that was what I tried first.
However then the required asterisks get added to each field which
looks ugly because it makes them mis-aligned with the other fields
and it also kind of scatters asterisk around (the other are at the
very start of each field's label of course).
I'll file a jira issue.


Table model update?

2007-09-05 Thread Tobias Kilian

Hi NG!

Im using a trinidad tr:table inside my seam-application.

The Problem:

It seams, that the table model is only generated once, at the first 
attempt to render the table and doesnt change afterwards. Is this 
correct? I suppose it could be desired behavior, but that leads me into 
trouble..


The Situation:

I have a selectionList on the left side and a tr:table at the right. I 
want the tables underlying list to be one of left side's members. So the 
selectItems value is #{tableInstance.selectedMaster}, while the tables 
value attribute is #{tableInstance.selectedMaster.getSlaves()} the 
selectManyList has partialSubmit=true and is a trigger for the table, so 
that works. I can select a master on the left and see all its slaves in 
the table. However the tables model is not changing. Thats why the 
table's getSelectedRowKeys() gives me wrong indices.


Question:
is their a way to tell the tr:table to refresh its underlying model? How 
else could i accomplish this?


Many thanks,
Tobias Kilian


[Trinidad] Table model update?

2007-09-05 Thread Tobias Kilian

Hi NG!

Im using a trinidad tr:table inside my seam-application.

The Problem:

It seams, that the table model is only generated once, at the first
attempt to render the table and doesnt change afterwards. Is this
correct? I suppose it could be desired behavior, but that leads me into
trouble..

The Situation:

I have a selectionList on the left side and a tr:table at the right. I
want the tables underlying list to be one of left side's members. So the
selectItems value is #{tableInstance.selectedMaster}, while the tables
value attribute is #{tableInstance.selectedMaster.getSlaves()} the
selectManyList has partialSubmit=true and is a trigger for the table, so
that works. I can select a master on the left and see all its slaves in
the table. However the tables model is not changing. Thats why the
table's getSelectedRowKeys() gives me wrong indices.

Question:
is their a way to tell the tr:table to refresh its underlying model? How
else could i accomplish this?

Many thanks,
Tobias Kilian



Re: Tabbedpane forgets selected pane

2007-09-05 Thread radu_milos

Hello, 

Thanks for your advices, which helped me get the needed functionality.
Regards, 
Radu 


David Delbecq-2 wrote:
 
 radu_milos a écrit :
 Hello,

 Just moved from Weblogic 8.1 SP4, SUN RI 1.1 tomahawk 1.1.1. to WebLogic
 81.
 SP4, myfaces 1.5 and tomahawk 1.1.6.
 Gained some functionality but also lost some functionality :(
 I am using a tabbed pane ,  and in each pane I have an independent jsf,
 as
 it follows : 
 snip
  body bgcolor=#ff
  
  h:form id=devices
  
  h:panelGrid styleClass=tableColapse  columns=5
 columnClasses=tdBorder 
  
 1st, tabbebpane is not meaned to be used outside of a form. So a form 
 must be surrouding the tabbedpane.
 
 Second, the jsf you include inside the tabbedpane contain a body ... 
 /body tag. The behaviour of broweser when he sees nested body tag is 
 undetermined, but you sure are generating invalid html (which itself my 
 broke browser's form handling mecanisms)
 
 Lastly, tabbedpane's included jsf contains a h:form. You are not 
 suppose to use h:form inside a form based component (like tabbedpane 
 is). If you want subforms inside your tabbed pane that only validates 
 value for subform, use the sandbox's s:subform component.
 
 

-- 
View this message in context: 
http://www.nabble.com/Tabbedpane-forgets-selected-pane-tf4378844.html#a12493500
Sent from the MyFaces - Users mailing list archive at Nabble.com.



[Trinidad] about CollectionModel semantics

2007-09-05 Thread Renzo Tomaselli
Hi, I'm using tr:table since a long time, where paging through large 
data sets is implemented by my own CollectionModel.
But I still miss some logics behind CollectionModel methods I have to 
implement.
AFAIK, the overall strategy is to use getRowKey/setRowKey to enable 
content-based keys binding server model to client rendering, instead of 
plain position-based indexing. This is important in concurrent cases 
where the dataset might change across requests, and position would lead 
to wrong rows.

Then current row can be retrieved by getRowData (far from atomic, though).
But then why do we need to implement setRowIndex/getRowIndex too, which 
defeats the previous purpose, falling back to position-based keys ?
I guess that these two methods should be alternative, where 
position-based indexing should be used only for non-mutable datasets.
However I noticed that all above methods are actually called by 
component code.

Any comment will be appreciated.

-- Renzo




Re: [tobago] error not verbose enough

2007-09-05 Thread Volker Weber
Hi Zied,

the lines like
...TobagoResponseWriterImpl.endElement(235) - Element end with
name='html' doesn't match with ...

looks like related to a bug i fixed yesterday. Are there any lines like
...ButtonRenderer.encodeBegin(55) - Wrong type: Need
org.apache.myfaces.tobago.component.UIButtonCommand, but was  ...
?
if so please try latest nightly.


Regards,
Volker

2007/9/5, Zied Hamdi [EMAIL PROTECTED]:
 Hi Bernd,

 I've got good bad news :-). I'm experiencing the problem again but this time
 there are only 3 implied pages so I join them as you asked me to do...

 p.s: I've noticed some logs that complain invalid xml before the exception.
 This is probably a good hint that I mislooked yesterday.

 Here's the log



  10:04:54,125 INFO  [STDOUT] 2007-09-05 10:04:54,125 [http-127.0.0.1-8080-3]
 INFO
 org.apache.myfaces.tobago.util.DebugPhaseListener.afterPhase(65)
 - Total response time : 63 milliseconds

  10:05:17,500 ERROR [STDERR] 5 sept. 2007 10:05:17
 com.sun.facelets.tag.jsf.ComponentRule warnAttr

  ATTENTION: /person/person.xhtml @22,71 image=image/new.GIF Property
 'image' is not on type:
 org.apache.myfaces.tobago.component.UICommand

  10:05:17,500 ERROR [STDERR] 5 sept. 2007 10:05:17
 com.sun.facelets.tag.jsf.ComponentRule warnAttr

  ATTENTION: /person/person.xhtml @25,52 image=image/stop.PNG Property
 'image' is not on type:
 org.apache.myfaces.tobago.component.UICommand

  10:05:17,515 ERROR [STDERR] 5 sept. 2007 10:05:17
 com.sun.facelets.tag.jsf.ComponentRule warnAttr

  ATTENTION: /person/personDetailTabs.xhtml @10,41
 xmlns:jsp=http://java.sun.com/JSP/Page; Property '' is not on type:
 org.apache.myfaces.tobago.component.UITabGroup

  10:05:17,656 INFO  [STDOUT] 2007-09-05 10:05:17,656 [http-127.0.0.1-8080-4]
 WARN
 org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.calculateLayoutHeight
 (104) - Unbalanced layout: rows.size()=5 != layoutTokens.length=2
 rowLayout='fixed;1*;'
 (clientId='page:personForm:details:j_id15')

  10:05:17,656 INFO  [STDOUT] 2007-09-05 10:05:17,656 [http-127.0.0.1-8080-4]
 ERROR
 org.apache.myfaces.tobago.webapp.TobagoResponseWriterImpl.endElement(235)
 - Element end with name='div' doesn't match with top element on the
 stack='html' ( GridLayoutRenderer.java:368 )

  10:05:17,656 INFO  [STDOUT] 2007-09-05 10:05:17,656 [http-127.0.0.1-8080-4]
 ERROR
 org.apache.myfaces.tobago.webapp.TobagoResponseWriterImpl.endElement(235)
 - Element end with name='td' doesn't match with top element on the
 stack='div' ( GridLayoutRenderer.java:369 )

  10:05:17,656 INFO  [STDOUT] 2007-09-05 10:05:17,656 [http-127.0.0.1-8080-4]
 ERROR
 org.apache.myfaces.tobago.webapp.TobagoResponseWriterImpl.endElement(235)
 - Element end with name='tr' doesn't match with top element on the
 stack='td' ( GridLayoutRenderer.java:373 )

  10:05:17,656 INFO  [STDOUT] 2007-09-05 10:05:17,656 [http-127.0.0.1-8080-4]
 WARN
 org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.calculateLayoutHeight
 (138) - Unable to calculate Height for token '1*'! using 'fixed' ,
 component:page:personForm:details:personInfoSubview:firstName
 is Panel

  10:05:17,687 INFO  [STDOUT] 2007-09-05 10:05:17,687 [http-127.0.0.1-8080-4]
 WARN
 org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.calculateLayoutHeight
 (138) - Unable to calculate Height for token '1*'! using 'fixed' ,
 component:page:personForm:details:personInfoSubview:lastName
 is Panel

  10:05:17,687 INFO  [STDOUT] 2007-09-05 10:05:17,687 [http-127.0.0.1-8080-4]
 WARN
 org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.calculateLayoutHeight
 (138) - Unable to calculate Height for token '1*'! using 'fixed' ,
 component:page:personForm:details:personInfoSubview:firstName
 is Panel

  10:05:17,687 INFO  [STDOUT] 2007-09-05 10:05:17,687 [http-127.0.0.1-8080-4]
 WARN
 org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.GridLayoutRenderer.calculateLayoutHeight
 (138) - Unable to calculate Height for token '1*'! using 'fixed' ,
 component:page:personForm:details:personInfoSubview:lastName
 is Panel

  10:05:17,687 INFO  [STDOUT] 2007-09-05 10:05:17,687 [http-127.0.0.1-8080-4]
 WARN  org.apache.myfaces.tobago.util.LayoutInfo.update(126)
 - There are columns left but no more space! cellsLeft=1,
 tokens=fixed;fixed;1*;
 clientId='page:personForm:details:personInfoSubview:j_id21'

  10:05:17,687 INFO  [STDOUT] 2007-09-05 10:05:17,687 [http-127.0.0.1-8080-4]
 WARN  org.apache.myfaces.tobago.util.LayoutInfo.update(129)
 - calculated spaces = 20;20;-1
 clientId='page:personForm:details:personInfoSubview:j_id21'

  10:05:17,718 INFO  [STDOUT] 2007-09-05 10:05:17,718 [http-127.0.0.1-8080-4]
 ERROR
 org.apache.myfaces.tobago.webapp.TobagoResponseWriterImpl.endElement(235)
 - Element end with name='html' doesn't match with top element on the
 stack='div' ( EndElementInstruction.java:39 )

 10:05:17,718 INFO   [STDOUT] 

[tobago] assertion failure

2007-09-05 Thread Zied Hamdi
Hi,

I have an exception that I think shouldn't happen (am I doing sth wrong?,
does anybody know how to avoid it?):

Regards,
Zied

// *TODO*: remove this if block if prooven this never happens anymore

*if* (command == *null
*

 currentActionId != *null*  currentActionId.matches(.*:\\d+:.*)) {

// If currentActionId component was inside a sheet the id contains the

// rowindex and is therefore not found here.

// We do not need the row here because we want just to find the

// related form, so removing the rowindex will help here.

currentActionId = currentActionId.replaceAll(:\\d+:, :);

*try* {

command = findComponent(currentActionId);

*LOG*.info(command = \ + command + \, *new* Exception());

} *catch* (Exception e) {

// ignore

}

here's the trace

10:34:16,171 INFO  [STDOUT] 2007-09-05 10:34:16,171 [http-127.0.0.1-8080-4]
INFO  org.apache.myfaces.tobago.component.UIPage.markSubmittedForm(176) -
command = [EMAIL PROTECTED]

*java.lang.Exception*

  at org.apache.myfaces.tobago.component.UIPage.markSubmittedForm(*
UIPage.java:176*)

  at org.apache.myfaces.tobago.component.UIPage.processDecodes(*
UIPage.java:138*)

  at javax.faces.component.UIComponentBase.processDecodes(*
UIComponentBase.java:1001*)

  at javax.faces.component.UIViewRoot.processDecodes(*UIViewRoot.java
:493*)

  at org.apache.myfaces.tobago.component.UIViewRoot.processDecodes(*
UIViewRoot.java:183*)

  at
org.apache.myfaces.tobago.lifecycle.ApplyRequestValuesExecutor.execute(*
ApplyRequestValuesExecutor.java:78*)

  at org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.executePhase(*
TobagoLifecycle.java:102*)

  at org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.execute(*
TobagoLifecycle.java:72*)

  at javax.faces.webapp.FacesServlet.service(*FacesServlet.java:244*)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
ApplicationFilterChain.java:290*)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
ApplicationFilterChain.java:206*)

  at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(*
ExtensionsFilter.java:147*)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
ApplicationFilterChain.java:235*)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
ApplicationFilterChain.java:206*)

  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(*
ReplyHeaderFilter.java:96*)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
ApplicationFilterChain.java:235*)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
ApplicationFilterChain.java:206*)

  at org.apache.catalina.core.StandardWrapperValve.invoke(*
StandardWrapperValve.java:230*)

  at org.apache.catalina.core.StandardContextValve.invoke(*
StandardContextValve.java:175*)

  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(*
SecurityAssociationValve.java:179*)

  at org.jboss.web.tomcat.security.JaccContextValve.invoke(*
JaccContextValve.java:84*)

  at org.apache.catalina.core.StandardHostValve.invoke(*
StandardHostValve.java:128*)

  at org.apache.catalina.valves.ErrorReportValve.invoke(*
ErrorReportValve.java:104*)

  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(*
CachedConnectionValve.java:157*)

  at org.apache.catalina.core.StandardEngineValve.invoke(*
StandardEngineValve.java:109*)

  at org.apache.catalina.connector.CoyoteAdapter.service(*
CoyoteAdapter.java:241*)

  at org.apache.coyote.http11.Http11Processor.process(*
Http11Processor.java:844*)

  at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(*
Http11Protocol.java:580*)

  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(*JIoEndpoint.java
:447*)

  at java.lang.Thread.run(*Thread.java:619*)

-- 
Zied Hamdi
zatreex.sourceforge.net


OT: CSS namespace(name scope)

2007-09-05 Thread Dave
This is actually not a JSF question, but usually JSF people know CSS. So I 
decided to post here. Sorry if this is not appropriate.
   
  CSS file1 
  -
 .myTable {
 }
   
   
  CSS file2
  
   .myTable {
  }
   
  The class names defined in both files are the same.
  In one page, two panelGrid(s) use the same class name.
   
  h:panelGrid styleClass=myTable ..// myTable from file1
   
  h:panelGrid styleClass=myTable ..   // myTable from file2
   
  One way is to change the class names to make them unique.
  Another way is to add a parent class name before each class(class path), such 
as,
 .file1 .myTable {
 }
   
 .file2 . myTable {
 }
   
  h:panelGroup styleClass=file1
  h:panelGrid styleClass=myTable ..// myTable from file1
   
  h:panelGroup styleClass=file2
  h:panelGrid styleClass=myTable ..   // myTable from file2
   
  Both ways I need to change the CSS files.
  Is there anything like namespace(scope) so that I do not need to change the 
class names in each CSS file ?
   
  Thanks,
  David
   

   
-
Pinpoint customers who are looking for what you sell. 

[Trinidad] TreeTable - expand all.

2007-09-05 Thread Darren McEntee
Hi all,

 

I've a quick question regarding the tr:treeTable component.

What I want too do is have the option for the treeTable to be expanded
by default on specific pages on initial page loading.

I see in the treeTable has the expandAllEnabled attribute which decides
whether the Expand All  Collapse All links are rendered.

 

I don't see an option to have the tree expanded/collapsed by default on
a specific page.

Can anyone tell me if this is possible?

 

Thanks.

 

Best regards,

Darren.
 
P Please consider the environment before printing this email
_ 
 
1. The information contained in this E-mail, including any files transmitted 
with it, is confidential and may be legally privileged. This E-mail is intended 
only for the personal attention of the stated addressee(s). Any access to this 
E-mail, including any files transmitted with it, by any other person is 
unauthorised. If you are not an addressee, you must not disclose, copy, 
circulate or in any other way use or rely on the information contained in this 
E-mail or any files transmitted with it. Such unauthorised use may be unlawful. 
If you have received this E-mail in error, please inform the sender immediately 
and delete it and all copies from your system. You may not forward this E-mail 
without the permission of the sender.
 
2. The views expressed in this E-mail are those of the author, and do not 
necessarily represent the views of AMT-SYBEX. Internet communications are not 
secure and AMT-SYBEX cannot, therefore, accept legal responsibility for the 
contents of this message nor for any damage caused by viruses.
 
AMT-SYBEX Limited is a UK company, registration number GB03036807 at address 
The Spirella Building, Bridge Road, Letchworth, SG6 4ET. 
AMT-SYBEX (NI) Limited is a UK company, registration number NI024104 at address 
Edgewater Office Park, Edgewater Rd, Belfast, BT3 9JQ.
For more information on the AMT-SYBEX Group visit http://www.amt-sybex.com
_


Re: [Trinidad] Working with large tables

2007-09-05 Thread Francisco Passos
Thank you, I'll delve into this whenever such a situation arises. I'm
confident now, though.

On 9/5/07, Adam Winer [EMAIL PROTECTED] wrote:

 The model for the Trinidad table is not java.util.List.  It's
 org.apache.myfaces.trinidad.model.CollectionModel;  and
 Trinidad also supports javax.faces.model.DataModel.
 Both of these fully support large datasets.

 The Tomahawk page you refer to is 100% applicable to
 Trinidad as well, as it talks about the JSF DataModel API,
 not anything Tomahawk-specific.  If you want to support
 efficient Trinidad sorting on large datasets, you'd need to
 implement the full CollectionModel API, not just DataModel.

 -- Adam



 On 9/4/07, Francisco Passos  [EMAIL PROTECTED] wrote:
 
  Good evening.
 
  I'm wondering if there is a way to use tr:tables with large datasets
  that allows us to fetch the specific data page from the database upon
  navigation to that page, instead of having the whole list in memory.
 
  It works fine for small tables, but for tables with a couple million of
  records it could hit the server memory really hard.
 
  I know Tomahawk addresses this issue for their tables here
  http://wiki.apache.org/myfaces/WorkingWithLargeTables .
 
 
  I imagine I could just extend a java.util.List and override the
  getSize() - that coupled with the rangechangelisteners could do the trick.
  The question is: is it already done?
 
  --
  Francisco Passos
 




Re: [tobago] assertion failure

2007-09-05 Thread Volker Weber
Hi Zied,

did you have the output of this statement in the log
  LOG.debug(actionId = ' + currentActionId + ');
 just before the exception?

you  may need to set debug-level to debug for UIPage.

please post the actionId.


Regards,
Volker

2007/9/5, Zied Hamdi [EMAIL PROTECTED]:
 Hi,

 I have an exception that I think shouldn't happen (am I doing sth wrong?,
 does anybody know how to avoid it?):

 Regards,
 Zied


 // TODO: remove this if block if prooven this never happens anymore

 if (command == null

  currentActionId != null  currentActionId.matches(.*:\\d+:.* )) {

 // If currentActionId component was inside a sheet the id contains the

 // rowindex and is therefore not found here.

 // We do not need the row here because we want just to find the

 // related form, so removing the rowindex will help here.

 currentActionId = currentActionId.replaceAll(:\\d+:, :);

 try {

 command = findComponent(currentActionId);

 LOG.info(command = \ + command + \, new Exception());

 } catch (Exception e) {

 // ignore

 }

 here's the trace


 10:34:16,171 INFO  [STDOUT] 2007-09-05 10:34:16,171 [http-127.0.0.1-8080-4]
 INFO
 org.apache.myfaces.tobago.component.UIPage.markSubmittedForm(176)
 - command =
 [EMAIL PROTECTED] 

 java.lang.Exception

   at
 org.apache.myfaces.tobago.component.UIPage.markSubmittedForm
 (UIPage.java:176)

   at
 org.apache.myfaces.tobago.component.UIPage.processDecodes
 (UIPage.java:138)

   at
 javax.faces.component.UIComponentBase.processDecodes
 (UIComponentBase.java:1001)

   at javax.faces.component.UIViewRoot.processDecodes
 (UIViewRoot.java:493)

   at
 org.apache.myfaces.tobago.component.UIViewRoot.processDecodes
 (UIViewRoot.java:183)

   at
 org.apache.myfaces.tobago.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java
 :78)

at
 org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.executePhase(TobagoLifecycle.java
 :102)

at
 org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.execute(TobagoLifecycle.java
 :72)

at
 javax.faces.webapp.FacesServlet.service(FacesServlet.java:244
 )

at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java
 :290)

at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(
 ApplicationFilterChain.java:206)

   at
 org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter
 (ExtensionsFilter.java:147)

   at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
 (ApplicationFilterChain.java:235)

   at
 org.apache.catalina.core.ApplicationFilterChain.doFilter
 (ApplicationFilterChain.java:206)

   at
 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter
 (ReplyHeaderFilter.java:96)

   at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
 (ApplicationFilterChain.java:235)

   at
 org.apache.catalina.core.ApplicationFilterChain.doFilter
 (ApplicationFilterChain.java:206)

   at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230
 )

at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java
 :175)

at
 org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java
 :179)

at
 org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84
 )

at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128
 )

at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104
 )

at
 org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java
 :157)

at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109
 )

at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241
 )

at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844
 )

at
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java
 :580)

at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447
 )

   at java.lang.Thread.run (Thread.java:619 )

 --
 Zied Hamdi
 zatreex.sourceforge.net


Re: [tobago] assertion failure

2007-09-05 Thread Zied Hamdi
Hi Volker,

this is the output with UIPage in debug level:
I forgot to tell you it happens whan I click on a link in a UIData :


tc:sheet id=personData value=#{personCtrl.persons}

var=currentPerson state=#{personCtrl.sheetState} showHeader=true

binding=#{personCtrl.personTable}

columns=18px;70px;70px;100px;110px;*;18px showPageRange=center

showRowRange=right

tc:column sortable=false align=center

tc:link action=#{personCtrl.edit}

image=image/edit.PNG

/tc:link

/tc:column
the log is:

12:01:19,984 INFO [STDOUT] 2007-09-05 12:01:19,984 [http-127.0.0.1-8080-2]
DEBUG org.apache.myfaces.tobago.component.UIPage.markSubmittedForm(156) -
actionId = 'page:personForm:personTableSubview:personData:0:j_id14'

12:01:20,000 INFO [STDOUT] 2007-09-05 12:01:19,984 [http-127.0.0.1-8080-2]
INFO org.apache.myfaces.tobago.component.UIPage.markSubmittedForm(176) -
command = [EMAIL PROTECTED]
*

java.lang.Exception
*

at org.apache.myfaces.tobago.component.UIPage.markSubmittedForm(*UIPage.java
:176*)

at org.apache.myfaces.tobago.component.UIPage.processDecodes(*UIPage.java
:138*)

at javax.faces.component.UIComponentBase.processDecodes(*
UIComponentBase.java:1001*)

at javax.faces.component.UIViewRoot.processDecodes(*UIViewRoot.java:493*)

at org.apache.myfaces.tobago.component.UIViewRoot.processDecodes(*
UIViewRoot.java:183*)

at org.apache.myfaces.tobago.lifecycle.ApplyRequestValuesExecutor.execute(*
ApplyRequestValuesExecutor.java:78*)

at org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.executePhase(*
TobagoLifecycle.java:102*)

at org.apache.myfaces.tobago.lifecycle.TobagoLifecycle.execute(*
TobagoLifecycle.java:72*)

at javax.faces.webapp.FacesServlet.service(*FacesServlet.java:244*)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
ApplicationFilterChain.java:290*)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
ApplicationFilterChain.java:206*)

at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(*
ExtensionsFilter.java:147*)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
ApplicationFilterChain.java:235*)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
ApplicationFilterChain.java:206*)

at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(*
ReplyHeaderFilter.java:96*)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
ApplicationFilterChain.java:235*)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
ApplicationFilterChain.java:206*)

at org.apache.catalina.core.StandardWrapperValve.invoke(*
StandardWrapperValve.java:230*)

at org.apache.catalina.core.StandardContextValve.invoke(*
StandardContextValve.java:175*)

at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(*
SecurityAssociationValve.java:179*)

at org.jboss.web.tomcat.security.JaccContextValve.invoke(*
JaccContextValve.java:84*)

at org.apache.catalina.core.StandardHostValve.invoke(*StandardHostValve.java
:128*)

at org.apache.catalina.valves.ErrorReportValve.invoke(*ErrorReportValve.java
:104*)

at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(*
CachedConnectionValve.java:157*)

at org.apache.catalina.core.StandardEngineValve.invoke(*
StandardEngineValve.java:109*)

at org.apache.catalina.connector.CoyoteAdapter.service(*CoyoteAdapter.java
:241*)

at org.apache.coyote.http11.Http11Processor.process(*Http11Processor.java
:844*)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(*
Http11Protocol.java:580*)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(*JIoEndpoint.java:447*)

at java.lang.Thread.run(*Thread.java:619*)

12:01:20,046 INFO [STDOUT] 2007-09-05 12:01:20,046 [http-127.0.0.1-8080-2]
TRACE fr.into.common.command.CommandExecuterImpl.execute(102) - Executing
Person selector: subject: '
[EMAIL PROTECTED]',
params: 'Client: (name: 'Zied', last name: 'Hamdi')', outcome:
'null'(unfinished) : subject: '
[EMAIL PROTECTED]',
params: 'Client: (name: 'Zied', last name: 'Hamdi')', outcome: 'null'

12:01:20,046 INFO [STDOUT] Hibernate: select client0_.ID as ID0_2_,
client0_.startDate as startDate0_2_, client0_.note as note0_2_,
client0_.endDate as endDate0_2_, client0_.lastOccurence as lastOccu5_0_2_,
client0_.source_id as source12_0_2_, client0_.PERFORMER_ID as
PERFORMER11_0_2_, client0_.firstName as firstName0_2_, client0_.lastName as
lastName0_2_, client0_.entryDate as entryDate0_2_, client0_.exitDate as
exitDate0_2_, client0_.gender as gender0_2_, phones1_.person_id as
person6_4_, phones1_.id as id4_, phones1_.id as id2_0_, phones1_.type as
type2_0_, phones1_.number as number2_0_, phones1_.note as note2_0_,
phones1_.main as main2_0_, phones1_.person_id as person6_2_0_,
adresses2_.person_id as person10_5_, adresses2_.id as id5_, adresses2_.id as
id1_1_, adresses2_.type as type1_1_, adresses2_.number as number1_1_,
adresses2_.country as country1_1_, adresses2_.postalCode as postalCode1_1_,
adresses2_.street as street1_1_, adresses2_.specifier as specifier1_1_,

website for dynamic h:dataTable

2007-09-05 Thread Wolfgang Kluge
Hi,

does anyone know a good website showing an example for
dynamic h:dataTable?
The example shouldn't be too heavy ;)
I could only find examples showing NOT the Bean Class!
There for I'm a beginner it's hard to understand the code
without knowing the bean class

Cheers Wolfgang
-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger


[Tobago] Tree menu and Icon

2007-09-05 Thread yazid

Hi all;
Is it possible to build a tree menu with a various icon (one icon by user
node ).
Thanks
-- 
View this message in context: 
http://www.nabble.com/-Tobago--Tree-menu-and-Icon-tf4383436.html#a12495980
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: [Trinidad] chart component in a h:datatable leads to javax.faces.el.PropertyNotFoundException - Base is null:

2007-09-05 Thread venkata guddanti
Hi Claus,

This probably due to the fact that chart component does not implement
valueHolder interface. Currently I believe only valueHolder components can
be put inside the table. Can you use trh:tableLayout with c:forEach instead?

Venkata

On 9/3/07, Claus Elsborg Laursen [EMAIL PROTECTED] wrote:

 Hi,

 I am trying to use the tr:chart component inside a h:datatable

 But it gives an exception like this:
 javax.faces.el.PropertyNotFoundException: Base is null: campaign
 at
 org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBin
 dingImpl.java:463)
 at
 org.apache.myfaces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:25
 1)
 at
 org.apache.myfaces.application.ApplicationImpl.createComponent(Applicati
 onImpl.java:447)
 at
 javax.faces.webapp.UIComponentTag.createComponentInstance(UIComponentTag
 .java:881)
 at
 javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:768)
 at
 javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:472)
 at
 org.apache.myfaces.trinidad.webapp.UIXComponentTag.doStartTag(UIXCompone
 ntTag.java:102)


 The following jsf code has been used:

 ...
 h:form id=campaignform
 h:dataTable
 headerClass=standardtable-header-left

 rowClasses=standardtable-row-1,standardtable-row-1
  var=campaign
  value=#{IndexChartBean.campaigns}
 
 h:column
 f:facet name=header
 h:outputText
 value=#{messages.chartLabel}/
 /f:facet
 tr:outputText
 value=#{campaign.campaignChart.value.title}/
 tr:outputText
 value=#{campaign.campaignChart.chart.type}/
 tr:chart id=chart
   YMajorGridLineCount=3
 value=#{campaign.campaignChart.value}
   inlineStyle=width:680px;
 height:120px;

 binding=#{campaign.campaignChart.chart}/

 /h:column

 /h:dataTable
 /h:form
 ...

 If I remove the tr:chart part, the page works fine and the
 tr:outputText elements inserted for test are shown correctly in the
 table.

 I am also able to use the chart component outside a h:datatable
 without any problems.

 Any suggestions?

 Regards,
 Claus Elsborg




[Trinidad] tr:selectOneChoice bug

2007-09-05 Thread Luka Surija
I've found out that tr:selectOneChoice isn't working properly in some 
cases (probably German characters):


org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer

Hypo-Leasing Kärnten GmbH  Co 
KG;CoreSelectOneChoice[UIXEditableFacesBeanImpl, 
id=j_id156];_RequestID=552df7f7-a8b8-4887-a77b-8b3f864c0b01;|Could not 
find selected item matching value Hypo-Leasing Kärnten GmbH  Co KG in 
CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=j_id156]|#]



This is very serious bug because every time someone edit some data where 
is this selectOneChoice, after saving, data is lost.


Re: [Trinidad] about CollectionModel semantics

2007-09-05 Thread Simon Lessard
Hello Renzo,

Comments inline.

On 9/5/07, Renzo Tomaselli [EMAIL PROTECTED] wrote:

 Hi, I'm using tr:table since a long time, where paging through large
 data sets is implemented by my own CollectionModel.
 But I still miss some logics behind CollectionModel methods I have to
 implement.
 AFAIK, the overall strategy is to use getRowKey/setRowKey to enable
 content-based keys binding server model to client rendering, instead of
 plain position-based indexing. This is important in concurrent cases
 where the dataset might change across requests, and position would lead
 to wrong rows.


Yep, but that feature become much much more relevant with TreeModel.

Then current row can be retrieved by getRowData (far from atomic, though).
 But then why do we need to implement setRowIndex/getRowIndex too, which
 defeats the previous purpose, falling back to position-based keys ?


setRowIndex is, most of the time, faster. However, it cannot navigate
through the depth of a TreeModel. Therefore, most of the time, you use the
rowKey to select a specific element, or the first element of the depth
you're interested in and then, if you need to loop, you use setRowIndex from
0 to rowCount for faster access. Also, it's required to support those method
to be compatible with the other JSF components using JSF DataModel that
CollectionModel extends.


Hope it makes some sense,

~ Simon

I guess that these two methods should be alternative, where
 position-based indexing should be used only for non-mutable datasets.
 However I noticed that all above methods are actually called by
 component code.
 Any comment will be appreciated.

 -- Renzo





RE: [Trinidad] TreeTable - expand all.

2007-09-05 Thread Darren McEntee
Anyone know about this?

 

Thanks.

 



Sent: 05 September 2007 10:31
To: MyFaces Discussion
Subject: [Trinidad] TreeTable - expand all.

  

Hi all,

 

I've a quick question regarding the tr:treeTable component.

What I want too do is have the option for the treeTable to be expanded
by default on specific pages on initial page loading.

I see in the treeTable has the expandAllEnabled attribute which decides
whether the Expand All  Collapse All links are rendered.

 

I don't see an option to have the tree expanded/collapsed by default on
a specific page.

Can anyone tell me if this is possible?

 

Thanks.

 

Best regards,

Darren.

 

 

 

P Please consider the environment before printing this email
 
P Please consider the environment before printing this email
_ 
 
1. The information contained in this E-mail, including any files transmitted 
with it, is confidential and may be legally privileged. This E-mail is intended 
only for the personal attention of the stated addressee(s). Any access to this 
E-mail, including any files transmitted with it, by any other person is 
unauthorised. If you are not an addressee, you must not disclose, copy, 
circulate or in any other way use or rely on the information contained in this 
E-mail or any files transmitted with it. Such unauthorised use may be unlawful. 
If you have received this E-mail in error, please inform the sender immediately 
and delete it and all copies from your system. You may not forward this E-mail 
without the permission of the sender.
 
2. The views expressed in this E-mail are those of the author, and do not 
necessarily represent the views of AMT-SYBEX. Internet communications are not 
secure and AMT-SYBEX cannot, therefore, accept legal responsibility for the 
contents of this message nor for any damage caused by viruses.
 
AMT-SYBEX Limited is a UK company, registration number GB03036807 at address 
The Spirella Building, Bridge Road, Letchworth, SG6 4ET. 
AMT-SYBEX (NI) Limited is a UK company, registration number NI024104 at address 
Edgewater Office Park, Edgewater Rd, Belfast, BT3 9JQ.
For more information on the AMT-SYBEX Group visit http://www.amt-sybex.com
_


Re: [Trinidad] tr:selectOneChoice bug

2007-09-05 Thread Simon Lessard
Hello Luka,

This is not a component bug, most likely an application one (true component
bugs rarely log a warning, they more often throw an exception or, at worst,
don't print anything at all).

The error you have occurs when the list of value either cannot be restored
or changed during the postback, thus preventing the component to identify
what value was selected by the user. If you could provide the code snippet
from your page that uses the selectOneMenu as well as the managed bean code
that provide the list of values (and its scope), I would probably be able to
suggest you a solution.


Regards,

~ Simon

On 9/5/07, Luka Surija [EMAIL PROTECTED] wrote:

 I've found out that tr:selectOneChoice isn't working properly in some
 cases (probably German characters):


 org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer

 Hypo-Leasing Kärnten GmbH  Co
 KG;CoreSelectOneChoice[UIXEditableFacesBeanImpl,
 id=j_id156];_RequestID=552df7f7-a8b8-4887-a77b-8b3f864c0b01;|Could not
 find selected item matching value Hypo-Leasing Kärnten GmbH  Co KG in
 CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=j_id156]|#]


 This is very serious bug because every time someone edit some data where
 is this selectOneChoice, after saving, data is lost.



Re: [Trinidad] about CollectionModel semantics

2007-09-05 Thread Renzo Tomaselli




Thanks Simon. As a further guess - I think we have to distinguish
between phase usage of such methods.
I presume (hopefully) that position-based indexing is used only during
rendering, and *not* during restore view/update model.
In other words, we told the component to render a range [first, first +
rowsPerPage -1], and only there I expect that row retrieval occurs by
position, calling setRowIndex/getRowData/getRowKey along that range. At
that point the game is consistent, since we are still retrieving data
from the business layer.
But I expect that during restore view/update model, only
setRowKey/getRowData is used (if any updating is required), since the
business layer might have changed positions in the mean time.
Do you confirm that ?

-- Renzo

Simon Lessard wrote:

  
Hello Renzo,
  
Comments inline.
  
  On 9/5/07, Renzo Tomaselli [EMAIL PROTECTED]
wrote:
  
  Hi, I'm using tr:table since a long time, where paging
through large
data sets is implemented by my own CollectionModel.

But I still miss some logics behind CollectionModel methods I have to
implement.
AFAIK, the overall strategy is to use getRowKey/setRowKey to enable
content-based keys binding server model to client rendering, instead of

plain position-based indexing. This is important in concurrent cases
where the dataset might change across requests, and position would lead
to wrong rows.
  
Yep, but that feature become much much more relevant with TreeModel.
  
  
  
  Then current row can be retrieved by getRowData (far from
atomic, though).
But then why do we need to implement setRowIndex/getRowIndex too, which
defeats the previous purpose, falling back to position-based keys ?
  
setRowIndex is, most of the time, faster. However, it cannot navigate
through the depth of a TreeModel. Therefore, most of the time, you use
the rowKey to select a specific element, or the first element of the
depth you're interested in and then, if you need to loop, you use
setRowIndex from 0 to rowCount for faster access. Also, it's required
to support those method to be compatible with the other JSF components
using JSF DataModel that CollectionModel extends.
  
  
  
Hope it makes some sense,
  
~ Simon
  
  
  I guess that these two methods should be alternative,
where

position-based indexing should be used only for non-mutable datasets.
However I noticed that all above methods are actually called by
component code.
Any comment will be appreciated.

-- Renzo


  
  
  





Re: [tobago] error not verbose enough

2007-09-05 Thread Zied Hamdi
 Hi again,

 Here's the page structure (by facelets) if it can help.
Regards,
Zied
 UIViewRoot clientProperties=
[EMAIL PROTECTED] locale=fr_FR
renderKitId=tobago rendered=true transient=false
viewId=/person/person.xhtml
 UIPage actionId=page:personForm:personTableSubview:personData:0:j_id14
height=1243 id=page prependId=true rendered=true submitted=false
transient=false width=1891
 UIForm id=personForm prependId=true rendered=true submitted=true
transient=false  UIPanel id=j_id9 markup=[Ljava.lang.String;@12442a2
rendered=true transient=false layout UIGridLayout columns=1*
id=j_id52 ignoreFree=false rendered=true rows=300px;20px;600px;100px
transient=false/  UIBox id=j_id11 markup=[Ljava.lang.String;@192d7d0
rendered=true transient=false toolBar UIToolBar iconSize=small
id=tableToolBar labelPosition=right orientation=left rendered=true
transient=false  UICommand action=#{personCtrl.newPersonCmd}
actionExpression=#{personCtrl.newPersonCmd} defaultCommand=false
disabled=false id=newPersonCmd immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@196b73e transient=false
transition=true/  UICommand action=#{personCtrl.hideEditWindowCmd}
actionExpression=#{personCtrl.hideEditWindowCmd} defaultCommand=false
disabled=false id=stopEditingCmd immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@1d85ab9 transient=false
transition=true/ /UIToolBar  UIPanel id=personTablePanel markup=[
Ljava.lang.String;@12c4d8f rendered=true transient=false
UINamingContainer
id=personTableSubview rendered=true transient=false  UIPanel
id=j_id12 markup=[Ljava.lang.String;@197f538 rendered=true
transient=false  UIData columns=18px;70px;70px;100px;110px;*;18px
directLinkCount=9 first=0 id=personData rendered=true rowIndex=-1
rows=100 selectable=multi showDirectLinks=none showHeader=true
showPageRange=center showRowRange=right sortActionListener=
transient=false var=currentPerson binding=#{personCtrl.personTable}
pagerPage UICommand defaultCommand=false disabled=false id=ToPage
immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@1646de5
transient=false transition=true/ Next UICommand defaultCommand=false
disabled=true id=Next immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@6b0a6a transient=false
transition=true/ Last UICommand defaultCommand=false disabled=true
id=Last immediate=false rendered=true renderedPartially=[
Ljava.lang.String;@178efd5 transient=false transition=true/ Prev
UICommand
defaultCommand=false disabled=true id=Prev immediate=false
rendered=true renderedPartially=[Ljava.lang.String;@c9b2bc
transient=false transition=true/ First UICommand
defaultCommand=false disabled=true id=First immediate=false
rendered=true renderedPartially=[Ljava.lang.String;@1f58334
transient=false transition=true/ pagerRow UICommand
defaultCommand=false disabled=false id=ToRow immediate=false
rendered=true renderedPartially=[Ljava.lang.String;@1790458
transient=false transition=true/  UIColumn align=center id=j_id13
markup=[Ljava.lang.String;@c5e60 rendered=true sortable=false
transient=false  UILinkCommand action=#{personCtrl.edit}
actionExpression=#{personCtrl.edit} defaultCommand=false
disabled=false id=j_id14 immediate=false
markup=[Ljava.lang.String;@7f1ac
rendered=true renderedPartially=[Ljava.lang.String;@18b91cb
transient=false transition=true/ /UIColumn  UIColumn
id=firstNameCol label=Prénom markup=[Ljava.lang.String;@10b69b
rendered=true sortable=true transient=false sorter UICommand
defaultCommand=false disabled=false id=firstNameCol_sorter
immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@1447c32
transient=false transition=true/  UIOutput createSpan=true
escape=true id=firstName markup=[Ljava.lang.String;@135ea8e
rendered=true transient=false/ /UIColumn  UIColumn id=lastNameCol
label=Nom markup=[Ljava.lang.String;@ba4bb9 rendered=true
sortable=true transient=false sorter UICommand defaultCommand=false
disabled=false id=lastNameCol_sorter immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@c18c31 transient=false
transition=true/  UIOutput createSpan=true escape=true id=lastName
markup=[Ljava.lang.String;@dafcf2 rendered=true transient=false/
/UIColumn  UIColumn align=right id=zipCodeCol label=Code Postal
markup=[Ljava.lang.String;@11486c5 rendered=true sortable=true
transient=false sorter UICommand defaultCommand=false disabled=false
id=zipCodeCol_sorter immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@9c0287 transient=false
transition=true/  UIOutput createSpan=true escape=true id=zipCode
markup=[Ljava.lang.String;@6a21b2 rendered=true transient=false/
/UIColumn  UIColumn id=townCol label=Ville
markup=[Ljava.lang.String;@1ca337c
rendered=true sortable=true transient=false sorter UICommand
defaultCommand=false disabled=false id=townCol_sorter
immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@1fa17f0
transient=false transition=true/  UIOutput createSpan=true
escape=true id=town 

Re: [Trinidad] about CollectionModel semantics

2007-09-05 Thread Renzo Tomaselli




Simon, not sure I got it. If you use rowIndex to identify a row during
update model, how do you provide consistency ? I thought that rowKey
was introduced exactly to avoid any potential mismatch when rows have
to be reloaded from the business layer. Thus if we need to update a
field of the third row, my guess was that this CollectionModel allows
for asking the bean for that row by key - not by position 2 - which
now might lead to another row as compared to the previous rendering.

-- Renzo

Simon Lessard wrote:

  
Hello Renzo,
  
We're using it during rendering, but we're also using it during all
other phases as well and it's quite understandable. Let take a table
for example. Let say the table contains only one column with an input
inputText component nodestamp. The renderer obviously has to loop
through all elements to render all rows. All client ids will be name
spaced using tableId:rowIndex:inputId. Whatever the phase we're in, we
have to run it on every row, thus looping through all elements is again
required. Since rowKey does not provide looping API, we have to do that
usins row indexes.
  
  
Regards,
  
~ Simon
  
  On 9/5/07, Renzo Tomaselli 
[EMAIL PROTECTED] wrote:
  
Thanks Simon. As a further guess - I think we have to
distinguish
between phase usage of such methods.
I presume (hopefully) that position-based indexing is used only during
rendering, and *not* during restore view/update model.
In other words, we told the component to render a range [first, first +
rowsPerPage -1], and only there I expect that row retrieval occurs by
position, calling setRowIndex/getRowData/getRowKey along that range. At
that point the game is consistent, since we are still retrieving data
from the business layer.
But I expect that during restore view/update model, only
setRowKey/getRowData is used (if any updating is required), since the
business layer might have changed positions in the mean time.
Do you confirm that ?

-- Renzo


Simon Lessard wrote:
 Hello Renzo,
  
Comments inline.
  
  On 9/5/07, Renzo Tomaselli [EMAIL PROTECTED]
wrote: 
  Hi, I'm using tr:table since a long time, where
paging
through large
data sets is implemented by my own CollectionModel. 
But I still miss some logics behind CollectionModel methods I have to
implement.
AFAIK, the overall strategy is to use getRowKey/setRowKey to enable
content-based keys binding server model to client rendering, instead of

plain position-based indexing. This is important in concurrent cases
where the dataset might change across requests, and position would lead
to wrong rows.
  
Yep, but that feature become much much more relevant with TreeModel. 
  
  
  Then current row can be retrieved by getRowData (far
from
atomic, though).
But then why do we need to implement setRowIndex/getRowIndex too, which
defeats the previous purpose, falling back to position-based keys ?
  
setRowIndex is, most of the time, faster. However, it cannot navigate
through the depth of a TreeModel. Therefore, most of the time, you use
the rowKey to select a specific element, or the first element of the
depth you're interested in and then, if you need to loop, you use
setRowIndex from 0 to rowCount for faster access. Also, it's required
to support those method to be compatible with the other JSF components
using JSF DataModel that CollectionModel extends. 
  
  
Hope it makes some sense,
  
~ Simon
  
  
  I guess that these two methods should be alternative,
where 
position-based indexing should be used only for non-mutable datasets.
However I noticed that all above methods are actually called by
component code.
Any comment will be appreciated.

-- Renzo


  
  
  



  
  
  





Re: [Trinidad] tr:selectOneChoice bug

2007-09-05 Thread Simon Lessard
Hello Luka,

Is the method isInserting() stable? Is it possible that it returns false on
postback? Also, you cna try setting the valuePassThru attribute of the
selectOneMenu to true to see if it helps.


Regards,

~ Simon

On 9/5/07, Luka Surija [EMAIL PROTECTED] wrote:

 I'm not so sure about this. Here is my code:


 --- xhtml code snippet:

 tr:selectOneChoice readOnly=#{sessionBean.readOnly}
 label=Vinkulacija: value=#{objectBean.vinkulant}
 unselectedLabel=--- Bez vinkulacije --- 
 f:selectItems
 value=#{AdminMB.vinkulant.vinkulantsSelectItem} /
 /tr:selectOneChoice

 AdminMB.vinkulant.vinkulantsSelectItem (managed bean for selectItems):

 public SelectItem[] getVinkulantsSelectItem(){
 ListVinkulant lc=getVinkulants();
 SelectItem si[]=new SelectItem[lc.size()];
 int i=0;
 for(Vinkulant c:lc){
 si[i++]=new SelectItem(c,c.getName());
 }
 return si;
 }

 public ListVinkulant getVinkulants() {
 ListVinkulant cl=em.createQuery(select c from Vinkulant c
 order by c.name).getResultList();
 if(isInserting())
 cl.add(0,getVinkulant());
 return cl;
 }

 -
 AbstractPolicy - class where value is holded (objectBean in xhtml):

 public Vinkulant getVinkulant() {
 return vinkulant;
 }

 public void setVinkulant(Vinkulant vinkulant) {
 this.vinkulant = vinkulant;
 }

 -

 I'm sure that the value is properly stored (visible on other places).
 The problem is that only this tr:selectOneChoice for this data isn't
 showing correctly (if value is null then nothing is displayed as value
 in this component and if is there any value then the warning message
 logged on server and unselectedLabel is displayed), all other
 selectOneChoice (more then 20) in this form are working properly.



 Simon Lessard wrote:
  Hello Luka,
 
  This is not a component bug, most likely an application one (true
  component bugs rarely log a warning, they more often throw an
  exception or, at worst, don't print anything at all).
 
  The error you have occurs when the list of value either cannot be
  restored or changed during the postback, thus preventing the component
  to identify what value was selected by the user. If you could provide
  the code snippet from your page that uses the selectOneMenu as well as
  the managed bean code that provide the list of values (and its scope),
  I would probably be able to suggest you a solution.
 
 
  Regards,
 
  ~ Simon
 
  On 9/5/07, *Luka Surija* [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  I've found out that tr:selectOneChoice isn't working properly in
 some
  cases (probably German characters):
 
 
 org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SimpleSelectOneRenderer
 
  Hypo-Leasing Kärnten GmbH  Co
  KG;CoreSelectOneChoice[UIXEditableFacesBeanImpl,
  id=j_id156];_RequestID=552df7f7-a8b8-4887-a77b-8b3f864c0b01;|Could
 not
  find selected item matching value Hypo-Leasing Kärnten GmbH  Co
  KG in
  CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=j_id156]|#]
 
 
  This is very serious bug because every time someone edit some data
  where
  is this selectOneChoice, after saving, data is lost.
 
 




Re: [Tobago] EmptyStackException in datepicker

2007-09-05 Thread Helmut Swaczinna

Hi,

when the datepicker should be opened for the first time the UIComponent for 
the datepicker can not
be found in AjaxUtils.parseAndStoreComponents() line 147. When the popup is 
openend a second time

the UIComponent can be found (with the same id).

Regards,
   Helmut

- Original Message - 
From: Helmut Swaczinna [EMAIL PROTECTED]

To: MyFaces Discussion users@myfaces.apache.org
Sent: Tuesday, September 04, 2007 3:59 PM
Subject: Re: [Tobago] EmptyStackException in datepicker



Hi Volker,

yes, a request is made. This is the only debug output (with 
org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer enabled):


AjaxUtils ajaxComponentIds = 
mainPage:tabsView:meineAufgabenView:meineAufgabenSheet:0:ablaufdatumPopup:ablaufdatum_pickerpopup

ComponentUtil idRemainder = :0:ablaufdatumPopup:_idJsp59
ComponentUtil set rowIndex = 0

Seems there's no response.

Regards
   Helmut

- Original Message - 
From: Volker Weber [EMAIL PROTECTED]

To: MyFaces Discussion users@myfaces.apache.org
Sent: Tuesday, September 04, 2007 3:47 PM
Subject: Re: [Tobago] EmptyStackException in datepicker



Hi Helmut,

the problem with the popups in wrong order is a known issue:
https://issues.apache.org/jira/browse/TOBAGO-133 / -134

The other (nothing happen after first click) must be a other Problem.

Can you see if a request is made after the first click and what the 
response is?


You can set the debug level of
org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer
to trace to get the full response in the logs.


Regards,
   Volker



2007/9/4, Helmut Swaczinna [EMAIL PROTECTED]:

Hi Volker,

thanks, the datepicker works now in general.

But I have very strange effects with the datepicker in a special use 
case.


I have a sheet with a link in one column which opens a popup. And this 
popup

has a date field and a datepicker.
The first time I click on the picker image on the popup after the page 
was

loaded for the first time nothing
happens. The datepicker doesn't open. When I close the popup and reopen 
it

and then click on the
picker image the datepicker opens but *behind* the popup, so it is not
accessable (see attachted scrennshot).
I have to close the popup first and then I can close the datepicker. 
When I

open the popup for the third time and
click on the picker image the datepicker opens normally and everything 
works

fine. To summarize: I must open
the popup three times after the page is initially loaded to make the
datepicker working.

Unfortunately I can't reproduce this behaviour in a small example.

Here is an extract from my jsp page:

  tc:sheet id=meineAufgabenSheet
columns=30px;80px;80px;70px;65px;165px;60px;100px
showHeader=true
showRowRange=none
showPageRange=none
showDirectLinks=none
first=0
rows=1000
selectable=multi
value=#{mainController.meineAufgaben}
var=aufgabe
binding=#{mainController.sheetMeineAufgaben}
state=#{mainController.sheetStateMeineAufgaben}
f:facet name=popup
  tc:popup id=ablaufdatumPopup width=300px height=150px
tc:box label=#{aufgabenBundle.box_label_ablaufdatum}
  f:facet name=layout 
tc:gridLayout rows=*;fixed;10px;fixed 
columns=*;*;*/

  /f:facet
  tc:cell spanX=3
tc:out escape=false
  value=#{aufgabenBundle.out_value_ablaufdatum}/
  /tc:cell

  tc:label 
value=#{aufgabenBundle.label_value_ablaufdatum}/

  tc:date id=ablaufdatum
required=true
value=#{mainController.ablaufdatum}/
  tc:datePicker for=ablaufdatum/

  tc:cell spanX=3/

  tc:cell/
  tc:button id=okButton
label=#{mainBundle.button_label_ok}
action=#{mainController.ablaufAction}
tc:attribute name=popupClose value=afterSubmit/
  /tc:button
  tc:button id=cancelButton
label=#{mainBundle.button_label_cancel}
tc:attribute name=popupClose value=immediate/
  /tc:button
/tc:box
  /tc:popup
/f:facet
...
tc:column id=ablaufColumn
  label=#{aufgabenBundle.column_label_ablauf}
  tip=#{aufgabenBundle.column_tip_ablauf}
  sortable=true
  tc:link id=ablaufLink
action=#{mainController.ablaufPopupAction}
tc:out id=ablauf
  value=#{aufgabe.ablauf}/
tc:popupReference for=ablaufdatumPopup/
tc:attribute name=renderedPartially
value=:mainPage:tabsView:meineAufgabenView:meineAufgabenSheet:ablaufdatumPopup/
  /tc:link
/tc:column
...
  /tc:sheet

Regards,
Helmut


- Original Message -
From: Volker Weber [EMAIL PROTECTED]
To: MyFaces Discussion users@myfaces.apache.org
Sent: Tuesday, September 04, 2007 1:39 PM

If in myFaces/Tomahwak

2007-09-05 Thread daniel ccss
Hi all,

I have one question, how can I do an IF in a JSP wit myFaces/Tomahawk? In
struts I used logic:equal or logic:notEqual, which is the tag in
myFaces/Tomahawk to do that, I don´t want to use this: % if(...)... {% %
else(...)... {%

thanks!!!


Re: [Trinidad] about CollectionModel semantics

2007-09-05 Thread Simon Lessard
Hello Renzo,

There's an InternalState that we use to keep the mapping toward the rowKey
during those phases to handle that issue.


Regards,

~ Simon

On 9/5/07, Renzo Tomaselli [EMAIL PROTECTED] wrote:

  Simon, not sure I got it. If you use rowIndex to identify a row during
 update model, how do you provide consistency ? I thought that rowKey was
 introduced exactly to avoid any potential mismatch when rows have to be
 reloaded from the business layer. Thus if we need to update a field of the
 third row, my guess was that this CollectionModel allows for asking the bean
 for that row by key - not by position  2 - which now might lead to another
 row as compared to the previous rendering.

 -- Renzo

 Simon Lessard wrote:

 Hello Renzo,

 We're using it during rendering, but we're also using it during all other
 phases as well and it's quite understandable. Let take a table for example.
 Let say the table contains only one column with an input inputText component
 nodestamp. The renderer obviously has to loop through all elements to render
 all rows. All client ids will be name spaced using tableId:rowIndex:inputId.
 Whatever the phase we're in, we have to run it on every row, thus looping
 through all elements is again required. Since rowKey does not provide
 looping API, we have to do that usins row indexes.


 Regards,

 ~ Simon

 On 9/5/07, *Renzo Tomaselli*  [EMAIL PROTECTED] wrote:

 Thanks Simon. As a further guess - I think we have to distinguish between
 phase usage of such methods.
 I presume (hopefully) that position-based indexing is used only during
 rendering, and *not* during restore view/update model.
 In other words, we told the component to render a range [first, first +
 rowsPerPage -1], and only there I expect that row retrieval occurs by
 position, calling setRowIndex/getRowData/getRowKey along that range. At that
 point the game is consistent, since we are still retrieving data from the
 business layer.
 But I expect that during restore view/update model, only
 setRowKey/getRowData is used (if any updating is required), since the
 business layer might have changed positions in the mean time.
 Do you confirm that ?

 -- Renzo

 Simon Lessard wrote:

 Hello Renzo,

 Comments inline.

 On 9/5/07, *Renzo Tomaselli* [EMAIL PROTECTED] wrote:

 Hi, I'm using tr:table since a long time, where paging through large
 data sets is implemented by my own CollectionModel.
 But I still miss some logics behind CollectionModel methods I have to
 implement.
 AFAIK, the overall strategy is to use getRowKey/setRowKey to enable
 content-based keys binding server model to client rendering, instead of
 plain position-based indexing. This is important in concurrent cases
 where the dataset might change across requests, and position would lead
 to wrong rows.


 Yep, but that feature become much much more relevant with TreeModel.

 Then current row can be retrieved by getRowData (far from atomic, though).
 But then why do we need to implement setRowIndex/getRowIndex too, which
 defeats the previous purpose, falling back to position-based keys ?


 setRowIndex is, most of the time, faster. However, it cannot navigate
 through the depth of a TreeModel. Therefore, most of the time, you use the
 rowKey to select a specific element, or the first element of the depth
 you're interested in and then, if you need to loop, you use setRowIndex from
 0 to rowCount for faster access. Also, it's required to support those method
 to be compatible with the other JSF components using JSF DataModel that
 CollectionModel extends.


 Hope it makes some sense,

 ~ Simon

 I guess that these two methods should be alternative, where
 position-based indexing should be used only for non-mutable datasets.
 However I noticed that all above methods are actually called by
 component code.
 Any comment will be appreciated.

 -- Renzo







Re: [Trinidad] tr:selectOneChoice bug

2007-09-05 Thread Luka Surija
isInserting is stable. It is used in another part of application, and 
has nothing to do with this part (it is always false).  No luck with 
valuePassThru. It is really funny because 3 lines before in the same 
xhtml I have this code snippet and it's working correctly as expected:


tr:selectOneChoice readOnly=#{sessionBean.readOnly} label=Podrucje 
plovidbe: value=#{objectBean.navigationArea} 
   f:selectItems 
value=#{AdminMB.navigationArea.navigationAreasSelectItem} /

/tr:selectOneChoice

AdminMB.navigationArea.navigationAreasSelectItem:
   public SelectItem[] getNavigationAreasSelectItem(){
   ListNavigationArea lc=getNavigationAreas();
   SelectItem si[]=new SelectItem[lc.size()];
   int i=0;
   for(NavigationArea c:lc){
   si[i++]=new SelectItem(c,c.getNameHR());
   }
   return si;
   }

   public ListNavigationArea getNavigationAreas() {
   ListNavigationArea nal=em.createQuery(select c from 
NavigationArea c order by c.nameHR).getResultList();

   if(isInserting())
   nal.add(0,getNavigationArea());
   return nal;
   }
-
AbstractPolicy - class where value is holded (objectBean in xhtml):

public NavigationArea getNavigationArea() {
   return navigationArea
}

public void setNavigationArea(NavigationArea navigationArea {
   this.navigationArea = navigationArea;
}

-

Is there any possibility that there are some issues with facelets and 
what is recommended version (I'm working with 1.1.12). I've also noticed 
following issues with facelets:


- duplicate id in tr:showDetail after expanding
- from time to time (unreproducible for me) ui:param inside ui:include 
is not assigned. Example:

ui:include src=my.xhtml
   ui:param name=objectBean value=#{ManagedBean.myObject} /
/ui:include

Sometime objectBean is null inside my.xhtml, but ManagedBean.myObject is 
not ?!


So is there any other know issue between facelets and trinidad?

Regards,
Luka

Simon Lessard wrote:

Hello Luka,

Is the method isInserting() stable? Is it possible that it returns 
false on postback? Also, you cna try setting the valuePassThru 
attribute of the selectOneMenu to true to see if it helps.



Regards,

~ Simon

On 9/5/07, *Luka Surija* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


I'm not so sure about this. Here is my code:


--- xhtml code snippet:

tr:selectOneChoice readOnly=#{sessionBean.readOnly}
label=Vinkulacija: value=#{objectBean.vinkulant }
unselectedLabel=--- Bez vinkulacije --- 
f:selectItems
value=#{AdminMB.vinkulant.vinkulantsSelectItem} /
/tr:selectOneChoice

AdminMB.vinkulant.vinkulantsSelectItem (managed bean for selectItems):

public SelectItem[] getVinkulantsSelectItem(){
ListVinkulant lc=getVinkulants();
SelectItem si[]=new SelectItem[lc.size()];
int i=0;
for(Vinkulant c:lc){
si[i++]=new SelectItem(c,c.getName());
}
return si;
}

public ListVinkulant getVinkulants() {
ListVinkulant cl=em.createQuery(select c from Vinkulant c
order by c.name http://c.name).getResultList();
if(isInserting())
cl.add(0,getVinkulant());
return cl;
}

-
AbstractPolicy - class where value is holded (objectBean in xhtml):

public Vinkulant getVinkulant() {
return vinkulant;
}

public void setVinkulant(Vinkulant vinkulant) {
this.vinkulant = vinkulant;
}

-

I'm sure that the value is properly stored (visible on other places).
The problem is that only this tr:selectOneChoice for this data isn't
showing correctly (if value is null then nothing is displayed as value
in this component and if is there any value then the warning message
logged on server and unselectedLabel is displayed), all other
selectOneChoice (more then 20) in this form are working properly.



Simon Lessard wrote:
 Hello Luka,

 This is not a component bug, most likely an application one (true
 component bugs rarely log a warning, they more often throw an
 exception or, at worst, don't print anything at all).

 The error you have occurs when the list of value either cannot be
 restored or changed during the postback, thus preventing the
component
 to identify what value was selected by the user. If you could
provide
 the code snippet from your page that uses the selectOneMenu as
well as
 the managed bean code that provide the list of values (and its
scope),
 I would probably be able to suggest you a solution.


 Regards,

 ~ Simon

 On 9/5/07, 

Re: [Trinidad] about CollectionModel semantics

2007-09-05 Thread Renzo Tomaselli




Simon, ok but the point is that the CollectionModel I have to publish
is directly called to set/get rowIndex, and from the provided value it
has to go to the business layer. I would expect that such InternalState
should hide position-based calls on my model, using only keys. I miss
the reason of getting both kind of calls, which was my original
question.
If the model is requested to set rowIndex to some value, which record
should if safely go to ?
On another side, row selection works through keys only (RowKeySet) and
that's nice. But model updating seems to work also on positions.

-- Renzo

Simon Lessard wrote:

  
Hello Renzo,
  
There's an InternalState that we use to keep the mapping toward the
rowKey during those phases to handle that issue.
  
  
Regards,
  
~ Simon
  
  On 9/5/07, Renzo Tomaselli [EMAIL PROTECTED]
wrote:
  
Simon, not sure I got it. If you use rowIndex to identify a
row during
update model, how do you provide consistency ? I thought that rowKey
was introduced exactly to avoid any potential mismatch when rows have
to be reloaded from the business layer. Thus if we need to update a
field of the third row, my guess was that this CollectionModel allows
for asking the bean for that row by key - not by position 2 - which
now might lead to another row as compared to the previous rendering.


-- Renzo

Simon Lessard wrote:
 Hello Renzo,
  
We're using it during rendering, but we're also using it during all
other phases as well and it's quite understandable. Let take a table
for example. Let say the table contains only one column with an input
inputText component nodestamp. The renderer obviously has to loop
through all elements to render all rows. All client ids will be name
spaced using tableId:rowIndex:inputId. Whatever the phase we're in, we
have to run it on every row, thus looping through all elements is again
required. Since rowKey does not provide looping API, we have to do that
usins row indexes.
  
  
Regards,
  
~ Simon
  
  On 9/5/07, Renzo Tomaselli 
[EMAIL PROTECTED] wrote:
  
Thanks Simon. As a further guess - I think we have to
distinguish
between phase usage of such methods.
I presume (hopefully) that position-based indexing is used only during
rendering, and *not* during restore view/update model.
In other words, we told the component to render a range [first, first +
rowsPerPage -1], and only there I expect that row retrieval occurs by
position, calling setRowIndex/getRowData/getRowKey along that range. At
that point the game is consistent, since we are still retrieving data
from the business layer.
But I expect that during restore view/update model, only
setRowKey/getRowData is used (if any updating is required), since the
business layer might have changed positions in the mean time.
Do you confirm that ?

-- Renzo


Simon Lessard wrote:
 Hello Renzo,
  
Comments inline.
  
  On 9/5/07, Renzo Tomaselli [EMAIL PROTECTED]
wrote: 
  Hi, I'm using tr:table since a long time, where
paging
through large
data sets is implemented by my own CollectionModel. 
But I still miss some logics behind CollectionModel methods I have to
implement.
AFAIK, the overall strategy is to use getRowKey/setRowKey to enable
content-based keys binding server model to client rendering, instead of

plain position-based indexing. This is important in concurrent cases
where the dataset might change across requests, and position would lead
to wrong rows.
  
Yep, but that feature become much much more relevant with TreeModel. 
  
  
  Then current row can be retrieved by getRowData
(far
from
atomic, though).
But then why do we need to implement setRowIndex/getRowIndex too, which
defeats the previous purpose, falling back to position-based keys ?
  
setRowIndex is, most of the time, faster. However, it cannot navigate
through the depth of a TreeModel. Therefore, most of the time, you use
the rowKey to select a specific element, or the first element of the
depth you're interested in and then, if you need to loop, you use
setRowIndex from 0 to rowCount for faster access. Also, it's required
to support those method to be compatible with the other JSF components
using JSF DataModel that CollectionModel extends. 
  
  
Hope it makes some sense,
  
~ Simon
  
  
  I guess that these two methods should be
alternative,
where 
position-based indexing should be used only for non-mutable datasets.
However I noticed that all above methods are actually called by
component code.
Any comment will be appreciated.

-- Renzo


  
  
  



  
  
  



  
  
  





Re: [tobago] error not verbose enough

2007-09-05 Thread Bernd Bohmann

Hello Zied,

can you send the complete web application, please.
(to my personal account)

Regards

Bernd



Zied Hamdi wrote:

 Hi again,

 Here's the page structure (by facelets) if it can help.
Regards,
Zied
 UIViewRoot clientProperties=
[EMAIL PROTECTED] locale=fr_FR
renderKitId=tobago rendered=true transient=false
viewId=/person/person.xhtml
 UIPage actionId=page:personForm:personTableSubview:personData:0:j_id14
height=1243 id=page prependId=true rendered=true submitted=false
transient=false width=1891
 UIForm id=personForm prependId=true rendered=true submitted=true
transient=false  UIPanel id=j_id9 markup=[Ljava.lang.String;@12442a2
rendered=true transient=false layout UIGridLayout columns=1*
id=j_id52 ignoreFree=false rendered=true rows=300px;20px;600px;100px
transient=false/  UIBox id=j_id11 markup=[Ljava.lang.String;@192d7d0
rendered=true transient=false toolBar UIToolBar iconSize=small
id=tableToolBar labelPosition=right orientation=left rendered=true
transient=false  UICommand action=#{personCtrl.newPersonCmd}
actionExpression=#{personCtrl.newPersonCmd} defaultCommand=false
disabled=false id=newPersonCmd immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@196b73e transient=false
transition=true/  UICommand action=#{personCtrl.hideEditWindowCmd}
actionExpression=#{personCtrl.hideEditWindowCmd} defaultCommand=false
disabled=false id=stopEditingCmd immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@1d85ab9 transient=false
transition=true/ /UIToolBar  UIPanel id=personTablePanel markup=[
Ljava.lang.String;@12c4d8f rendered=true transient=false
UINamingContainer
id=personTableSubview rendered=true transient=false  UIPanel
id=j_id12 markup=[Ljava.lang.String;@197f538 rendered=true
transient=false  UIData columns=18px;70px;70px;100px;110px;*;18px
directLinkCount=9 first=0 id=personData rendered=true rowIndex=-1
rows=100 selectable=multi showDirectLinks=none showHeader=true
showPageRange=center showRowRange=right sortActionListener=
transient=false var=currentPerson binding=#{personCtrl.personTable}
pagerPage UICommand defaultCommand=false disabled=false id=ToPage
immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@1646de5
transient=false transition=true/ Next UICommand defaultCommand=false
disabled=true id=Next immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@6b0a6a transient=false
transition=true/ Last UICommand defaultCommand=false disabled=true
id=Last immediate=false rendered=true renderedPartially=[
Ljava.lang.String;@178efd5 transient=false transition=true/ Prev
UICommand
defaultCommand=false disabled=true id=Prev immediate=false
rendered=true renderedPartially=[Ljava.lang.String;@c9b2bc
transient=false transition=true/ First UICommand
defaultCommand=false disabled=true id=First immediate=false
rendered=true renderedPartially=[Ljava.lang.String;@1f58334
transient=false transition=true/ pagerRow UICommand
defaultCommand=false disabled=false id=ToRow immediate=false
rendered=true renderedPartially=[Ljava.lang.String;@1790458
transient=false transition=true/  UIColumn align=center id=j_id13
markup=[Ljava.lang.String;@c5e60 rendered=true sortable=false
transient=false  UILinkCommand action=#{personCtrl.edit}
actionExpression=#{personCtrl.edit} defaultCommand=false
disabled=false id=j_id14 immediate=false
markup=[Ljava.lang.String;@7f1ac
rendered=true renderedPartially=[Ljava.lang.String;@18b91cb
transient=false transition=true/ /UIColumn  UIColumn
id=firstNameCol label=Prénom markup=[Ljava.lang.String;@10b69b
rendered=true sortable=true transient=false sorter UICommand
defaultCommand=false disabled=false id=firstNameCol_sorter
immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@1447c32
transient=false transition=true/  UIOutput createSpan=true
escape=true id=firstName markup=[Ljava.lang.String;@135ea8e
rendered=true transient=false/ /UIColumn  UIColumn id=lastNameCol
label=Nom markup=[Ljava.lang.String;@ba4bb9 rendered=true
sortable=true transient=false sorter UICommand defaultCommand=false
disabled=false id=lastNameCol_sorter immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@c18c31 transient=false
transition=true/  UIOutput createSpan=true escape=true id=lastName
markup=[Ljava.lang.String;@dafcf2 rendered=true transient=false/
/UIColumn  UIColumn align=right id=zipCodeCol label=Code Postal
markup=[Ljava.lang.String;@11486c5 rendered=true sortable=true
transient=false sorter UICommand defaultCommand=false disabled=false
id=zipCodeCol_sorter immediate=false rendered=true
renderedPartially=[Ljava.lang.String;@9c0287 transient=false
transition=true/  UIOutput createSpan=true escape=true id=zipCode
markup=[Ljava.lang.String;@6a21b2 rendered=true transient=false/
/UIColumn  UIColumn id=townCol label=Ville
markup=[Ljava.lang.String;@1ca337c
rendered=true sortable=true transient=false sorter UICommand
defaultCommand=false disabled=false id=townCol_sorter
immediate=false rendered=true

Re: [Trinidad] tr:selectOneChoice bug

2007-09-05 Thread Simon Lessard
Odd... I'll think a bit about it, but I don't see what could cause the
problem then. Can you add a log in your getListOfValues method and see if
the value Hypo-Leasing Kärnten GmbH  Co KG exists in it?

As a side note comment though, you could cache the list of values for the
length of the request (or clear it at some point if you know it changed) to
improve performance a bit, as the method might be called more than once, but
that shouldn't fix your issue though.


Regards,

~ Simon

On 9/5/07, Luka Surija [EMAIL PROTECTED] wrote:

 isInserting is stable. It is used in another part of application, and
 has nothing to do with this part (it is always false).  No luck with
 valuePassThru. It is really funny because 3 lines before in the same
 xhtml I have this code snippet and it's working correctly as expected:

 tr:selectOneChoice readOnly=#{sessionBean.readOnly} label=Podrucje
 plovidbe: value=#{objectBean.navigationArea} 
 f:selectItems
 value=#{AdminMB.navigationArea.navigationAreasSelectItem} /
 /tr:selectOneChoice

 AdminMB.navigationArea.navigationAreasSelectItem:
 public SelectItem[] getNavigationAreasSelectItem(){
 ListNavigationArea lc=getNavigationAreas();
 SelectItem si[]=new SelectItem[lc.size()];
 int i=0;
 for(NavigationArea c:lc){
 si[i++]=new SelectItem(c,c.getNameHR());
 }
 return si;
 }

 public ListNavigationArea getNavigationAreas() {
 ListNavigationArea nal=em.createQuery(select c from
 NavigationArea c order by c.nameHR).getResultList();
 if(isInserting())
 nal.add(0,getNavigationArea());
 return nal;
 }
 -
 AbstractPolicy - class where value is holded (objectBean in xhtml):

 public NavigationArea getNavigationArea() {
 return navigationArea
 }

 public void setNavigationArea(NavigationArea navigationArea {
 this.navigationArea = navigationArea;
 }

 -

 Is there any possibility that there are some issues with facelets and
 what is recommended version (I'm working with 1.1.12). I've also noticed
 following issues with facelets:

 - duplicate id in tr:showDetail after expanding
 - from time to time (unreproducible for me) ui:param inside ui:include
 is not assigned. Example:
 ui:include src=my.xhtml
 ui:param name=objectBean value=#{ManagedBean.myObject} /
 /ui:include

 Sometime objectBean is null inside my.xhtml, but ManagedBean.myObject is
 not ?!

 So is there any other know issue between facelets and trinidad?


Some small ones, but none that hindering to my knowledge.

Regards,
 Luka

 Simon Lessard wrote:
  Hello Luka,
 
  Is the method isInserting() stable? Is it possible that it returns
  false on postback? Also, you cna try setting the valuePassThru
  attribute of the selectOneMenu to true to see if it helps.
 
 
  Regards,
 
  ~ Simon
 
  On 9/5/07, *Luka Surija* [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  I'm not so sure about this. Here is my code:
 
 
  --- xhtml code snippet:
 
  tr:selectOneChoice readOnly=#{sessionBean.readOnly}
  label=Vinkulacija: value=#{objectBean.vinkulant }
  unselectedLabel=--- Bez vinkulacije --- 
  f:selectItems
  value=#{AdminMB.vinkulant.vinkulantsSelectItem} /
  /tr:selectOneChoice
 
  AdminMB.vinkulant.vinkulantsSelectItem (managed bean for
 selectItems):
 
  public SelectItem[] getVinkulantsSelectItem(){
  ListVinkulant lc=getVinkulants();
  SelectItem si[]=new SelectItem[lc.size()];
  int i=0;
  for(Vinkulant c:lc){
  si[i++]=new SelectItem(c,c.getName());
  }
  return si;
  }
 
  public ListVinkulant getVinkulants() {
  ListVinkulant cl=em.createQuery(select c from Vinkulant c
  order by c.name http://c.name).getResultList();
  if(isInserting())
  cl.add(0,getVinkulant());
  return cl;
  }
 
  -
  AbstractPolicy - class where value is holded (objectBean in xhtml):
 
  public Vinkulant getVinkulant() {
  return vinkulant;
  }
 
  public void setVinkulant(Vinkulant vinkulant) {
  this.vinkulant = vinkulant;
  }
 
  -
 
  I'm sure that the value is properly stored (visible on other
 places).
  The problem is that only this tr:selectOneChoice for this data isn't
  showing correctly (if value is null then nothing is displayed as
 value
  in this component and if is there any value then the warning message
  logged on server and unselectedLabel is displayed), all other
  selectOneChoice (more then 20) in this form are working properly.
 
 

Re: [Trinidad] about CollectionModel semantics

2007-09-05 Thread Simon Lessard
Hmm, I'll have to test it out. normally, you Trinidad component should not
rely on row indexes once a row key was provided for it (after first
iteration though it). However, I'm not an InternalState expert yet, Adam
might have something to say on that statement. As for what you should set
with setRowIndex, simply the current value at that index. Trinidad should be
able to deal with it, I don't think you have to do some mapping on your own.


Regards,

~ Simon

On 9/5/07, Renzo Tomaselli [EMAIL PROTECTED] wrote:

  Simon, ok but the point is that the CollectionModel I have to publish is
 directly called to set/get rowIndex, and from the provided value it has to
 go to the business layer. I would expect that such InternalState should hide
 position-based calls on my model, using only keys. I miss the reason of
 getting both kind of calls, which was my original question.
 If the model is requested to set rowIndex to some value, which record
 should if safely go to ?
 On another side, row selection works through keys only (RowKeySet) and
 that's nice. But model updating seems to work also on positions.

 -- Renzo

 Simon Lessard wrote:

 Hello Renzo,

 There's an InternalState that we use to keep the mapping toward the rowKey
 during those phases to handle that issue.


 Regards,

 ~ Simon

 On 9/5/07, *Renzo Tomaselli* [EMAIL PROTECTED] wrote:

 Simon, not sure I got it. If you use rowIndex to identify a row during
 update model, how do you provide consistency ? I thought that rowKey was
 introduced exactly to avoid any potential mismatch when rows have to be
 reloaded from the business layer. Thus if we need to update a field of the
 third row, my guess was that this CollectionModel allows for asking the bean
 for that row by key - not by position  2 - which now might lead to another
 row as compared to the previous rendering.

 -- Renzo

 Simon Lessard wrote:

 Hello Renzo,

 We're using it during rendering, but we're also using it during all other
 phases as well and it's quite understandable. Let take a table for example.
 Let say the table contains only one column with an input inputText component
 nodestamp. The renderer obviously has to loop through all elements to render
 all rows. All client ids will be name spaced using tableId:rowIndex:inputId.
 Whatever the phase we're in, we have to run it on every row, thus looping
 through all elements is again required. Since rowKey does not provide
 looping API, we have to do that usins row indexes.


 Regards,

 ~ Simon

 On 9/5/07, *Renzo Tomaselli*  [EMAIL PROTECTED] wrote:

 Thanks Simon. As a further guess - I think we have to distinguish between
 phase usage of such methods.
 I presume (hopefully) that position-based indexing is used only during
 rendering, and *not* during restore view/update model.
 In other words, we told the component to render a range [first, first +
 rowsPerPage -1], and only there I expect that row retrieval occurs by
 position, calling setRowIndex/getRowData/getRowKey along that range. At that
 point the game is consistent, since we are still retrieving data from the
 business layer.
 But I expect that during restore view/update model, only
 setRowKey/getRowData is used (if any updating is required), since the
 business layer might have changed positions in the mean time.
 Do you confirm that ?

 -- Renzo

 Simon Lessard wrote:

 Hello Renzo,

 Comments inline.

 On 9/5/07, *Renzo Tomaselli* [EMAIL PROTECTED] wrote:

 Hi, I'm using tr:table since a long time, where paging through large
 data sets is implemented by my own CollectionModel.
 But I still miss some logics behind CollectionModel methods I have to
 implement.
 AFAIK, the overall strategy is to use getRowKey/setRowKey to enable
 content-based keys binding server model to client rendering, instead of
 plain position-based indexing. This is important in concurrent cases
 where the dataset might change across requests, and position would lead
 to wrong rows.


 Yep, but that feature become much much more relevant with TreeModel.

 Then current row can be retrieved by getRowData (far from atomic, though).
 But then why do we need to implement setRowIndex/getRowIndex too, which
 defeats the previous purpose, falling back to position-based keys ?


 setRowIndex is, most of the time, faster. However, it cannot navigate
 through the depth of a TreeModel. Therefore, most of the time, you use the
 rowKey to select a specific element, or the first element of the depth
 you're interested in and then, if you need to loop, you use setRowIndex from
 0 to rowCount for faster access. Also, it's required to support those method
 to be compatible with the other JSF components using JSF DataModel that
 CollectionModel extends.


 Hope it makes some sense,

 ~ Simon

 I guess that these two methods should be alternative, where
 position-based indexing should be used only for non-mutable datasets.
 However I noticed that all above methods are actually called by
 component code.
 Any comment 

Re: If in myFaces/Tomahwak

2007-09-05 Thread Mike Kienenberger
Generally, you do this with the rendered attribute of the component.

If you want to group a bunch of components, use a panelGroup rendered.


On 9/5/07, daniel ccss [EMAIL PROTECTED] wrote:
 Hi all,

 I have one question, how can I do an IF in a JSP wit myFaces/Tomahawk? In
 struts I used logic:equal or logic:notEqual, which is the tag in
 myFaces/Tomahawk to do that, I don´t want to use this: % if(...)... {% %
 else(...)... {%

 thanks!!!



Re: [Tobago] Tree menu and Icon

2007-09-05 Thread yazid

Please Help...

yazid wrote:
 
 Hi all;
 Is it possible to build a tree menu with a various icon (one icon by user
 node ).
 Thanks
 

-- 
View this message in context: 
http://www.nabble.com/-Tobago--Tree-menu-and-Icon-tf4383436.html#a12500853
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: sandbox and faclets

2007-09-05 Thread Mike Kienenberger
1) Are you accessing the xhtml file directly rather than through the
facelets servlet?
2) Is s:fieldset defined in your sandbox.taglib.xml file?
3) Are there errors parsing your facelets configuration files?

There's probably other possibilities as well, but these are a few that
immediately come to mind.

On 9/3/07, Garner Shawn [EMAIL PROTECTED] wrote:
 I configured the taglib file but my fieldset is still not being rendered.
 It writes out s:fieldset
 I have this in the top of my xhtml file:

 xmlns:s=http://myfaces.apache.org/sandbox;

 and I have this in my web.xml
 context-param
 param-namefacelets.LIBRARIES/param-name
 param-value
 
 /WEB-INF/config/taglib/tomahawk.taglib.xml;/WEB-INF/config/taglib/sandbox.taglib.xml;/WEB-INF/config/taglib/a4j.taglib.xml
 /param-value
 /context-param


 Any help would be appreciated.

 Shawn



Re: [Trinidad] tr:selectOneChoice bug

2007-09-05 Thread Luka Surija
How do you mean see if the value Hypo-Leasing Kärnten GmbH  Co KG 
exists in it?
This entry exists in dropdown list of values for rendered ComboBox in 
browser (in source code I can't see if this is the one, because 
itemIndex is not an ID of the Vinkulant object. In database also 
everything is allright.


I've do some more tests, and now I see that this is an general issue for 
this attribute (it means that doesn't work for any value, but I can't 
see whats wrong in compare of ie. NavigationArea selectOneChoice - there 
are the same except class type). I'm using trinidad last 8 month (before 
I've used ADF Faces) so I'm not newbie in this field, but this last 
project I'm working with trinidad and facelets is killing me.


So far I've discovered following wired issues:
- XMLMenuModel -  has issue with locale, and doAction problem
- Dialog framework - if an action is called as an method returning 
string dialog:something then nothing is happening (no dialog is 
displayed), but if action is 'hardcoded'  dialog:something then 
everything works as expected

- bellow mentioned issues with facelets (ok duplicate id is a know bug)
- now this wired selectOneChoice issue.

I don't know what to think about this. I can't imagine that no one else 
is using trinidad as much as I'm and didn't encounter the same problems 
(issues), so the only reasonable explanation is that something is wrong 
with my constelaton of application server (glassfish v2 b50), trinidad 
(1.0.3 trunk) and facelets (1.1.12) but what?


Tnx
Luka

Simon Lessard wrote:
Odd... I'll think a bit about it, but I don't see what could cause the 
problem then. Can you add a log in your getListOfValues method and see 
if the value Hypo-Leasing Kärnten GmbH  Co KG exists in it?


As a side note comment though, you could cache the list of values for 
the length of the request (or clear it at some point if you know it 
changed) to improve performance a bit, as the method might be called 
more than once, but that shouldn't fix your issue though.



Regards,

~ Simon

On 9/5/07, *Luka Surija* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


isInserting is stable. It is used in another part of application, and
has nothing to do with this part (it is always false).  No luck with
valuePassThru. It is really funny because 3 lines before in the same
xhtml I have this code snippet and it's working correctly as
expected:

tr:selectOneChoice readOnly=#{sessionBean.readOnly} label=Podrucje
plovidbe: value=#{objectBean.navigationArea} 
f:selectItems
value=#{ AdminMB.navigationArea.navigationAreasSelectItem} /
/tr:selectOneChoice

AdminMB.navigationArea.navigationAreasSelectItem:
public SelectItem[] getNavigationAreasSelectItem(){
ListNavigationArea lc=getNavigationAreas();
SelectItem si[]=new SelectItem[lc.size()];
int i=0;
for(NavigationArea c:lc){
si[i++]=new SelectItem(c,c.getNameHR());
}
return si;
}

public ListNavigationArea getNavigationAreas() {
ListNavigationArea nal=em.createQuery(select c from
NavigationArea c order by c.nameHR).getResultList();
if(isInserting())
nal.add(0,getNavigationArea());
return nal;
}
-
AbstractPolicy - class where value is holded (objectBean in xhtml):

public NavigationArea getNavigationArea() {
return navigationArea
}

public void setNavigationArea(NavigationArea navigationArea {
this.navigationArea = navigationArea;
}

-

Is there any possibility that there are some issues with facelets and
what is recommended version (I'm working with 1.1.12). I've also
noticed
following issues with facelets:

- duplicate id in tr:showDetail after expanding
- from time to time (unreproducible for me) ui:param inside
ui:include
is not assigned. Example:
ui:include src=my.xhtml
ui:param name=objectBean value=#{ManagedBean.myObject} /
/ui:include

Sometime objectBean is null inside my.xhtml, but
ManagedBean.myObject is
not ?!

So is there any other know issue between facelets and trinidad?


Some small ones, but none that hindering to my knowledge.

Regards,
Luka

Simon Lessard wrote:
 Hello Luka,

 Is the method isInserting() stable? Is it possible that it returns
 false on postback? Also, you cna try setting the valuePassThru
 attribute of the selectOneMenu to true to see if it helps.


 Regards,

 ~ Simon

 On 9/5/07, *Luka Surija* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:

 I'm not so sure about this. Here is my code:


  

[Trinidad] Large difference in generated ID between UIXComponentBase and UIComponentBase

2007-09-05 Thread Andrew Robinson
I am wondering if this is a bug or planned with UIXComponentBase:

I was noticing that my custom component that extended CoreCommandLink
stopped working after a partial update. When trying to figure out why,
I noticed that the ID of the link changed between rendering and
therefore the decode no longer worked.

On first page rendering, the link ID was _id44. During decode, it was
still _id44. During encode, it was _id108. It failed partial update
because the ID changed, and therefore all further decodes failed since
the client was now out of sync from the server.

In UIComponentBase.getClientId, if the getId() returns null, a new ID
is created and then setId is called. UIXComponentBase never calls
setId, but instead caches it in a _genId property using the
FacesBean.

Therefore, anything extending UIComponentBase and has a generated ID
will never have its ID change between requests on the same view.
However, it seems that UIXComponentBase does not guarantee that a
component with a generated ID will have a consistent ID.

Here is my code:

tr:panelLabelAndMessage
  label=Test help
  tr:inputText id=testHelp value=#{testHelpText}
simple=true /
  f:facet name=end
cw:helpIcon for=testHelp
  messageId=test_help /
  /f:facet
/tr:panelLabelAndMessage

The cw:helpIcon extends CoreCommandLink

If I give the helpIcon a hard coded ID, it works fine.

Is this a bug, a shortcoming, or just not supported with UIXComponentBase?

I seems like it could be a very big source of problems if IDs change
between requests, as decodes will have a lot of problems. Should
UIXComponentBase be calling setId after generating an ID in the
getClientId function?

This was found on 1.0.3-SNAPSHOT

Any ideas?

Thanks,
Andrew


Re: [Trinidad] Large difference in generated ID between UIXComponentBase and UIComponentBase

2007-09-05 Thread Andrew Robinson
If it makes a difference, here is my renderer's code for this component:

public class HelpIconRenderer
  extends CommandLinkRenderer
{
  public final static String RENDERER_TYPE = com.christws.HelpIcon;

  private PropertyKey messageIdKey;
  private PropertyKey forKey;

  public HelpIconRenderer()
  {
super(UIHelpIcon.TYPE);
  }

  /**
   * @see 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.CommandLinkRenderer#findTypeConstants(org.apache.myfaces.trinidad.bean.FacesBean.Type)
   */
  @Override
  protected void findTypeConstants(Type type)
  {
super.findTypeConstants(type);
messageIdKey = type.findKey(messageId);
forKey = type.findKey(for);
  }

  /**
   * @see 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#getStyleClass(org.apache.myfaces.trinidad.bean.FacesBean)
   */
  @Override
  protected String getStyleClass(FacesBean bean)
  {
return helpButton;
  }

  /**
   * @see 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.CommandLinkRenderer#getPartialSubmit(org.apache.myfaces.trinidad.bean.FacesBean)
   */
  @Override
  protected boolean getPartialSubmit(FacesBean bean)
  {
return true;
  }

  protected String getFor(FacesBean bean)
  {
return toString(bean.getProperty(forKey));
  }

  protected String getMessageId(FacesBean bean)
  {
return toString(bean.getProperty(messageIdKey));
  }

  /**
   * @see 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.CommandLinkRenderer#getImmediate(org.apache.myfaces.trinidad.bean.FacesBean)
   */
  @Override
  protected boolean getImmediate(FacesBean bean)
  {
return true;
  }

  /**
   * @see 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer#shouldRenderId(javax.faces.context.FacesContext,
javax.faces.component.UIComponent)
   */
  @Override
  protected boolean shouldRenderId(FacesContext context, UIComponent component)
  {
return true;
  }

  /**
   * @see 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.CommandLinkRenderer#encodeEnd(javax.faces.context.FacesContext,
org.apache.myfaces.trinidad.context.RenderingContext,
javax.faces.component.UIComponent,
org.apache.myfaces.trinidad.bean.FacesBean)
   */
  @Override
  public void encodeEnd(FacesContext context, RenderingContext arc,
UIComponent comp, FacesBean bean) throws IOException
  {
CoreIcon icon = FacesUtils.createComponent(CoreIcon.class);
icon.setTransient(true);
icon.setId(context.getViewRoot().createUniqueId());
icon.setName(help);
icon.setParent(comp);

org.apache.myfaces.trinidad.render.RenderUtils.encodeRecursive(context,
icon);

super.encodeEnd(context, arc, comp, bean);

ResponseWriter writer = context.getResponseWriter();
String forValue = getFor(bean);
UIComponent forComp = ComponentUtils.findRelativeComponent(comp, forValue);

StringBuilder js = new StringBuilder(
  Help.register(').append(forComp.getClientId(context))
  .append(', ').append(comp.getClientId(context))
  .append('););
RenderUtils.renderScript(context, js);
  }
}


On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
 I am wondering if this is a bug or planned with UIXComponentBase:

 I was noticing that my custom component that extended CoreCommandLink
 stopped working after a partial update. When trying to figure out why,
 I noticed that the ID of the link changed between rendering and
 therefore the decode no longer worked.

 On first page rendering, the link ID was _id44. During decode, it was
 still _id44. During encode, it was _id108. It failed partial update
 because the ID changed, and therefore all further decodes failed since
 the client was now out of sync from the server.

 In UIComponentBase.getClientId, if the getId() returns null, a new ID
 is created and then setId is called. UIXComponentBase never calls
 setId, but instead caches it in a _genId property using the
 FacesBean.

 Therefore, anything extending UIComponentBase and has a generated ID
 will never have its ID change between requests on the same view.
 However, it seems that UIXComponentBase does not guarantee that a
 component with a generated ID will have a consistent ID.

 Here is my code:

 tr:panelLabelAndMessage
   label=Test help
   tr:inputText id=testHelp value=#{testHelpText}
 simple=true /
   f:facet name=end
 cw:helpIcon for=testHelp
   messageId=test_help /
   /f:facet
 /tr:panelLabelAndMessage

 The cw:helpIcon extends CoreCommandLink

 If I give the helpIcon a hard coded ID, it works fine.

 Is this a bug, a shortcoming, or just not supported with UIXComponentBase?

 I seems like it could be a very big source of problems if IDs change
 between requests, as decodes will have a lot of problems. Should
 UIXComponentBase be calling setId after generating an ID in the
 getClientId function?

 This was found on 1.0.3-SNAPSHOT

 Any ideas?

 Thanks,
 Andrew



Re: If in myFaces/Tomahwak

2007-09-05 Thread daniel ccss
Can you give some example code, another way?

On 9/5/07, Mike Kienenberger [EMAIL PROTECTED] wrote:

 Generally, you do this with the rendered attribute of the component.

 If you want to group a bunch of components, use a panelGroup rendered.


 On 9/5/07, daniel ccss [EMAIL PROTECTED] wrote:
  Hi all,
 
  I have one question, how can I do an IF in a JSP wit myFaces/Tomahawk?
 In
  struts I used logic:equal or logic:notEqual, which is the tag in
  myFaces/Tomahawk to do that, I don´t want to use this: % if(...)... {%
 %
  else(...)... {%
 
  thanks!!!
 



Using JSF and Tiles

2007-09-05 Thread Chris Pratt
I have created what I imagine is the simplest possible MyFaces 1.1.5
and Tiles 2.0.4 application
(http://www.planetpratt.com/xfer/crash.war), but it doesn't appear to
work.  Can anybody please help point me in the right direction?
  (*Chris*)


Re: [TRINIDAD] - IMPORTANT - Custom Skin Developers

2007-09-05 Thread Matt Cooper
I agree with Adam.

On 9/4/07, Adam Winer [EMAIL PROTECTED] wrote:

 The old parameter was trinidadinternal, and therefore was
 never officially supported.  If we were changing from one
 supported name to another, I'd agree that we should keep the
 old name around, but supporting backwards compatibility
 for anything trinidadinternal is a precedent I don't think we
 should set...

 -- Adam


 On 8/31/07, Martin Marinschek  [EMAIL PROTECTED] wrote:
 
  Hi Danny,
 
  eventually we could additionally support also the old name for the
  configuration parameter, and only phase this out in a major release?
 
  regards,
 
  Martin
 
  On 8/28/07, Danny Robinson  [EMAIL PROTECTED] wrote:
   In the hope of pre-empting some emails, be aware that the trunk has
  switched
   to now use the following config setting for disabling skin
  compression.
  
   org.apache.myfaces.trinidadinternal.DISABLE_CONTENT_COMPRESSION
   became
   org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION
  
   The docs and release notes in trunk also mention this.
  
   Thanks,
  
   Danny
   --
   Chordiant Software Inc.
www.chordiant.com
 
 
  --
 
  http://www.irian.at
 
  Your JSF powerhouse -
  JSF Consulting, Development and
  Courses in English and German
 
  Professional Support for Apache MyFaces
 




Re: [Trinidad] tr:selectOneChoice bug

2007-09-05 Thread Simon Lessard
On 9/5/07, Luka Surija [EMAIL PROTECTED] wrote:

 How do you mean see if the value Hypo-Leasing Kärnten GmbH  Co KG
 exists in it?


I mean if you log all calls to you getListOfValues method and its return
value, does it always contain the value Hypo-Leasing Kärnten GmbH  Co KG
that selectOneChoice cannot seem to find?

This entry exists in dropdown list of values for rendered ComboBox in
 browser (in source code I can't see if this is the one, because
 itemIndex is not an ID of the Vinkulant object. In database also
 everything is allright.

 I've do some more tests, and now I see that this is an general issue for
 this attribute (it means that doesn't work for any value, but I can't
 see whats wrong in compare of ie. NavigationArea selectOneChoice - there
 are the same except class type). I'm using trinidad last 8 month (before
 I've used ADF Faces) so I'm not newbie in this field, but this last
 project I'm working with trinidad and facelets is killing me.

 So far I've discovered following wired issues:
 - XMLMenuModel -  has issue with locale, and doAction problem


I don't know about that one since I've been using my own implementation
since  ADF Faces as well.  I guess I should give it a closer look at
XMLMenuModel and see how I can add my own model features to it as well as
the ProcessModel since I don't know such problems and its has been running
in two production systems for more than one year.

- Dialog framework - if an action is called as an method returning
 string dialog:something then nothing is happening (no dialog is
 displayed), but if action is 'hardcoded'  dialog:something then
 everything works as expected


Ugh... Wasn't that fixed?

- bellow mentioned issues with facelets (ok duplicate id is a know bug)


I'm not currently, but planning to  do so in a very near future, so I cannot
comment that statement right now, sorry.

- now this wired selectOneChoice issue.


It is, indeed, weird.

I don't know what to think about this. I can't imagine that no one else
 is using trinidad as much as I'm and didn't encounter the same problems
 (issues), so the only reasonable explanation is that something is wrong
 with my constelaton of application server (glassfish v2 b50), trinidad
 (1.0.3 trunk) and facelets (1.1.12) but what?

 Tnx
 Luka

 Simon Lessard wrote:
  Odd... I'll think a bit about it, but I don't see what could cause the
  problem then. Can you add a log in your getListOfValues method and see
  if the value Hypo-Leasing Kärnten GmbH  Co KG exists in it?
 
  As a side note comment though, you could cache the list of values for
  the length of the request (or clear it at some point if you know it
  changed) to improve performance a bit, as the method might be called
  more than once, but that shouldn't fix your issue though.
 
 
  Regards,
 
  ~ Simon
 
  On 9/5/07, *Luka Surija* [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  isInserting is stable. It is used in another part of application,
 and
  has nothing to do with this part (it is always false).  No luck with
  valuePassThru. It is really funny because 3 lines before in the same
  xhtml I have this code snippet and it's working correctly as
  expected:
 
  tr:selectOneChoice readOnly=#{sessionBean.readOnly}
 label=Podrucje
  plovidbe: value=#{objectBean.navigationArea} 
  f:selectItems
  value=#{ AdminMB.navigationArea.navigationAreasSelectItem} /
  /tr:selectOneChoice
 
  AdminMB.navigationArea.navigationAreasSelectItem:
  public SelectItem[] getNavigationAreasSelectItem(){
  ListNavigationArea lc=getNavigationAreas();
  SelectItem si[]=new SelectItem[lc.size()];
  int i=0;
  for(NavigationArea c:lc){
  si[i++]=new SelectItem(c,c.getNameHR());
  }
  return si;
  }
 
  public ListNavigationArea getNavigationAreas() {
  ListNavigationArea nal=em.createQuery(select c from
  NavigationArea c order by c.nameHR).getResultList();
  if(isInserting())
  nal.add(0,getNavigationArea());
  return nal;
  }
  -
  AbstractPolicy - class where value is holded (objectBean in xhtml):
 
  public NavigationArea getNavigationArea() {
  return navigationArea
  }
 
  public void setNavigationArea(NavigationArea navigationArea {
  this.navigationArea = navigationArea;
  }
 
  -
 
  Is there any possibility that there are some issues with facelets
 and
  what is recommended version (I'm working with 1.1.12). I've also
  noticed
  following issues with facelets:
 
  - duplicate id in tr:showDetail after expanding
  - from time to time (unreproducible for me) ui:param inside
  ui:include
  is not 

Re: If in myFaces/Tomahwak

2007-09-05 Thread Mike Kienenberger
panelGroup rendered=#{bean.shouldRenderThese}
componentToRenderWhenTrue/
componentToRenderWhenTrue/
componentToRenderWhenTrue/
componentToRenderWhenTrue/
componentToRenderWhenTrue/
/panelGroup

panelGroup rendered=#{not bean.shouldRenderThese}
componentToRenderWhenFalse/
componentToRenderWhenFalse/
componentToRenderWhenFalse/
/panelGroup

On 9/5/07, daniel ccss [EMAIL PROTECTED] wrote:
 Can you give some example code, another way?


 On 9/5/07, Mike Kienenberger [EMAIL PROTECTED] wrote:
  Generally, you do this with the rendered attribute of the component.
 
  If you want to group a bunch of components, use a panelGroup rendered.
 
 
  On 9/5/07, daniel ccss [EMAIL PROTECTED] wrote:
   Hi all,
  
   I have one question, how can I do an IF in a JSP wit myFaces/Tomahawk?
 In
   struts I used logic:equal or logic:notEqual, which is the tag in
   myFaces/Tomahawk to do that, I don´t want to use this: % if(...)... {%
 %
   else(...)... {%
  
   thanks!!!
  
 




Re: [tobago] error not verbose enough

2007-09-05 Thread Zied Hamdi
Hello Bernd,

I'm sorry, I can't get to the exception again. I'll take a look at my sooner
versions archives tomorrow. (I'm alone on the app, I don't use a version
controller :-/. )

Regards,
Zied

2007/9/5, Bernd Bohmann [EMAIL PROTECTED]:

 Hello Zied,

 can you send the complete web application, please.
 (to my personal account)

 Regards

 Bernd



 Zied Hamdi wrote:
   Hi again,
 
   Here's the page structure (by facelets) if it can help.
  Regards,
  Zied
   UIViewRoot clientProperties=
  [EMAIL PROTECTED]
 locale=fr_FR
  renderKitId=tobago rendered=true transient=false
  viewId=/person/person.xhtml
   UIPage
 actionId=page:personForm:personTableSubview:personData:0:j_id14
  height=1243 id=page prependId=true rendered=true
 submitted=false
  transient=false width=1891
   UIForm id=personForm prependId=true rendered=true
 submitted=true
  transient=false  UIPanel id=j_id9 markup=[Ljava.lang.String
 ;@12442a2
  rendered=true transient=false layout UIGridLayout columns=1*
  id=j_id52 ignoreFree=false rendered=true
 rows=300px;20px;600px;100px
  transient=false/  UIBox id=j_id11 markup=[Ljava.lang.String
 ;@192d7d0
  rendered=true transient=false toolBar UIToolBar iconSize=small
  id=tableToolBar labelPosition=right orientation=left
 rendered=true
  transient=false  UICommand action=#{personCtrl.newPersonCmd}
  actionExpression=#{personCtrl.newPersonCmd} defaultCommand=false
  disabled=false id=newPersonCmd immediate=false rendered=true
  renderedPartially=[Ljava.lang.String;@196b73e transient=false
  transition=true/  UICommand action=#{personCtrl.hideEditWindowCmd}
  actionExpression=#{personCtrl.hideEditWindowCmd}
 defaultCommand=false
  disabled=false id=stopEditingCmd immediate=false rendered=true
  renderedPartially=[Ljava.lang.String;@1d85ab9 transient=false
  transition=true/ /UIToolBar  UIPanel id=personTablePanel
 markup=[
  Ljava.lang.String;@12c4d8f rendered=true transient=false
  UINamingContainer
  id=personTableSubview rendered=true transient=false  UIPanel
  id=j_id12 markup=[Ljava.lang.String;@197f538 rendered=true
  transient=false  UIData columns=18px;70px;70px;100px;110px;*;18px
  directLinkCount=9 first=0 id=personData rendered=true
 rowIndex=-1
  rows=100 selectable=multi showDirectLinks=none showHeader=true
  showPageRange=center showRowRange=right sortActionListener=
  transient=false var=currentPerson binding=#{personCtrl.personTable
 }
  pagerPage UICommand defaultCommand=false disabled=false id=ToPage
  immediate=false rendered=true
  renderedPartially=[Ljava.lang.String;@1646de5
  transient=false transition=true/ Next UICommand
 defaultCommand=false
  disabled=true id=Next immediate=false rendered=true
  renderedPartially=[Ljava.lang.String;@6b0a6a transient=false
  transition=true/ Last UICommand defaultCommand=false
 disabled=true
  id=Last immediate=false rendered=true renderedPartially=[
  Ljava.lang.String;@178efd5 transient=false transition=true/ Prev
  UICommand
  defaultCommand=false disabled=true id=Prev immediate=false
  rendered=true renderedPartially=[Ljava.lang.String;@c9b2bc
  transient=false transition=true/ First UICommand
  defaultCommand=false disabled=true id=First immediate=false
  rendered=true renderedPartially=[Ljava.lang.String;@1f58334
  transient=false transition=true/ pagerRow UICommand
  defaultCommand=false disabled=false id=ToRow immediate=false
  rendered=true renderedPartially=[Ljava.lang.String;@1790458
  transient=false transition=true/  UIColumn align=center
 id=j_id13
  markup=[Ljava.lang.String;@c5e60 rendered=true sortable=false
  transient=false  UILinkCommand action=#{personCtrl.edit}
  actionExpression=#{personCtrl.edit} defaultCommand=false
  disabled=false id=j_id14 immediate=false
  markup=[Ljava.lang.String;@7f1ac
  rendered=true renderedPartially=[Ljava.lang.String;@18b91cb
  transient=false transition=true/ /UIColumn  UIColumn
  id=firstNameCol label=Prénom markup=[Ljava.lang.String;@10b69b
  rendered=true sortable=true transient=false sorter UICommand
  defaultCommand=false disabled=false id=firstNameCol_sorter
  immediate=false rendered=true
  renderedPartially=[Ljava.lang.String;@1447c32
  transient=false transition=true/  UIOutput createSpan=true
  escape=true id=firstName markup=[Ljava.lang.String;@135ea8e
  rendered=true transient=false/ /UIColumn  UIColumn
 id=lastNameCol
  label=Nom markup=[Ljava.lang.String;@ba4bb9 rendered=true
  sortable=true transient=false sorter UICommand
 defaultCommand=false
  disabled=false id=lastNameCol_sorter immediate=false
 rendered=true
  renderedPartially=[Ljava.lang.String;@c18c31 transient=false
  transition=true/  UIOutput createSpan=true escape=true
 id=lastName
  markup=[Ljava.lang.String;@dafcf2 rendered=true transient=false/
  /UIColumn  UIColumn align=right id=zipCodeCol label=Code Postal
  markup=[Ljava.lang.String;@11486c5 rendered=true sortable=true
  transient=false sorter UICommand defaultCommand=false
 disabled=false
  id=zipCodeCol_sorter immediate=false rendered=true
  

Re: If in myFaces/Tomahwak

2007-09-05 Thread daniel ccss
Thanks!!... But, there are no if components like the logic:equal o
logic:notPresent?? in struts

On 9/5/07, Mike Kienenberger [EMAIL PROTECTED] wrote:

 panelGroup rendered=#{bean.shouldRenderThese}
 componentToRenderWhenTrue/
 componentToRenderWhenTrue/
 componentToRenderWhenTrue/
 componentToRenderWhenTrue/
 componentToRenderWhenTrue/
 /panelGroup

 panelGroup rendered=#{not bean.shouldRenderThese}
 componentToRenderWhenFalse/
 componentToRenderWhenFalse/
 componentToRenderWhenFalse/
 /panelGroup

 On 9/5/07, daniel ccss [EMAIL PROTECTED] wrote:
  Can you give some example code, another way?
 
 
  On 9/5/07, Mike Kienenberger [EMAIL PROTECTED] wrote:
   Generally, you do this with the rendered attribute of the component.
  
   If you want to group a bunch of components, use a panelGroup
 rendered.
  
  
   On 9/5/07, daniel ccss [EMAIL PROTECTED] wrote:
Hi all,
   
I have one question, how can I do an IF in a JSP wit
 myFaces/Tomahawk?
  In
struts I used logic:equal or logic:notEqual, which is the tag in
myFaces/Tomahawk to do that, I don´t want to use this: % if(...)...
 {%
  %
else(...)... {%
   
thanks!!!
   
  
 
 



ExtensionsFilter and RI

2007-09-05 Thread Ben Smith
Hi,

I'm trying to use the upload file tag with RI 1.2.  The tag works (the
file is uploaded), but afterwards I get a blank page instead of the
page I expect.  I've found that any form that has
enctype=multipart/form-data renders a blank page after submit,
regardless of whether or not there's an upload file tag in the form.
I tried turning off the ExtensionsFilter and multipart forms would
submit normally.

Has anyone else seen this?  Any suggestions?

Thanks,
--Ben Smith


Re: [Trinidad] tr:selectOneChoice bug

2007-09-05 Thread Luka Surija

Comments are bellow.

I appreciate all what are you doing guys.

Tnx
Luka

Simon Lessard wrote:



On 9/5/07, *Luka Surija* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


How do you mean see if the value Hypo-Leasing Kärnten GmbH  Co KG
exists in it?


I mean if you log all calls to you getListOfValues method and its 
return value, does it always contain the value Hypo-Leasing Kärnten 
GmbH  Co KG that selectOneChoice cannot seem to find?

Ok, I get it.
...
Yes it does display everytime as you can see here is the output:

.. listcut
Vinkulant: Hypo Leasing d.o.o.
Vinkulant: Hypo-Leasing Kärnten GmbH  Co KG
Vinkulant: Hypo-Leasing Kroatien d.o.o.
...listcut
Could not find selected item matching value Hypo-Leasing Kärnten GmbH  
Co KG in CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=j_id156]

...listcut
Vinkulant: Hypo Leasing d.o.o.
Vinkulant: Hypo-Leasing Kärnten GmbH  Co KG
Vinkulant: Hypo-Leasing Kroatien d.o.o.
... listcut

I've just cut the whole list, but this is the server output.

Simon, can you explain me how one item is selected from the list? Does 
it compare display names of selectItems or call equal method of 
selectItems value with value inside selectOneChoice?


This entry exists in dropdown list of values for rendered ComboBox in
browser (in source code I can't see if this is the one, because
itemIndex is not an ID of the Vinkulant object. In database also
everything is allright.

I've do some more tests, and now I see that this is an general
issue for
this attribute (it means that doesn't work for any value, but I can't
see whats wrong in compare of ie. NavigationArea selectOneChoice -
there
are the same except class type). I'm using trinidad last 8 month
(before
I've used ADF Faces) so I'm not newbie in this field, but this last
project I'm working with trinidad and facelets is killing me.

So far I've discovered following wired issues:
- XMLMenuModel -  has issue with locale, and doAction problem


I don't know about that one since I've been using my own 
implementation since  ADF Faces as well.  I guess I should give it a 
closer look at XMLMenuModel and see how I can add my own model 
features to it as well as the ProcessModel since I don't know such 
problems and its has been running in two production systems for more 
than one year.
There are two post addressing this issue (from me 
http://www.nabble.com/-Trinidad--XMLMenuModel-bug-tf4322443.html#a12308841
and from Stephen Friedrich 
http://www.nabble.com/-Trinidad--Bug-in-XMLMenuModel---ItemNode---tf4344401.html#a12376683


I'm also experiencing problems with locale in XMLMenuModel.
http://www.nabble.com/-Trinidad--MenuModel-locale-tf4289964.html#a12212573 
this issue was resolved, but it looks like locale value is somewhere 
cached inside XMLMenuModel framework, because it displays the language 
that is set as default language, after swiching the locale, complete app 
change the labels in proper language except navigation links from menu 
model.




- Dialog framework - if an action is called as an method returning
string dialog:something then nothing is happening (no dialog is
displayed), but if action is 'hardcoded'  dialog:something then
everything works as expected


Ugh... Wasn't that fixed?
not as I know (I've checked this issue if is working 2 weeks ago, but no 
luck, after that I didn't see any JIRA regarding this issue.


- bellow mentioned issues with facelets (ok duplicate id is a know
bug)


I'm not currently, but planning to  do so in a very near future, so I 
cannot comment that statement right now, sorry.
Please don't think that I'm attacking you because of this bugs, I just 
wanted to share my discovery and summarize my problems at one point.


- now this wired selectOneChoice issue.


It is, indeed, weird.
The problem is that this is a dangerous bug, because people that works 
with this app must be carefull editing policy that has vinkulant 
assigned (user must select right value every time is in edit mode 
(sessionBean.readOnly), and if he/she forgets, this attribute(data) is 
lost). So it is a little bit embracing for me.






I don't know what to think about this. I can't imagine that no one
else
is using trinidad as much as I'm and didn't encounter the same
problems
(issues), so the only reasonable explanation is that something is
wrong
with my constelaton of application server (glassfish v2 b50),
trinidad
(1.0.3 trunk) and facelets (1.1.12) but what?

Tnx
Luka

Simon Lessard wrote:
 Odd... I'll think a bit about it, but I don't see what could
cause the
 problem then. Can you add a log in your getListOfValues method
and see
 if the value Hypo-Leasing Kärnten GmbH  Co KG exists in it?

 As a side note comment though, you could cache the list of
values for
 the length of the request (or clear it at some point if you know it
  

Which component triggered request

2007-09-05 Thread David Brunette
 

 When in a PhaseListener, or I suppose at any point during the
request, is it possible to know which component triggered the request?
Even just a clientId would suit my needs.

 

 Thanks...

 

Dave

The information transmitted herewith is sensitive  information of Chordiant 
Software or its customers and is intended only for use to the individual or 
entity to which it is addressed. If the reader of this message is not the 
intended recipient, you are hereby notified that any review, retransmission, 
dissemination, distribution, copying or other use of, or taking of any action 
in reliance upon, this information is strictly prohibited. If you have received 
this communication in error, please contact the sender and delete the material 
from your computer.


Re: [Trinidad] tr:selectOneChoice bug

2007-09-05 Thread Simon Lessard
Stripped part the mail because it was getting quite hard to read.

On 9/5/07, Luka Surija [EMAIL PROTECTED] wrote:


 Yes it does display everytime as you can see here is the output:

 .. listcut
 Vinkulant: Hypo Leasing d.o.o.
 Vinkulant: Hypo-Leasing Kärnten GmbH  Co KG
 Vinkulant: Hypo-Leasing Kroatien d.o.o.
 ...listcut
 Could not find selected item matching value Hypo-Leasing Kärnten GmbH 
 Co KG in CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=j_id156]
 ...listcut
 Vinkulant: Hypo Leasing d.o.o.
 Vinkulant: Hypo-Leasing Kärnten GmbH  Co KG
 Vinkulant: Hypo-Leasing Kroatien d.o.o.
 ... listcut

 I've just cut the whole list, but this is the server output.

 Simon, can you explain me how one item is selected from the list? Does
 it compare display names of selectItems or call equal method of
 selectItems value with value inside selectOneChoice?


It depends on the valuePassThru attribute. If it isn't specified or set to
false, then it uses the index. If valuePassThru is true, then it compare the
converted submitted value. Speaking of which, are you using any strange
converter? That could be the cause of the equals failure.

 I don't know about that one since I've been using my own
  implementation since  ADF Faces as well.  I guess I should give it a
  closer look at XMLMenuModel and see how I can add my own model
  features to it as well as the ProcessModel since I don't know such
  problems and its has been running in two production systems for more
  than one year.
 There are two post addressing this issue (from me
 http://www.nabble.com/-Trinidad--XMLMenuModel-bug-tf4322443.html#a12308841
 and from Stephen Friedrich

 http://www.nabble.com/-Trinidad--Bug-in-XMLMenuModel---ItemNode---tf4344401.html#a12376683


Yeah I saw the post. I didn't express myself correctly. I meant that I never
personally experienced it, because I'm not using that Trinidad feature yet.

The problem is that this is a dangerous bug, because people that works
 with this app must be carefull editing policy that has vinkulant
 assigned (user must select right value every time is in edit mode
 (sessionBean.readOnly), and if he/she forgets, this attribute(data) is
 lost). So it is a little bit embracing for me.


I really don't think it's a component issue though, but we need to find what
make it fail nonetheless. Is the field autoSubmit, immediate or is in any
other way special?


Regards,

~ Simon


[TRINIDAD] JS LocaleElements question

2007-09-05 Thread Simon Lessard
Hello all,

Anyone know by heart how and when the JS Locale elements get set by any
chance? It's not the part of the code I played the most with and I could
save the heavy digging if possible. I get the following error in a very
specific environment:

this.getLocaleElements().DateTimePatterns has no properties
return this.getLocaleElements()[DateTimePatterns][7];

Anyone know anything that could theoretically cause that. It happen if I
override SimpleInputDateRenderer and most of it get methods.


Thanks,

~ Simon


Re: If in myFaces/Tomahwak

2007-09-05 Thread simon
No, there is no separate tag like logic:equal. You need to use the
rendered attribute as Mike described.

Note that the rendered attribute is a normal EL expression, which can be
quite complex. An EL expression can test things for equality etc. See a
JSF manual or the specification for what is possible in an EL
expression.

On Wed, 2007-09-05 at 11:23 -0600, daniel ccss wrote:
 Thanks!!... But, there are no if components like the logic:equal o
 logic:notPresent?? in struts
 
 On 9/5/07, Mike Kienenberger [EMAIL PROTECTED] wrote:
 panelGroup rendered=#{bean.shouldRenderThese }
 componentToRenderWhenTrue/
 componentToRenderWhenTrue/
 componentToRenderWhenTrue/
 componentToRenderWhenTrue/
 componentToRenderWhenTrue/ 
 /panelGroup
 
 panelGroup rendered=#{not bean.shouldRenderThese}
 componentToRenderWhenFalse/
 componentToRenderWhenFalse/
 componentToRenderWhenFalse/ 
 /panelGroup
 
 On 9/5/07, daniel ccss [EMAIL PROTECTED] wrote:
  Can you give some example code, another way?
 
 
  On 9/5/07, Mike Kienenberger  [EMAIL PROTECTED] wrote:
   Generally, you do this with the rendered attribute of the
 component.
  
   If you want to group a bunch of components, use a
 panelGroup rendered. 
  
  
   On 9/5/07, daniel ccss [EMAIL PROTECTED] wrote:
Hi all,
   
I have one question, how can I do an IF in a JSP wit
 myFaces/Tomahawk? 
  In
struts I used logic:equal or logic:notEqual, which is
 the tag in
myFaces/Tomahawk to do that, I don´t want to use this: 
 % if(...)... {%
  %
else(...)... {% 
   
thanks!!!
   
  
 
 
 



Re: Chosen label from an HtmlSelectOneMenu?

2007-09-05 Thread Rob99

Ok, I'll try that.  Thanks for responding David!



David Delbecq-2 wrote:
 
 You must iterate on component children, look at each uiselectitem and 
 uiselectitems, and queary each of them until you get a SelectItem which 
 value match the current one. you can then get label of this SelectItem. 
 Note that this iteration will call the various EL associated with your 
 select menu child components. This is because JSF never cache EL results.
 
 
 Rob99 a écrit :
 Hello,

 I have bound an HtmlSelectOneMenu to my backing bean using
 binding=...
 on the tag.  I can get the chosen value easily enough with:


 HtmlSelectOneMenu m;
 ...
 String chosenValue = m.getValue();


 Is there any way to get the label of the chosen item instead of the
 value from the component?  Or is it absolutely necessary to query the
 model that populated the HtmlSelectOneMenu in the first place?


 -Thank you!
   
 
 

-- 
View this message in context: 
http://www.nabble.com/Chosen-label-from-an-HtmlSelectOneMenu--tf4378820.html#a12510404
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: [Trinidad] tr:selectOneChoice bug

2007-09-05 Thread Luka Surija


Simon Lessard wrote:

Stripped part the mail because it was getting quite hard to read.

On 9/5/07, *Luka Surija* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]  wrote:



Yes it does display everytime as you can see here is the output:

.. listcut
Vinkulant: Hypo Leasing d.o.o.
Vinkulant: Hypo-Leasing Kärnten GmbH  Co KG
Vinkulant: Hypo-Leasing Kroatien d.o.o.
...listcut
Could not find selected item matching value Hypo-Leasing Kärnten
GmbH 
Co KG in CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=j_id156]
...listcut
Vinkulant: Hypo Leasing d.o.o.
Vinkulant: Hypo-Leasing Kärnten GmbH  Co KG
Vinkulant: Hypo-Leasing Kroatien d.o.o.
... listcut

I've just cut the whole list, but this is the server output.

Simon, can you explain me how one item is selected from the list? Does
it compare display names of selectItems or call equal method of
selectItems value with value inside selectOneChoice?


It depends on the valuePassThru attribute. If it isn't specified or 
set to false, then it uses the index. If valuePassThru is true, then 
it compare the converted submitted value. Speaking of which, are you 
using any strange converter? That could be the cause of the equals 
failure.

No, I'm not using any converter.


 I don't know about that one since I've been using my own
 implementation since  ADF Faces as well.  I guess I should give
it a
 closer look at XMLMenuModel and see how I can add my own model
 features to it as well as the ProcessModel since I don't know such
 problems and its has been running in two production systems for
more
 than one year.
There are two post addressing this issue (from me
http://www.nabble.com/-Trinidad--XMLMenuModel-bug-tf4322443.html#a12308841
http://www.nabble.com/-Trinidad--XMLMenuModel-bug-tf4322443.html#a12308841
and from Stephen Friedrich

http://www.nabble.com/-Trinidad--Bug-in-XMLMenuModel---ItemNode---tf4344401.html#a12376683

http://www.nabble.com/-Trinidad--Bug-in-XMLMenuModel---ItemNode---tf4344401.html#a12376683


Yeah I saw the post. I didn't express myself correctly. I meant that I 
never personally experienced it, because I'm not using that Trinidad 
feature yet.


The problem is that this is a dangerous bug, because people that works
with this app must be carefull editing policy that has vinkulant
assigned (user must select right value every time is in edit mode
(sessionBean.readOnly ), and if he/she forgets, this
attribute(data) is
lost). So it is a little bit embracing for me.


I really don't think it's a component issue though, but we need to 
find what make it fail nonetheless. Is the field autoSubmit, immediate 
or is in any other way special?


No not at all, but page where this component is displaying containst cca 
100 components, and many of them have autoSubmit and partialTriggers, 
but this component doesn't do any autoSubimt nor is inside a component 
under partialTrigger. Immediate I don't use at all. Perhaps this big 
amount of component does make a difference but still doesn't clarify the 
situation.


Regards,

~ Simon





Re: [TRINIDAD] JS LocaleElements question

2007-09-05 Thread Simon Lessard
Nvm, I found my problem.

On 9/5/07, Simon Lessard [EMAIL PROTECTED] wrote:

 Hello all,

 Anyone know by heart how and when the JS Locale elements get set by any
 chance? It's not the part of the code I played the most with and I could
 save the heavy digging if possible. I get the following error in a very
 specific environment:

 this.getLocaleElements().DateTimePatterns has no properties
  return this.getLocaleElements()[DateTimePatterns][7];

 Anyone know anything that could theoretically cause that. It happen if I
 override SimpleInputDateRenderer and most of it get methods.


 Thanks,

 ~ Simon


Re: Turn off the debug logging for Trinidad

2007-09-05 Thread DRAY

No worries. I just wasn't sure if I missed something obvious in a config file
somewhere. Many thanks for the quick response.
-- 
View this message in context: 
http://www.nabble.com/Turn-off-the-debug-logging-for-Trinidad-tf4363669.html#a12510738
Sent from the MyFaces - Users mailing list archive at Nabble.com.



Re: Trinidad 1.2.1: SelectOrderShuttle leading/trailingDescShown Fails For Me

2007-09-05 Thread Adam Winer
No, it will not be in 1.2.2.  It'll be in 1.0.3 and 1.2.3.

-- Adam


On 9/4/07, Gregg Leichtman [EMAIL PROTECTED] wrote:

  Agreed. The port to Trinidad did _not_ cause this problem. My initial
 diagnosis was incorrect and your point on Tiles demonstrating the problem is
 the correct diagnosis.

 Are you in a position to say if this fix will make it into 1.2.2?

 -= Gregg =-

 Adam Winer wrote:

 Oh, absolutely, it's a bug, and we'll apply the fix you've provided.
 I'm just pointing out that it's a really long-standing one, and that:

 'This worked fine in ADF Faces before
 porting to Trinidad where the listName was just shuttle1:leading.
 Note, however, that Trinidad now adds an additional content prefix'

 ... isn't quite right, since the bug existed in ADF Faces too,
 and Trinidad doesn't add the content prefix itself.

 -- Adam


 On 9/4/07, Gregg Leichtman [EMAIL PROTECTED] wrote:
 
  Having thought about this following your FYI (thank you for the hint), I
  realized that Tiles must indeed be adding a tiles name prefix to the
  name and ID attributes. The shuttle component is in a tile whose
  definition name is, not surprisingly, content.
 
  Given this, however, I still would classify this behavior in Trinidad as
  a bug based on the following reasoning. The component code that is
  generating the JavaScript variables:
 
  content_shuttle1_leading_desc
  content_shuttle1_trailing_desc
 
  appears to use a global replace of underscore for colon (I didn't check
  the Java code for this, but it seems reasonable based upon the generated
  ID); however, the code in the generated JavaScript function
  TrShuttleProxy._getDescArray that searches for an element match via ID
  uses a single or first replace of underscore for colon. This
  inconsistency in the handling of the modification of element IDs will
  always cause a problem for any code, Tiles or otherwise that adds
  something with a colon to the ID.
 
  Therefore, I would re-categorize this as an integration bug instead of a
  general Trinidad bug, but I would suggest that it is still a bug in
  Trinidad that should be fixed. If nothing else, I will need to,
  hopefully temporarily, create a duplicate TrShuttleProxy._getDescArray
  function with the suggested patch in order to get this functionality to
  work with Tiles or alternatively modify the Java generation code,
  something I would rather not do, since the latter interferes with easy
  upgrades.
 
  Do you agree that this is a bug and that it should be fixed?
 
-= Gregg
  =-
 
  Adam Winer wrote:
   Gregg,
  
   FYI, I don't think Trinidad is adding the content:.   Perhaps
   Tiles 2.0 is (I've not looked at the newer version).
  
   -- Adam
  
  
   On 9/3/07, Gregg Leichtman [EMAIL PROTECTED] wrote:
  
I have found a bug in the generated JavaScript for the
  Select*Shuttle
   components. A patch follows:
  
TrShuttleProxy._getDescArray = function(listName) {
//  var descArray = window[listName.replace(':','_') + '_desc'];
  var descArray = window[listName.replace (/:/g,'_') + '_desc']; //
  gsl fix
  return descArray;
}
  
where listName is content:shuttle1:leading.
  
The problem is that the listName is not using a global replace;
  therefore
   only the first ':' is being replaced. This worked fine in ADF Faces
  before
   porting to Trinidad where the listName was just shuttle1:leading.
  Note,
   however, that Trinidad now adds an additional content prefix to the
 
   generated inline JavaScript variables:
  
content_shuttle1_leading_desc=new Array('The First Item
   Desc',
'The Second Item Desc',
'The Third Item Desc','');
content_shuttle1_trailing_desc=new Array('');
  
This means that a global replace needs to be done to create the
  proper
   variable name for matching in the JavaScript code. I will report this
  on
   Jira for the Trinidad project.
  
I don't have access to the latest snapshots. The last one I see is
  from
   July 11th at:
  
  
  
  http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-impl/1.2.1-SNAPSHOT/
  
If this has been fixed already, then please clear my bug report
  which
   should have the side benefit of letting people know that the bug has
  been
   found and fixed already.
  
   -= Gregg =-
  
 
 
 




Re: Trinidad 1.2.1: SelectOrderShuttle leading/trailingDescShown Fails For Me

2007-09-05 Thread Adam Winer
Or, rather, it will if we get a JIRA issue on it...

-- Adam


On 9/5/07, Adam Winer [EMAIL PROTECTED] wrote:

 No, it will not be in 1.2.2.  It'll be in 1.0.3 and 1.2.3.

 -- Adam


 On 9/4/07, Gregg Leichtman [EMAIL PROTECTED]  wrote:
 
   Agreed. The port to Trinidad did _not_ cause this problem. My initial
  diagnosis was incorrect and your point on Tiles demonstrating the problem is
  the correct diagnosis.
 
  Are you in a position to say if this fix will make it into 1.2.2?
 
  -= Gregg =-
 
  Adam Winer wrote:
 
  Oh, absolutely, it's a bug, and we'll apply the fix you've provided.
  I'm just pointing out that it's a really long-standing one, and that:
 
  'This worked fine in ADF Faces before
  porting to Trinidad where the listName was just shuttle1:leading.
  Note, however, that Trinidad now adds an additional content prefix'
 
  ... isn't quite right, since the bug existed in ADF Faces too,
  and Trinidad doesn't add the content prefix itself.
 
  -- Adam
 
 
  On 9/4/07, Gregg Leichtman [EMAIL PROTECTED] wrote:
  
   Having thought about this following your FYI (thank you for the hint),
   I
   realized that Tiles must indeed be adding a tiles name prefix to the
   name and ID attributes. The shuttle component is in a tile whose
   definition name is, not surprisingly, content.
  
   Given this, however, I still would classify this behavior in Trinidad
   as
   a bug based on the following reasoning. The component code that is
   generating the JavaScript variables:
  
   content_shuttle1_leading_desc
   content_shuttle1_trailing_desc
  
   appears to use a global replace of underscore for colon (I didn't
   check
   the Java code for this, but it seems reasonable based upon the
   generated
   ID); however, the code in the generated JavaScript function
   TrShuttleProxy._getDescArray that searches for an element match via ID
   uses a single or first replace of underscore for colon. This
   inconsistency in the handling of the modification of element IDs will
   always cause a problem for any code, Tiles or otherwise that adds
   something with a colon to the ID.
  
   Therefore, I would re-categorize this as an integration bug instead of
   a
   general Trinidad bug, but I would suggest that it is still a bug in
   Trinidad that should be fixed. If nothing else, I will need to,
   hopefully temporarily, create a duplicate TrShuttleProxy._getDescArray
   function with the suggested patch in order to get this functionality
   to
   work with Tiles or alternatively modify the Java generation code,
   something I would rather not do, since the latter interferes with easy
   upgrades.
  
   Do you agree that this is a bug and that it should be fixed?
  
 -=
   Gregg =-
  
   Adam Winer wrote:
Gregg,
   
FYI, I don't think Trinidad is adding the content:.   Perhaps
Tiles 2.0 is (I've not looked at the newer version).
   
-- Adam
   
   
On 9/3/07, Gregg Leichtman [EMAIL PROTECTED] wrote:
   
 I have found a bug in the generated JavaScript for the
   Select*Shuttle
components. A patch follows:
   
 TrShuttleProxy._getDescArray = function(listName) {
 //  var descArray = window[listName.replace(':','_') + '_desc'];
   var descArray = window[listName.replace (/:/g,'_') + '_desc'];
   // gsl fix
   return descArray;
 }
   
 where listName is content:shuttle1:leading.
   
 The problem is that the listName is not using a global replace;
   therefore
only the first ':' is being replaced. This worked fine in ADF Faces
   before
porting to Trinidad where the listName was just shuttle1:leading.
   Note,
however, that Trinidad now adds an additional content prefix to
   the
generated inline JavaScript variables:
   
 content_shuttle1_leading_desc=new Array('The First Item
Desc',
 'The Second Item Desc',
 'The Third Item Desc','');
 content_shuttle1_trailing_desc=new Array('');
   
 This means that a global replace needs to be done to create the
   proper
variable name for matching in the JavaScript code. I will report
   this on
Jira for the Trinidad project.
   
 I don't have access to the latest snapshots. The last one I see is
   from
July 11th at:
   
   
   
   http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-impl/1.2.1-SNAPSHOT/
   
 If this has been fixed already, then please clear my bug report
   which
should have the side benefit of letting people know that the bug
   has been
found and fixed already.
   
-= Gregg =-
   
  
  
  
 
 



Re: [Trinidad] Large difference in generated ID between UIXComponentBase and UIComponentBase

2007-09-05 Thread Adam Winer
I don't see how or why this is wrong...  _genId should get state
saved, so I don't understand why you're having problems unless
your custom component has overridden state saving incorrectly.
I've never seen a problem like this with any of our Trinidad components.

-- Adam


On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:

 I am wondering if this is a bug or planned with UIXComponentBase:

 I was noticing that my custom component that extended CoreCommandLink
 stopped working after a partial update. When trying to figure out why,
 I noticed that the ID of the link changed between rendering and
 therefore the decode no longer worked.

 On first page rendering, the link ID was _id44. During decode, it was
 still _id44. During encode, it was _id108. It failed partial update
 because the ID changed, and therefore all further decodes failed since
 the client was now out of sync from the server.

 In UIComponentBase.getClientId, if the getId() returns null, a new ID
 is created and then setId is called. UIXComponentBase never calls
 setId, but instead caches it in a _genId property using the
 FacesBean.

 Therefore, anything extending UIComponentBase and has a generated ID
 will never have its ID change between requests on the same view.
 However, it seems that UIXComponentBase does not guarantee that a
 component with a generated ID will have a consistent ID.

 Here is my code:

 tr:panelLabelAndMessage
   label=Test help
   tr:inputText id=testHelp value=#{testHelpText}
 simple=true /
   f:facet name=end
 cw:helpIcon for=testHelp
   messageId=test_help /
   /f:facet
 /tr:panelLabelAndMessage

 The cw:helpIcon extends CoreCommandLink

 If I give the helpIcon a hard coded ID, it works fine.

 Is this a bug, a shortcoming, or just not supported with UIXComponentBase?

 I seems like it could be a very big source of problems if IDs change
 between requests, as decodes will have a lot of problems. Should
 UIXComponentBase be calling setId after generating an ID in the
 getClientId function?

 This was found on 1.0.3-SNAPSHOT

 Any ideas?

 Thanks,
 Andrew



Re: [Trinidad] Large difference in generated ID between UIXComponentBase and UIComponentBase

2007-09-05 Thread Andrew Robinson
The code is pretty simplistic for the component:

@FaceletComponent(namespace = http://christws.com/components;,
  tagName = helpIcon,
  type = UIHelpIcon.COMPONENT_TYPE,
  rendererType = HelpIconRenderer.RENDERER_TYPE)
public class UIHelpIcon
  extends CoreCommandLink
{
  public final static String COMPONENT_FAMILY = com.christws.HelpIcon;
  public final static String COMPONENT_TYPE = com.christws.HelpIcon;

  public final static FacesBean.Type TYPE = new FacesBean.Type(
CoreCommandLink.TYPE);
  public final static PropertyKey MESSAGE_ID_KEY =
TYPE.registerKey(messageId, String.class);
  public final static PropertyKey FOR_KEY =
TYPE.registerKey(for, String.class);

  static
  {
TYPE.lockAndRegister(COMPONENT_FAMILY, COMPONENT_TYPE);
  };

  public UIHelpIcon()
  {
super(HelpIconRenderer.RENDERER_TYPE);
  }

  /**
   * @see 
org.apache.myfaces.trinidad.component.UIXComponentBase#getClientId(javax.faces.context.FacesContext)
   */
  @Override
  public String getClientId(FacesContext context)
  {
// TODO Auto-generated method stub
String id = super.getClientId(context);
return id;
  }

  /**
   * @see javax.faces.component.UIComponent#getFamily()
   */
  @Override
  public String getFamily()
  {
return COMPONENT_FAMILY;
  }

  public String getMessageId()
  {
return ComponentUtils.resolveString(getProperty(MESSAGE_ID_KEY));
  }

  public void setMessageId(String messageId)
  {
setProperty(MESSAGE_ID_KEY, messageId);
  }

  public String getFor()
  {
return ComponentUtils.resolveString(getProperty(FOR_KEY));
  }

  public void setFor(String value)
  {
setProperty(FOR_KEY, value);
  }

  /**
   * @see org.apache.myfaces.trinidad.component.UIXComponentBase#getBeanType()
   */
  @Override
  protected Type getBeanType()
  {
return TYPE;
  }

  /**
   * @see 
org.apache.myfaces.trinidad.component.UIXCommand#broadcast(javax.faces.event.FacesEvent)
   */
  @Override
  public void broadcast(FacesEvent event) throws AbortProcessingException
  {
if (event instanceof ActionEvent)
{
  HelpBean bean = FacesUtils.getBean(HelpBean.class, true);
  bean.setCurrentHelpTopicKey(getMessageId());
}
super.broadcast(event);
  }
}

As you can see, I haven't done anything to the state saving at all. I
haven't setup the maven component generation in my project yet so the
above component was hand-written, but I don't think I made any
mistakes, but not positive.

On 9/5/07, Adam Winer [EMAIL PROTECTED] wrote:
 I don't see how or why this is wrong...  _genId should get state
 saved, so I don't understand why you're having problems unless
 your custom component has overridden state saving incorrectly.
 I've never seen a problem like this with any of our Trinidad components.

 -- Adam


 On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
  I am wondering if this is a bug or planned with UIXComponentBase:
 
  I was noticing that my custom component that extended CoreCommandLink
  stopped working after a partial update. When trying to figure out why,
  I noticed that the ID of the link changed between rendering and
  therefore the decode no longer worked.
 
  On first page rendering, the link ID was _id44. During decode, it was
  still _id44. During encode, it was _id108. It failed partial update
  because the ID changed, and therefore all further decodes failed since
  the client was now out of sync from the server.
 
  In UIComponentBase.getClientId, if the getId() returns null, a new ID
  is created and then setId is called. UIXComponentBase never calls
  setId, but instead caches it in a _genId property using the
  FacesBean.
 
  Therefore, anything extending UIComponentBase and has a generated ID
  will never have its ID change between requests on the same view.
  However, it seems that UIXComponentBase does not guarantee that a
  component with a generated ID will have a consistent ID.
 
  Here is my code:
 
  tr:panelLabelAndMessage
label=Test help
tr:inputText id=testHelp value=#{testHelpText}
  simple=true /
f:facet name=end
  cw:helpIcon for=testHelp
messageId=test_help /
/f:facet
  /tr:panelLabelAndMessage
 
  The cw:helpIcon extends CoreCommandLink
 
  If I give the helpIcon a hard coded ID, it works fine.
 
  Is this a bug, a shortcoming, or just not supported with UIXComponentBase?
 
  I seems like it could be a very big source of problems if IDs change
  between requests, as decodes will have a lot of problems. Should
  UIXComponentBase be calling setId after generating an ID in the
  getClientId function?
 
  This was found on 1.0.3-SNAPSHOT
 
  Any ideas?
 
  Thanks,
  Andrew
 




Tomahawk schedule broken?

2007-09-05 Thread Ricardo Ramírez
Hi

I am trying to use the schedule component, with no luck, I tried redefining
the default classes (headerClass, dayClass), the schedule doesn't change.
Snippet:
=
t:schedule
  id=cal
  headerClass=mycss
  dayClass=mycss2
  /
==
Result: (mycss and mycss2 are ignored)


Debugging a little, I found in AbstractScheduleRenderer.class:


protected String getStyleClass(UIComponent component, String className)
{
[...]
Map attributes = component.getAttributes();
String returnValue = (String) attributes.get(className);
return returnValue == null ? className : returnValue;
}


and it is called like:
getStyleClass(comp, header);

because of this, the attribute is looked up as header, but the tag
registers it as headerClass, null is always returned, with every css
attribute.
So, even if in the taglib I write headerClass=mycss, it is ignored by the
component.

Am I missing something?
I am using yesterday's nightly build




- Ricardo Ramírez


Re: [Trinidad] Large difference in generated ID between UIXComponentBase and UIComponentBase

2007-09-05 Thread Andrew Robinson
It works fine outside of the facet,

Broken:

tr:panelLabelAndMessage
 label=Test help
 tr:inputText id=testHelp value=#{testHelpText}
   simple=true /
 f:facet name=end
   cw:helpIcon for=testHelp
 messageId=test_help /
 /f:facet
/tr:panelLabelAndMessage

Works:

tr:panelLabelAndMessage
 label=Test help
 tr:inputText id=testHelp value=#{testHelpText}
   simple=true /
/tr:panelLabelAndMessage
cw:helpIcon for=testHelp
   messageId=test_help /

Looks like a possible bug in the state saving of facets or at least in
the panelLabelAndMessage. Any ideas?


Re: Trinidad 1.2.1: SelectOrderShuttle leading/trailingDescShown Fails For Me

2007-09-05 Thread Gregg Leichtman




I previously posted a JIRA issue as:

 TRINIDAD-678:
Description Not Shown in TextArea for Select*Shuttle
Components

in the JIRA Components section. See:
http://issues.apache.org/jira/browse/TRINIDAD-678

Let me know, if you cannot locate it. I thought that this was the most
logical place.

Thanks for the version info.

 -= Gregg =-

Adam Winer wrote:
Or, rather, it will if we get a JIRA issue on it...
  
-- Adam
  
  
  On 9/5/07, Adam
Winer [EMAIL PROTECTED]
wrote:
  
  No,
it will not be in 1.2.2. It'll be in 1.0.3 and 1.2.3.


-- Adam


On 9/4/07, Gregg Leichtman 
[EMAIL PROTECTED]
 wrote:

  Agreed. The port to
Trinidad did _not_ cause this problem. My initial
diagnosis was incorrect and your point on Tiles demonstrating the
problem is the correct diagnosis. 
  
Are you in a position to say if this fix will make it into 1.2.2?
  
 -= Gregg =-
  
  
Adam Winer wrote:
  Oh, absolutely, it's a bug, and we'll apply the fix you've
provided.
I'm just pointing out that it's a really long-standing one, and that:

'This worked fine in ADF Faces before
porting to Trinidad where the listName was just "shuttle1:leading". 
Note, however, that Trinidad now adds an additional "content" prefix'

... isn't quite right, since the bug existed in ADF Faces too,
and Trinidad doesn't add the "content" prefix itself. 

-- Adam


On 9/4/07, Gregg
Leichtman [EMAIL PROTECTED]
wrote:
Having
thought about this following your FYI (thank you for the hint), I
realized that Tiles must indeed be adding a tiles name prefix to the
name and ID attributes. The shuttle component is in a tile whose
definition name is, not surprisingly, "content". 
  
Given this, however, I still would classify this behavior in Trinidad as
a bug based on the following reasoning. The component code that is
generating the _javascript_ variables:
  
content_shuttle1_leading_desc 
content_shuttle1_trailing_desc
  
appears to use a global replace of underscore for colon (I didn't check
the Java code for this, but it seems reasonable based upon the generated
ID); however, the code in the generated _javascript_ function 
TrShuttleProxy._getDescArray that searches for an element match via ID
uses a single or first replace of underscore for colon. This
inconsistency in the handling of the modification of element IDs will
always cause a problem for any code, Tiles or otherwise that adds 
something with a colon to the ID.
  
Therefore, I would re-categorize this as an integration bug instead of a
general Trinidad bug, but I would suggest that it is still a bug in
Trinidad that should be fixed. If nothing else, I will need to, 
hopefully temporarily, create a duplicate TrShuttleProxy._getDescArray
function with the suggested patch in order to get this functionality to
work with Tiles or alternatively modify the Java generation code,
something I would rather not do, since the latter interferes with easy
upgrades.
  
Do you agree that this is a bug and that it should be fixed?
  
-=
Gregg =- 
  
Adam Winer wrote:
 Gregg,

 FYI, I don't think Trinidad is adding the "content:". Perhaps
 Tiles 2.0 is (I've not looked at the newer version).

 -- Adam 


 On 9/3/07, Gregg Leichtman [EMAIL PROTECTED]
wrote:

I have found a bug in the generated _javascript_ for the
Select*Shuttle
 components. A patch follows: 

TrShuttleProxy._getDescArray = function(listName) {
//var descArray = window[listName.replace(':','_') +
'_desc'];
var descArray = window[listName.replace
(/:/g,'_') + '_desc']; // gsl fix
return descArray;
}

where listName is content:shuttle1:leading.

The problem is that the listName is not using a global
replace; therefore 
 only the first ':' is being replaced. This worked fine in ADF
Faces before
 porting to Trinidad where the listName was just
"shuttle1:leading". Note,
 however, that Trinidad now adds an additional "content" prefix
to the 
 generated inline _javascript_ variables:

content_shuttle1_leading_desc=new Array('The First Item
 Desc',
'The Second Item Desc',
'The Third Item Desc',''); 
content_shuttle1_trailing_desc=new Array('');

This means that a global replace needs to be done to create
the proper
 variable name for matching in the _javascript_ code. I will
report this on 
 Jira for the Trinidad project.

I don't have access to the latest snapshots. The last one I
see is from
 July 11th at:


 
http://people.apache.org/repo/m2-snapshot-repository/org/apache/myfaces/trinidad/trinidad-impl/1.2.1-SNAPSHOT/

If this has been fixed already, then please clear my bug
report which
 should have the side benefit of letting people know that the
bug has been 
 found and fixed already.

 -= Gregg =-

  
  



  
  
  
  




  
  
  






signature.asc
Description: OpenPGP digital signature


Re: [Trinidad] Large difference in generated ID between UIXComponentBase and UIComponentBase

2007-09-05 Thread Andrew Robinson
TreeState.saveState(FacesContext, UIXComponentBase) is being called, but

TreeState.restoreState(FacesContext, UIXComponentBase) is never called.

I'll have to look into this to see if it is something I caused or not.
Does Trinidad depend on a custom UIViewRoot implementation (I have my
own and a custom view handler that are worth looking into as the
source of the issue)?

On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
 It works fine outside of the facet,

 Broken:

 tr:panelLabelAndMessage
  label=Test help
  tr:inputText id=testHelp value=#{testHelpText}
simple=true /
  f:facet name=end
cw:helpIcon for=testHelp
  messageId=test_help /
  /f:facet
 /tr:panelLabelAndMessage

 Works:

 tr:panelLabelAndMessage
  label=Test help
  tr:inputText id=testHelp value=#{testHelpText}
simple=true /
 /tr:panelLabelAndMessage
 cw:helpIcon for=testHelp
messageId=test_help /

 Looks like a possible bug in the state saving of facets or at least in
 the panelLabelAndMessage. Any ideas?



Re: [Trinidad] Large difference in generated ID between UIXComponentBase and UIComponentBase

2007-09-05 Thread Andrew Robinson
Okay, I could really use some help, and I am confused on the Trinidad
code and how it is supposed to work.

I stepped through the code on a PPR partial submit restore view. And
the code that starts to seem fishy is the
StateManagerImpl$PageState.popRoot(FacesContext) function.

Code as follows:
UIViewRoot newRoot = (UIViewRoot)
  fc.getApplication().createComponent(UIViewRoot.COMPONENT_TYPE);

// must call restoreState so that we setup attributes, listeners,
// uniqueIds, etc ...
newRoot.restoreState(fc, viewRootState);

// we need to use a temp list because as a side effect of
// adding a child to a UIComponent, that child is removed from
// the parent UIComponent. So the following will break:
// newRoot.getChildren().addAll(root.getChildren());
// because root's child List is being mutated as the List
// is traversed.
ListUIComponent temp = new
ArrayListUIComponent(root.getChildCount());
temp.addAll(root.getChildren());
newRoot.getChildren().addAll(temp);
return newRoot;

As you can see, the state of the new UIViewRoot is restored, then the
children are added to the view root before this function returns, but
neither the restoreState nor the processRestoreState functions are
ever called on the children.

As a result the view is never restored fully. That is where I am
getting the problem.

My configuration:

Facelets 1.1.11
Trinidad 1.0.3-SNAPSHOT
Seam 1.2.1
MyFaces 1.1.5

View root: the one Trinidad installs
ALTERNATE_VIEW_HANDLER: my own custom view handler that extends
SeamFaceletViewHandler which in tern extends FaceletViewHandler.

State saving method is client.

Using *.jsf view mapping with .xhtml file suffixes.

Trinidad's USE_APPLICATION_VIEW_CACHE parameter set to false.

setting the facelets BUILD_BEFORE_RESTORE parameter to true actually
fixes the error, but that is simply because the simple view I am in
really has no real state to store. But even with this set, the
children of UIViewRoot never have their state restored.

My custom view handler creates my on view root that extends
UIViewRoot, but I don't touch any of the state methods.

Looking in the client HTML, it gets a bit fishy as well. This is what I found:

span id=_mainForm_Postscript
input type=hidden value=!-1f9a06ef
name=org.apache.myfaces.trinidad.faces.STATE/

That value seems incredible small for a view state.

I have tried server side state saving and have gotten the same result.
The code that seems very wrong in terms of it shouldn't be executed
ins in StateManagerImpl.java:

  UIViewRoot root = viewState.popRoot(context); // bug 4712492
  if (root != null)
  {
_LOG.finer(UIViewRoot for token {0} already exists. Bypassing
restoreState, token);
return root;
  }

This always is true on my PPR requests and seems to be the cause of
the state never being restored.

While in debug mode, if I force the root to be null, then everything
works. I really don't know for sure, but the above code seems to
completely break the restoring of the view state with the
configuration I have.

On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
 TreeState.saveState(FacesContext, UIXComponentBase) is being called, but

 TreeState.restoreState(FacesContext, UIXComponentBase) is never called.

 I'll have to look into this to see if it is something I caused or not.
 Does Trinidad depend on a custom UIViewRoot implementation (I have my
 own and a custom view handler that are worth looking into as the
 source of the issue)?

 On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
  It works fine outside of the facet,
 
  Broken:
 
  tr:panelLabelAndMessage
   label=Test help
   tr:inputText id=testHelp value=#{testHelpText}
 simple=true /
   f:facet name=end
 cw:helpIcon for=testHelp
   messageId=test_help /
   /f:facet
  /tr:panelLabelAndMessage
 
  Works:
 
  tr:panelLabelAndMessage
   label=Test help
   tr:inputText id=testHelp value=#{testHelpText}
 simple=true /
  /tr:panelLabelAndMessage
  cw:helpIcon for=testHelp
 messageId=test_help /
 
  Looks like a possible bug in the state saving of facets or at least in
  the panelLabelAndMessage. Any ideas?
 



Re: [Trinidad] Large difference in generated ID between UIXComponentBase and UIComponentBase

2007-09-05 Thread Andrew Robinson
Last notes on the night.

I have been trying many different configurations and debugging more. I
eventually got the client state to save correctly and the view to
restore correctly by using:

  context-param
param-nameorg.apache.myfaces.trinidad.CLIENT_STATE_METHOD/param-name
param-valueall/param-value
  /context-param
  context-param
param-nameorg.apache.myfaces.trinidad.CACHE_VIEW_ROOT/param-name
param-valuefalse/param-value
  /context-param

The problem is that facelets then kept re-building the view between
the execution of my action and the rendering of the view, which is
very odd since my action and outcome were null.

So I tried the following parameter, as that is where the facelets code
was switching on its value to rebuild the view:

  context-param
param-namefacelets.BUILD_BEFORE_RESTORE/param-name
param-valuetrue/param-value
  /context-param

Once I did that I keep getting this exception:

22:53:59,902 ERROR [DebugPageHandler] redirecting to debug page
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
java.lang.String
at 
org.apache.myfaces.trinidad.bean.util.StateUtils.restoreKey(StateUtils.java:73)
at 
org.apache.myfaces.trinidad.bean.util.StateUtils.restoreState(StateUtils.java:142)
at 
org.apache.myfaces.trinidad.bean.util.FlaggedPropertyMap.restoreState(FlaggedPropertyMap.java:194)
at 
org.apache.myfaces.trinidad.bean.FacesBeanImpl.restoreState(FacesBeanImpl.java:327)
at 
org.apache.myfaces.trinidad.component.UIXComponentBase.restoreState(UIXComponentBase.java:860)
at 
org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:838)
at 
javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
at 
org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
at 
org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:832)
at 
org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
at 
org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:832)
at 
org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
at 
org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:832)
at 
javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
at 
org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:550)
at 
com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:345)
at 
org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:266)
at 
org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:81)
at 
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
at 
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)

There seems to be some power struggle between facelets 1.1.11 and
Trinidad 1.0.3, but I haven't yet been able to figure out what is
going on that is causing all the issues.

I have to give up for tonight. Hopefully the morning will shed some
light, but I think at this point I need help from the Trinidad and
Facelets team.

On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
 Okay, I could really use some help, and I am confused on the Trinidad
 code and how it is supposed to work.

 I stepped through the code on a PPR partial submit restore view. And
 the code that starts to seem fishy is the
 StateManagerImpl$PageState.popRoot(FacesContext) function.

 Code as follows:
 UIViewRoot newRoot = (UIViewRoot)
   fc.getApplication().createComponent(UIViewRoot.COMPONENT_TYPE);

 // must call restoreState so that we setup attributes, listeners,
 // uniqueIds, etc ...
 newRoot.restoreState(fc, viewRootState);

 // we need to use a temp list because as a side effect of
 // adding a child to a UIComponent, that child is removed from
 // the parent UIComponent. So the following will break:
 // newRoot.getChildren().addAll(root.getChildren());
 // because root's child List is being mutated as the List
 // is traversed.
 ListUIComponent temp = new
 ArrayListUIComponent(root.getChildCount());
 temp.addAll(root.getChildren());
 newRoot.getChildren().addAll(temp);
 return newRoot;

 As you can see, the state of the new UIViewRoot is restored, then the
 children are added to the view root before this function returns, but
 neither the restoreState nor the processRestoreState functions are
 ever called on the children.

 As a result the view is never restored fully. That is where I am
 getting the problem.

 My configuration:

 Facelets 1.1.11
 Trinidad 

Re: [Trinidad] Large difference in generated ID between UIXComponentBase and UIComponentBase

2007-09-05 Thread Adam Winer
On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
 Last notes on the night.

 I have been trying many different configurations and debugging more. I
 eventually got the client state to save correctly and the view to
 restore correctly by using:

   context-param
 param-nameorg.apache.myfaces.trinidad.CLIENT_STATE_METHOD/param-name
 param-valueall/param-value
   /context-param

This is not likely relevant.

   context-param
 param-nameorg.apache.myfaces.trinidad.CACHE_VIEW_ROOT/param-name
 param-valuefalse/param-value
   /context-param

This second one is likely the relevant one.  This disables an
optimization that gives Facelets some problems, though generally
only when transient components are in the page - specifically,
Facelets template text.

 The problem is that facelets then kept re-building the view between
 the execution of my action and the rendering of the view, which is
 very odd since my action and outcome were null.

Indeed odd, and suggestive of something else going seriously
wrong that's leading you down this path.

 So I tried the following parameter, as that is where the facelets code
 was switching on its value to rebuild the view:

   context-param
 param-namefacelets.BUILD_BEFORE_RESTORE/param-name
 param-valuetrue/param-value
   /context-param

 Once I did that I keep getting this exception:

Don't set this - it's an experimental flag, and just sending
you further from the issue.  (No idea why it's
generating this exception).

-- Adam



 22:53:59,902 ERROR [DebugPageHandler] redirecting to debug page
 java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
 java.lang.String
 at 
 org.apache.myfaces.trinidad.bean.util.StateUtils.restoreKey(StateUtils.java:73)
 at 
 org.apache.myfaces.trinidad.bean.util.StateUtils.restoreState(StateUtils.java:142)
 at 
 org.apache.myfaces.trinidad.bean.util.FlaggedPropertyMap.restoreState(FlaggedPropertyMap.java:194)
 at 
 org.apache.myfaces.trinidad.bean.FacesBeanImpl.restoreState(FacesBeanImpl.java:327)
 at 
 org.apache.myfaces.trinidad.component.UIXComponentBase.restoreState(UIXComponentBase.java:860)
 at 
 org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:838)
 at 
 javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
 at 
 org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
 at 
 org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:832)
 at 
 org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
 at 
 org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:832)
 at 
 org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
 at 
 org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:832)
 at 
 javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:722)
 at 
 org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:550)
 at 
 com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:345)
 at 
 org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:266)
 at 
 org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:81)
 at 
 org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
 at 
 org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)

 There seems to be some power struggle between facelets 1.1.11 and
 Trinidad 1.0.3, but I haven't yet been able to figure out what is
 going on that is causing all the issues.

 I have to give up for tonight. Hopefully the morning will shed some
 light, but I think at this point I need help from the Trinidad and
 Facelets team.

 On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
  Okay, I could really use some help, and I am confused on the Trinidad
  code and how it is supposed to work.
 
  I stepped through the code on a PPR partial submit restore view. And
  the code that starts to seem fishy is the
  StateManagerImpl$PageState.popRoot(FacesContext) function.
 
  Code as follows:
  UIViewRoot newRoot = (UIViewRoot)
fc.getApplication().createComponent(UIViewRoot.COMPONENT_TYPE);
 
  // must call restoreState so that we setup attributes, listeners,
  // uniqueIds, etc ...
  newRoot.restoreState(fc, viewRootState);
 
  // we need to use a temp list because as a side effect of
  // adding a child to a UIComponent, that child is removed from
  // the parent UIComponent. So the following will break:
  // newRoot.getChildren().addAll(root.getChildren());
  // because root's 

Re: [Trinidad] Large difference in generated ID between UIXComponentBase and UIComponentBase

2007-09-05 Thread Adam Winer
On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
 Okay, I could really use some help, and I am confused on the Trinidad
 code and how it is supposed to work.

 I stepped through the code on a PPR partial submit restore view. And
 the code that starts to seem fishy is the
 StateManagerImpl$PageState.popRoot(FacesContext) function.

 Code as follows:
 UIViewRoot newRoot = (UIViewRoot)
   fc.getApplication().createComponent(UIViewRoot.COMPONENT_TYPE);

 // must call restoreState so that we setup attributes, listeners,
 // uniqueIds, etc ...
 newRoot.restoreState(fc, viewRootState);

 // we need to use a temp list because as a side effect of
 // adding a child to a UIComponent, that child is removed from
 // the parent UIComponent. So the following will break:
 // newRoot.getChildren().addAll(root.getChildren());
 // because root's child List is being mutated as the List
 // is traversed.
 ListUIComponent temp = new
 ArrayListUIComponent(root.getChildCount());
 temp.addAll(root.getChildren());
 newRoot.getChildren().addAll(temp);
 return newRoot;

 As you can see, the state of the new UIViewRoot is restored, then the
 children are added to the view root before this function returns, but
 neither the restoreState nor the processRestoreState functions are
 ever called on the children.

This is the CACHE_VIEW_ROOT optimization.  BTW, this
optimization *has* been tested with Facelets, though not
intensively with especially recent versions.

 As a result the view is never restored fully. That is where I am
 getting the problem.

No, it should be fully restored - all the children from the prior
request should still be there.


 My configuration:

 Facelets 1.1.11
 Trinidad 1.0.3-SNAPSHOT
 Seam 1.2.1
 MyFaces 1.1.5

 View root: the one Trinidad installs
 ALTERNATE_VIEW_HANDLER: my own custom view handler that extends
 SeamFaceletViewHandler which in tern extends FaceletViewHandler.

 State saving method is client.

 Using *.jsf view mapping with .xhtml file suffixes.

 Trinidad's USE_APPLICATION_VIEW_CACHE parameter set to false.

 setting the facelets BUILD_BEFORE_RESTORE parameter to true actually
 fixes the error, but that is simply because the simple view I am in
 really has no real state to store. But even with this set, the
 children of UIViewRoot never have their state restored.

 My custom view handler creates my on view root that extends
 UIViewRoot, but I don't touch any of the state methods.

 Looking in the client HTML, it gets a bit fishy as well. This is what I found:

 span id=_mainForm_Postscript
 input type=hidden value=!-1f9a06ef
 name=org.apache.myfaces.trinidad.faces.STATE/

 That value seems incredible small for a view state.

That's because its a token.  Not the full state.

 I have tried server side state saving and have gotten the same result.
 The code that seems very wrong in terms of it shouldn't be executed
 ins in StateManagerImpl.java:

   UIViewRoot root = viewState.popRoot(context); // bug 4712492
   if (root != null)
   {
 _LOG.finer(UIViewRoot for token {0} already exists. Bypassing
 restoreState, token);
 return root;
   }

 This always is true on my PPR requests and seems to be the cause of
 the state never being restored.

It's actually a really valuable optimization, especially for PPR.

-- Adam

 While in debug mode, if I force the root to be null, then everything
 works. I really don't know for sure, but the above code seems to
 completely break the restoring of the view state with the
 configuration I have.

 On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
  TreeState.saveState(FacesContext, UIXComponentBase) is being called, but
 
  TreeState.restoreState(FacesContext, UIXComponentBase) is never called.
 
  I'll have to look into this to see if it is something I caused or not.
  Does Trinidad depend on a custom UIViewRoot implementation (I have my
  own and a custom view handler that are worth looking into as the
  source of the issue)?
 
  On 9/5/07, Andrew Robinson [EMAIL PROTECTED] wrote:
   It works fine outside of the facet,
  
   Broken:
  
   tr:panelLabelAndMessage
label=Test help
tr:inputText id=testHelp value=#{testHelpText}
  simple=true /
f:facet name=end
  cw:helpIcon for=testHelp
messageId=test_help /
/f:facet
   /tr:panelLabelAndMessage
  
   Works:
  
   tr:panelLabelAndMessage
label=Test help
tr:inputText id=testHelp value=#{testHelpText}
  simple=true /
   /tr:panelLabelAndMessage
   cw:helpIcon for=testHelp
  messageId=test_help /
  
   Looks like a possible bug in the state saving of facets or at least in
   the panelLabelAndMessage. Any ideas?