AjaxAnywhere and DataScroller

2006-03-01 Thread Emmanuel Jay
Hi,

I am having problems ajax-ifying the MyFaces dataScroller with AA. I basically get a JSerror of the type:'document.forms.mainForm.elements.mainForm:ds_9898989' is null or not an object. where ds_9898989 is the id of the dataScroller (links).


Using AA the links don't seems to be rendered if the scroller is not rendered and then rendered at a later time...

Has anybody encountered such a problem?

Thanks for your help,

Emmanuel




FW: Value binding problems

2006-03-01 Thread Nikita Belov








Can anybody suggest
where I have made mistake?



My application
uses own PropertyResolver. It gets values for JSF components from XML documents
by XPath expressions, thus it cant predict actual data type (String,
Integer, Boolean) of the returned value and always return some object with
implemented toString() method. This mechanism worked perfectly with Sun RI, but,
when I switch to MyFaces, it has failed. For some reason, MyFaces JSF
components need values of the certain data type (for example, Boolean for h:selectBooleanCheckbox).
Why it doesnt try to convert value to expected type as suggested in JSP
2.0 spec? Where I have mistaken?





__







With Best
Regards,
Nikita Belov













From:
Nikita Belov
[mailto:[EMAIL PROTECTED] 
Sent: Monday, February 27, 2006
11:01 PM
To: 'users@myfaces.apache.org'
Subject: Value binding problems





Hello,



I have two problems with
MyFaces 1.1.1.



1). I have created page:

. . . .

h:selectBooleanCheckbox
id=checkbox value=#{Bean.prop}/

. . . .

It is uses managed bean:

public class Bean {

 public
String getProp() {


return true;

 }

}



During page rendering, MyJSF
throws exception: java.lang.IllegalArgumentException: Expected submitted
value of type Boolean. However, by specification (JSF 1.1 spec: Section
5.1.3 and JSP 2.0 spec: Section 2.8.5), string true must be
converted to Boolean by Boolean.valueOf() method.



2). Page:

. . . .

h:selectOneMenu
id=menu value=#{Bean.prop}


f:selectItem itemValue=1 itemLabel=1/


f:selectItem itemValue=2 itemLabel=2/


f:selectItem itemValue=3 itemLabel=3/

/h:selectOneMenu

. . . .

This time following beans
used:

public class Bean {


public Prop getProp() {


return new Prop();


}

}



public class Prop {


public String toString() {


return 2;


}

}



Page rendering fails with
exception: java.lang.IllegalArgumentException: Value is no String and
component form_id:menu does not have a Converter. By specification (JSF
1.1 spec: Section 5.1.3 and JSP 2.0 spec: Section 2.8.2), Prop object must be
converted to String by Prop.toString() method.



With Sun JSF RI both these
examples works properly. Is this MyJSF bugs or I have made something wrong?



__







With Best Regards,
Nikita Belov










Tree2 and state saving

2006-03-01 Thread Huy Do
Hallo,

i'm new to JSF and just wrote some code snippets
using the tree2 component.

My problem is that the state of the treemodel (especially
which node are expanded) is not passed through
several requests.

For example:
I include the tree in welcome.jsp and in view.jsp
but if i change the the view via an action to
view.jsp i lost the state of the tree.
All nodes are collapsed again.

Can somebody give me a hint.
I don't want to user frames to solve this problem :-(

BTW: can i download the source code of the (tomahawk) examples anywhere?

Thanks a lot.


-- 
Best regards,
 Huy  mailto:[EMAIL PROTECTED]



JSF - Spring - OpenSessionInViewFilter

2006-03-01 Thread Sebastien Boutte




Hello,

I'm trying to get Spring's OpenSessionInFilterView to work but i'm not very lucky.
I would like to get an hibernate session directly from my controller for doing dao operations (create, find ...) ;
without using HibernateDao class.
How can i access the same session used by my OpenSessionInFilterView ?

Thanks,

Sebastien Boutte

I do :

1. Put in my web.xml :
context-param
 param-namecontextConfigLocation/param-name
 param-value/WEB-INF/applicationContext.xml/param-value
/context-param

filter
 filter-namesessionFilter/filter-name
 filter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class
 init-param
 param-namesessionFactoryBeanName/param-name
	param-valuesessionFactory/param-value
 /init-param
 init-param
	param-namesingleSession/param-name
	param-valuetrue/param-value
	/init-param	
 /filter
 
 filter-mapping
 filter-namesessionFilter/filter-name
 url-pattern*.jsf/url-pattern
 /filter-mapping

listener
 listener-classorg.springframework.web.context.ContextLoaderListener/listener-class
 /listener
2. My Application Context :

?xml version=1.0 encoding=UTF-8?
!DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN http://www.springframework.org/dtd/spring-beans.dtd

beans
	bean id=sessionFactory class=org.springframework.orm.hibernate3.LocalSessionFactoryBean
		property name=mappingResources
 		list
 			valuecom/eca/businessobjects/core/produit/ProduitTypePaiement.hbm.xml/value
 valuecom/eca/businessobjects/core/dictionnaire/Categorie.hbm.xml/value
 valuecom/eca/businessobjects/core/distribution/Protocole.hbm.xml/value
 ...
 		/list
 		/property
 		property name=hibernateProperties
 		props
 			prop key=hibernate.dialect
 			org.hibernate.dialect.PostgreSQLDialect
 			/prop
 			prop key=current_session_context_class
 			thread
 			/prop
 			prop key=show_sql
 			true
 			/prop
 			prop key=hibernate.dialect
 			org.hibernate.dialect.HSQLDialect
 			/prop
 			prop key=jdbc.batch_size
 			0
 			/prop
 			prop key=hibernate.connection.driver_class
 			org.postgresql.Driver
 			/prop
 			prop key=hibernate.connection.url
 			jdbc:postgresql://myhost
 			/prop
 			prop key=hibernate.connection.username
 		
 			/prop
 			prop key=hibernate.connection.password
 			
 			/prop
 		/props
 		/property
	/bean
/beans

3. I Have a static class use to retrieve the hibernate's session but it's not in the application context :

I 've tried various methods :

ApplicationContext ctx = FacesContextUtils.getWebApplicationContext(FacesContext.getCurrentInstance());
sessionFactory = (SessionFactory) ctx.getBean(sessionFactory);
return sessionFactory.getCurrentSession();

return SessionFactoryUtils.getSession(getSessionFactory(),true);

But nothing is working ...

Could you help me ?


 




Losing buttons in datascroller page

2006-03-01 Thread Johnny Gonzalez
Hello Everybody,

I'm trying to add dataScroller funcionality to a page
in which I have a list of elements, so I modified and
added all stuff related to the dataScroller, like in
the myfaces examples at Irian
(http://www.irian.at/myfaces/dataScroller.jsf), to my
JSP. 

The page with the list appears with the navigation
buttons (to go pages back or forward) The number of
pages appears ok, but when I click on next page for
example, all buttons for page navigation disappear,
and I cannot go back to the last page listing, the
only way is to press Back button in Mozilla :-(.

My JSP looks like this:

h:panelGroup id=body
 t:dataTable 
id=listaPaquetes 
   
value=#{AdministrarPaquetesBean.listaPaquetes}
var=lstPaquetesVar
 
  
border=0  


headerClass=tableHeader

rowClasses=tableRow1,tableRow2

preserveDataModel=false
rows=5
h:column

f:facet name=header

f:verbatimNombre del Paquete/f:verbatim

/f:facet

h:outputText
value=#{lstPaquetesVar.nombre}/
/h:column
h:column

f:facet name=header

f:verbatimProducto/f:verbatim

/f:facet

h:outputText value=Orientaciones Abogado/

f:verbatimbr/f:verbatim   


h:outputText value=Orientaciones
Contador/

f:verbatimbr/f:verbatim   


h:outputText value=InfoTrámites/

f:verbatimbr/f:verbatim   


h:outputText value=Formatos de Documento/
/h:column
h:column

f:facet name=header

f:verbatimCantidad por
Producto/f:verbatim

/f:facet

h:outputText
value=#{lstPaquetesVar.numeroOrientacionesAbogado}/

f:verbatimbr/f:verbatim

h:outputText
value=#{lstPaquetesVar.numeroOrientacionesContador}/

f:verbatimbr/f:verbatim   


h:outputText
value=#{lstPaquetesVar.numeroTramites}/

f:verbatimbr/f:verbatim   


h:outputText
value=#{lstPaquetesVar.numeroFormatosDoc}/   

/h:column
h:column

f:facet name=header
   

Re: How to make complex layout using datatable?

2006-03-01 Thread Joey Geiger

What is then the suggested method to obtain the same functionality?


Andrew Robinson wrote:

dataList is deprecated. The Tomahawk developers recommend that you do
not use it. It doesn't not correctly process the update components
phase

On 2/28/06, Mike Kienenberger [EMAIL PROTECTED] wrote:
  

Or you could use t:dataList.   You're responsible for generating the
tags, but the component will handle the iteration for you.

On 2/28/06, Andrew Robinson [EMAIL PROTECTED] wrote:


The other alternative, although not as nice perhaps, is to use
dataTable with one column and then build div tags with your own
width/height settings for each row. The CSS will be more complex, but
you have complete control, and since you are using dataTable, the data
will post back correctly during the update models phase of JSF.

On 2/28/06, Frank Felix Debatin [EMAIL PROTECTED] wrote:
  

The table component of ADF faces supports column groups (by nesting
af:column), and, maybe you also need the column attribute separateRows
that forces childs to be rendered as separate cells. Have a look at:

http://tinyurl.com/p98e8

HTH
Frank Felix


From: wang kai [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 28, 2006 10:04 AM
To: MyFaces Discussion
Subject: Re: How to make complex layout using datatable?


Thanks for your reply.


2006/2/28, Amit Jain [EMAIL PROTECTED]:

As far as i know dataTable dont support colspan and rowspan. If you
need such thing, you have to make your own renderer for dataTable(extend
HtmlTableRenderer) to support colspan and rowspan.

- Original Message -
From: wang kai mailto:[EMAIL PROTECTED]
To: users@myfaces.apache.org
Sent: Tuesday, February 28, 2006 2:12 PM
Subject: How to make complex layout using datatable?


Hi all,

I got a demand that need to show comlex data in a datatable
like the following table.















































Could anyone direct me how to implement it using datatable?

Thanks





No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.1.1/270 - Release
Date: 2/27/2006









  





Re: JSF - Spring - OpenSessionInViewFilter

2006-03-01 Thread Aleksei Valikov

Hi.

I'm trying to get Spring's OpenSessionInFilterView to work but i'm not 
very lucky.


We've got OSIV working in our JSF/MyFaces/Facelets/Spring app.


I do :

1. Put in my web.xml :


[skip]

Looks fine.


2. My Application Context :


[...] looks fine.

3. I Have a static class use to retrieve the hibernate's session but 
it's not in the application context :


I 've tried various methods :

ApplicationContext ctx = 
FacesContextUtils.getWebApplicationContext(FacesContext.getCurrentInstance());

sessionFactory = (SessionFactory) ctx.getBean(sessionFactory);
return sessionFactory.getCurrentSession();

return SessionFactoryUtils.getSession(getSessionFactory(),true);

But nothing is working ...


I'd suggest using Hibernate through Spring's HibernateDaoSupport, not 
accessing session factory/sessions directly.


Your setup looks fine. What exactly isn't working? Have you tried 
downtracing? Is the session set in a thread-local var in your filter? Do 
session factory/utils access this var?


Bye.
/lexi


Re: Session Expiration Default Target?

2006-03-01 Thread Elam Daly
Thanks for the help Mike. Worked like a charm.-ElamOn 2/28/06, Mike Kienenberger [EMAIL PROTECTED]
 wrote:  On 2/27/06, Elam Daly [EMAIL PROTECTED]
 wrote: how do I determine if a session has expired? Mike Kienenberger wrote:  You have to do something like this:   boolean expired = false;
  try  { session.getAttribute(anything): expired = false;  }  catch (IllegalStateException e)
  {  expired = true;  }On 2/28/06, Jonathan Harley [EMAIL PROTECTED] wrote: No, in a filter you can just call 
session.isNew()That would be incorrect, although you could possibly replacegetAttribute() with isNew() in the code above. public abstract boolean isNew()A session is considered to be new if it has been created by the
server, but the client has not yet acknowledged joining the session.For example, if the server supported only cookie-based sessions andthe client had completely disabled the use of cookies, then calls toHttpServletRequest.getSession
() would always return new sessions.Returns:true if the session has been created by the server but theclient has not yet acknowledged joining the session; false otherwiseThrows: IllegalStateException
if an attempt is made to access session data after the sessionhas been invalidated


RE: [OT] Facelets JSP Scriptlets

2006-03-01 Thread Garner, Shawn
This should be directed to the Facelets list

My email goes over its limit too often with one list let alone two.
Otherwise I would.

Shawn
-Original Message-
From: Adam Winer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 28, 2006 5:16 PM
To: MyFaces Discussion
Subject: Re: [OT] Facelets  JSP Scriptlets

Shawn,

This should be directed to the Facelets list;  but I'll answer
it here:  no, Facelets doesn't support JSP scriptlets, and
is extremely unlikely to ever do so.

-- Adam


On 2/28/06, Garner, Shawn [EMAIL PROTECTED] wrote:



 Is there any chance that facelets supports JSP Scriptlets?

 I know it supports jstl and el but sometimes I still like to use
scriptlets
 even though I know it should be converted to a tag.

 I just don't want to take the time to convert everything to tag libraries.

 Mostly for function calls that take in parameters.



 Shawn






 This email may contain confidential
 material. If you were not an intended recipient,
 Please notify the sender and delete all copies.
 We may monitor email to and from our network.


***


 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 



There's an issue with synching tobago sheet to backing bean

2006-03-01 Thread Nazar Stasiv
Provided backing bean contains collection of items and is in the request 
scope. If other user deletes an item from the bean there will be 
irrelevant data on your own screen. If you perform delete action on the 
very same item in the sheet you'll get loss of data.


The issue itself is that tobago sheet doesn't recognize backing bean was 
changed. and in case of delete operation as above some items in backing 
bean shift up. And there is very big chance you'll delete item which was 
next to item you meant to delete.


Had anyone experienced such kind of problems?

Thank You




RE: Tree2 and state saving

2006-03-01 Thread CONNER, BRENDAN \(SBCSI\)
I don't know the specifics of your example, but my first instinct would
be that you need to use t:saveState to save the state of the tree
between requests.

- Brendan

-Original Message-
From: Huy Do [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 01, 2006 5:17 AM
To: users@myfaces.apache.org
Subject: Tree2 and state saving


Hallo,

i'm new to JSF and just wrote some code snippets
using the tree2 component.

My problem is that the state of the treemodel (especially
which node are expanded) is not passed through
several requests.

For example:
I include the tree in welcome.jsp and in view.jsp
but if i change the the view via an action to
view.jsp i lost the state of the tree.
All nodes are collapsed again.

Can somebody give me a hint.
I don't want to user frames to solve this problem :-(

BTW: can i download the source code of the (tomahawk) examples anywhere?

Thanks a lot.


-- 
Best regards,
 Huy  mailto:[EMAIL PROTECTED]



RE: How to make complex layout using datatable?

2006-03-01 Thread CONNER, BRENDAN \(SBCSI\)
Is this deprecation official?  I didn't see anything in the JavaDoc
indicating this.  We're using this in our reports to output a list of
tables.  What's the risk of using this, or is there a replacement
component that provides similar functionality?

Thanks,

- Brendan

-Original Message-
From: Andrew Robinson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 28, 2006 10:45 PM
To: MyFaces Discussion
Subject: Re: How to make complex layout using datatable?


dataList is deprecated. The Tomahawk developers recommend that you do
not use it. It doesn't not correctly process the update components
phase

On 2/28/06, Mike Kienenberger [EMAIL PROTECTED] wrote:
 Or you could use t:dataList.   You're responsible for generating the
 tags, but the component will handle the iteration for you.

 On 2/28/06, Andrew Robinson [EMAIL PROTECTED] wrote:
  The other alternative, although not as nice perhaps, is to use
  dataTable with one column and then build div tags with your own
  width/height settings for each row. The CSS will be more complex,
but
  you have complete control, and since you are using dataTable, the
data
  will post back correctly during the update models phase of JSF.
 
  On 2/28/06, Frank Felix Debatin [EMAIL PROTECTED] wrote:
   The table component of ADF faces supports column groups (by
nesting
   af:column), and, maybe you also need the column attribute
separateRows
   that forces childs to be rendered as separate cells. Have a look
at:
  
   http://tinyurl.com/p98e8
  
   HTH
   Frank Felix
   
  
   From: wang kai [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, February 28, 2006 10:04 AM
   To: MyFaces Discussion
   Subject: Re: How to make complex layout using datatable?
  
  
   Thanks for your reply.
  
  
   2006/2/28, Amit Jain [EMAIL PROTECTED]:
  
   As far as i know dataTable dont support colspan and
rowspan. If you
   need such thing, you have to make your own renderer for
dataTable(extend
   HtmlTableRenderer) to support colspan and rowspan.
  
   - Original Message -
   From: wang kai mailto:[EMAIL PROTECTED]
   To: users@myfaces.apache.org
   Sent: Tuesday, February 28, 2006 2:12 PM
   Subject: How to make complex layout using
datatable?
  
  
   Hi all,
  
   I got a demand that need to show comlex data in a
datatable
   like the following table.
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
   Could anyone direct me how to implement it using
datatable?
  
   Thanks
  
  
  
   
  
   No virus found in this incoming
message.
   Checked by AVG Free Edition.
   Version: 7.1.375 / Virus Database: 268.1.1/270 -
Release
   Date: 2/27/2006
  
  
  
  
  
 



Re: How to make complex layout using datatable?

2006-03-01 Thread Andrew Robinson
It is not officially deprecated, sorry if that was misleading. I tried
to use dataList, and found that it was not updating my backing beans
at all. So I did some googling and found a thread on the very issue.
They said to use a 1 column dataTable instead and it was implied from
the conversation that the myfaces team was not going to fix dataList.
In fact they talked about recommending that dataList be not used at
all or removed and just have the ability to use dataList rendering
types (bullet for example) with dataTable. Unfortunately I don't have
the conversation bookmarked, but you should be able to find it using
google (look for updaing backing beans with dataList). dataList should
work for read-only data, but don't bother trying to put input elements
into it as it will not update on post.

On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote:
 Is this deprecation official?  I didn't see anything in the JavaDoc
 indicating this.  We're using this in our reports to output a list of
 tables.  What's the risk of using this, or is there a replacement
 component that provides similar functionality?

 Thanks,

 - Brendan

 -Original Message-
 From: Andrew Robinson [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 28, 2006 10:45 PM
 To: MyFaces Discussion
 Subject: Re: How to make complex layout using datatable?


 dataList is deprecated. The Tomahawk developers recommend that you do
 not use it. It doesn't not correctly process the update components
 phase

 On 2/28/06, Mike Kienenberger [EMAIL PROTECTED] wrote:
  Or you could use t:dataList.   You're responsible for generating the
  tags, but the component will handle the iteration for you.
 
  On 2/28/06, Andrew Robinson [EMAIL PROTECTED] wrote:
   The other alternative, although not as nice perhaps, is to use
   dataTable with one column and then build div tags with your own
   width/height settings for each row. The CSS will be more complex,
 but
   you have complete control, and since you are using dataTable, the
 data
   will post back correctly during the update models phase of JSF.
  
   On 2/28/06, Frank Felix Debatin [EMAIL PROTECTED] wrote:
The table component of ADF faces supports column groups (by
 nesting
af:column), and, maybe you also need the column attribute
 separateRows
that forces childs to be rendered as separate cells. Have a look
 at:
   
http://tinyurl.com/p98e8
   
HTH
Frank Felix

   
From: wang kai [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 28, 2006 10:04 AM
To: MyFaces Discussion
Subject: Re: How to make complex layout using datatable?
   
   
Thanks for your reply.
   
   
2006/2/28, Amit Jain [EMAIL PROTECTED]:
   
As far as i know dataTable dont support colspan and
 rowspan. If you
need such thing, you have to make your own renderer for
 dataTable(extend
HtmlTableRenderer) to support colspan and rowspan.
   
- Original Message -
From: wang kai mailto:[EMAIL PROTECTED]
To: users@myfaces.apache.org
Sent: Tuesday, February 28, 2006 2:12 PM
Subject: How to make complex layout using
 datatable?
   
   
Hi all,
   
I got a demand that need to show comlex data in a
 datatable
like the following table.
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
Could anyone direct me how to implement it using
 datatable?
   
Thanks
   
   
   

   
No virus found in this incoming
 message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.1.1/270 -
 Release
Date: 2/27/2006
   
   
   
   
   
  
 



Re: MyFaces dataTable column sorting

2006-03-01 Thread Dave Brondsema
devosc wrote:
 under what conditions might 'getAscending' be called ? From the
 definitions of Boolean.valueOf(String) it is only true when the
 sortAscending attr value is 'true', yet I cant see in any of the
 examples a 'getAscending' method ?
 

You would use it in your code in your sorting method (or your DAO
querying method if you have the database do the sorting) to decide if
you should sort ascending or descending.

-- 
Dave Brondsema
Software Developer
Cornerstone University



signature.asc
Description: OpenPGP digital signature


Re: How to make complex layout using datatable?

2006-03-01 Thread Martin Marinschek
In the meantime, dataList has in fact been fixed by Dennis and me. So
it should be ok to use it again - but only in the nightly builds.

regards,

Martin

On 3/1/06, Andrew Robinson [EMAIL PROTECTED] wrote:
 It is not officially deprecated, sorry if that was misleading. I tried
 to use dataList, and found that it was not updating my backing beans
 at all. So I did some googling and found a thread on the very issue.
 They said to use a 1 column dataTable instead and it was implied from
 the conversation that the myfaces team was not going to fix dataList.
 In fact they talked about recommending that dataList be not used at
 all or removed and just have the ability to use dataList rendering
 types (bullet for example) with dataTable. Unfortunately I don't have
 the conversation bookmarked, but you should be able to find it using
 google (look for updaing backing beans with dataList). dataList should
 work for read-only data, but don't bother trying to put input elements
 into it as it will not update on post.

 On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote:
  Is this deprecation official?  I didn't see anything in the JavaDoc
  indicating this.  We're using this in our reports to output a list of
  tables.  What's the risk of using this, or is there a replacement
  component that provides similar functionality?
 
  Thanks,
 
  - Brendan
 
  -Original Message-
  From: Andrew Robinson [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 28, 2006 10:45 PM
  To: MyFaces Discussion
  Subject: Re: How to make complex layout using datatable?
 
 
  dataList is deprecated. The Tomahawk developers recommend that you do
  not use it. It doesn't not correctly process the update components
  phase
 
  On 2/28/06, Mike Kienenberger [EMAIL PROTECTED] wrote:
   Or you could use t:dataList.   You're responsible for generating the
   tags, but the component will handle the iteration for you.
  
   On 2/28/06, Andrew Robinson [EMAIL PROTECTED] wrote:
The other alternative, although not as nice perhaps, is to use
dataTable with one column and then build div tags with your own
width/height settings for each row. The CSS will be more complex,
  but
you have complete control, and since you are using dataTable, the
  data
will post back correctly during the update models phase of JSF.
   
On 2/28/06, Frank Felix Debatin [EMAIL PROTECTED] wrote:
 The table component of ADF faces supports column groups (by
  nesting
 af:column), and, maybe you also need the column attribute
  separateRows
 that forces childs to be rendered as separate cells. Have a look
  at:

 http://tinyurl.com/p98e8

 HTH
 Frank Felix
 

 From: wang kai [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 28, 2006 10:04 AM
 To: MyFaces Discussion
 Subject: Re: How to make complex layout using datatable?


 Thanks for your reply.


 2006/2/28, Amit Jain [EMAIL PROTECTED]:

 As far as i know dataTable dont support colspan and
  rowspan. If you
 need such thing, you have to make your own renderer for
  dataTable(extend
 HtmlTableRenderer) to support colspan and rowspan.

 - Original Message -
 From: wang kai mailto:[EMAIL PROTECTED]
 To: users@myfaces.apache.org
 Sent: Tuesday, February 28, 2006 2:12 PM
 Subject: How to make complex layout using
  datatable?


 Hi all,

 I got a demand that need to show comlex data in a
  datatable
 like the following table.















































 Could anyone direct me how to implement it using
  datatable?

 Thanks



 

 No virus found in this incoming
  message.
 Checked by AVG Free Edition.
 Version: 7.1.375 / Virus Database: 268.1.1/270 -
  Release
 Date: 2/27/2006





   
  
 



--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


[OC4J] tld files inside of a jar

2006-03-01 Thread Matthias Wessendorf
Hi,

I noticed a problem, with OC4J 9.0.4.1.0 and .tld files, which are
located in a jar under META-INF. MyFaces, Tiles (core / standalone)
and Shale stores all files there.

Works fine for me in Tomcat (standalone and included into JBoss)

However, a co-workers JAR file contains the .tld under
META-INF/tlds/ that works in OC4J fine too. (no jsf components
contained, just *regular* jsp custom actions)

When I try something like this inside my web.xml
  taglib
taglib-urihttp://java.sun.com/jsf/core/taglib-uri
taglib-location/WEB-INF/core.tld/taglib-location
  /taglib


I got the (interesting) stack trace.

Any ideas? (under tomcat/jboss it works out of the box)
-Matthias

snip
Exception:

java.lang.NullPointerException
at 
oracle.jsp.parse.JspDirectiveTaglib.validateAttributes(JspDirectiveTaglib.java:183)
at 
oracle.jsp.parse.JspParseTagDirective.validateTagAttributes(JspParseTagDirective.java:179)
at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:921)
at 
oracle.jsp.parse.JspParseTagDirective.parse(JspParseTagDirective.java:318)
at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:184)
at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:154)
at 
oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:427)
at 
oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:283)
at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:438)
at 
oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:542)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:304)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
at 
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at 
com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:251)
at 
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
at 
org.apache.shale.tiles.TilesViewHandler.dispatchToTile(TilesViewHandler.java:318)
at 
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:159)
at 
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at 
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at 
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:124)
at 
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at 
org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:278)
at 
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
at 
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at 
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
at 
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at 
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at 
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)


/snip

--
Matthias Wessendorf
Zülpicher Wall 12, 239
50674 Köln
http://www.wessendorf.net
mwessendorf-at-gmail-dot-com


Re: [OC4J] tld files inside of a jar

2006-03-01 Thread Matthias Wessendorf
The adf-jars also contain their .tld directly under META-INF instead
of META-INF/tlds

-Matthias

On 3/1/06, Matthias Wessendorf [EMAIL PROTECTED] wrote:
 Hi,

 I noticed a problem, with OC4J 9.0.4.1.0 and .tld files, which are
 located in a jar under META-INF. MyFaces, Tiles (core / standalone)
 and Shale stores all files there.

 Works fine for me in Tomcat (standalone and included into JBoss)

 However, a co-workers JAR file contains the .tld under
 META-INF/tlds/ that works in OC4J fine too. (no jsf components
 contained, just *regular* jsp custom actions)

 When I try something like this inside my web.xml
   taglib
 taglib-urihttp://java.sun.com/jsf/core/taglib-uri
 taglib-location/WEB-INF/core.tld/taglib-location
   /taglib


 I got the (interesting) stack trace.

 Any ideas? (under tomcat/jboss it works out of the box)
 -Matthias

 snip
 Exception:

 java.lang.NullPointerException
 at 
 oracle.jsp.parse.JspDirectiveTaglib.validateAttributes(JspDirectiveTaglib.java:183)
 at 
 oracle.jsp.parse.JspParseTagDirective.validateTagAttributes(JspParseTagDirective.java:179)
 at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:921)
 at 
 oracle.jsp.parse.JspParseTagDirective.parse(JspParseTagDirective.java:318)
 at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
 at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:184)
 at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:154)
 at 
 oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:427)
 at 
 oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:283)
 at 
 oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:438)
 at 
 oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:542)
 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:304)
 at 
 oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at 
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
 at 
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
 at 
 com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:251)
 at 
 org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
 at 
 org.apache.shale.tiles.TilesViewHandler.dispatchToTile(TilesViewHandler.java:318)
 at 
 org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:159)
 at 
 org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372)
 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
 at 
 com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
 at 
 org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:124)
 at 
 com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
 at 
 org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:278)
 at 
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
 at 
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
 at 
 com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
 at 
 com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
 at 
 com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
 at 
 com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
 at java.lang.Thread.run(Thread.java:534)


 /snip

 --
 Matthias Wessendorf
 Zülpicher Wall 12, 239
 50674 Köln
 http://www.wessendorf.net
 mwessendorf-at-gmail-dot-com



--
Matthias Wessendorf
Zülpicher Wall 12, 239
50674 Köln
http://www.wessendorf.net
mwessendorf-at-gmail-dot-com


RE: How to make complex layout using datatable?

2006-03-01 Thread CONNER, BRENDAN \(SBCSI\)
Great.  Thanks, Martin!

- Brendan

-Original Message-
From: Martin Marinschek [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 01, 2006 10:13 AM
To: MyFaces Discussion
Subject: Re: How to make complex layout using datatable?


In the meantime, dataList has in fact been fixed by Dennis and me. So
it should be ok to use it again - but only in the nightly builds.

regards,

Martin

On 3/1/06, Andrew Robinson [EMAIL PROTECTED] wrote:
 It is not officially deprecated, sorry if that was misleading. I tried
 to use dataList, and found that it was not updating my backing beans
 at all. So I did some googling and found a thread on the very issue.
 They said to use a 1 column dataTable instead and it was implied from
 the conversation that the myfaces team was not going to fix dataList.
 In fact they talked about recommending that dataList be not used at
 all or removed and just have the ability to use dataList rendering
 types (bullet for example) with dataTable. Unfortunately I don't have
 the conversation bookmarked, but you should be able to find it using
 google (look for updaing backing beans with dataList). dataList should
 work for read-only data, but don't bother trying to put input elements
 into it as it will not update on post.

 On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote:
  Is this deprecation official?  I didn't see anything in the JavaDoc
  indicating this.  We're using this in our reports to output a list
of
  tables.  What's the risk of using this, or is there a replacement
  component that provides similar functionality?
 
  Thanks,
 
  - Brendan
 
  -Original Message-
  From: Andrew Robinson [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 28, 2006 10:45 PM
  To: MyFaces Discussion
  Subject: Re: How to make complex layout using datatable?
 
 
  dataList is deprecated. The Tomahawk developers recommend that you
do
  not use it. It doesn't not correctly process the update components
  phase
 
  On 2/28/06, Mike Kienenberger [EMAIL PROTECTED] wrote:
   Or you could use t:dataList.   You're responsible for generating
the
   tags, but the component will handle the iteration for you.
  
   On 2/28/06, Andrew Robinson [EMAIL PROTECTED] wrote:
The other alternative, although not as nice perhaps, is to use
dataTable with one column and then build div tags with your own
width/height settings for each row. The CSS will be more
complex,
  but
you have complete control, and since you are using dataTable,
the
  data
will post back correctly during the update models phase of JSF.
   
On 2/28/06, Frank Felix Debatin [EMAIL PROTECTED] wrote:
 The table component of ADF faces supports column groups (by
  nesting
 af:column), and, maybe you also need the column attribute
  separateRows
 that forces childs to be rendered as separate cells. Have a
look
  at:

 http://tinyurl.com/p98e8

 HTH
 Frank Felix
 

 From: wang kai [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 28, 2006 10:04 AM
 To: MyFaces Discussion
 Subject: Re: How to make complex layout using datatable?


 Thanks for your reply.


 2006/2/28, Amit Jain [EMAIL PROTECTED]:

 As far as i know dataTable dont support colspan and
  rowspan. If you
 need such thing, you have to make your own renderer for
  dataTable(extend
 HtmlTableRenderer) to support colspan and rowspan.

 - Original Message -
 From: wang kai mailto:[EMAIL PROTECTED]
 To: users@myfaces.apache.org
 Sent: Tuesday, February 28, 2006 2:12 PM
 Subject: How to make complex layout using
  datatable?


 Hi all,

 I got a demand that need to show comlex data
in a
  datatable
 like the following table.















































 Could anyone direct me how to implement it
using
  datatable?

 Thanks






 No virus found in this
incoming
  message.
 Checked by AVG Free Edition.
 Version: 7.1.375 / Virus Database: 268.1.1/270
-
  Release
 Date: 2/27/2006





   
  
 



--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


Re: [OC4J] tld files inside of a jar

2006-03-01 Thread Matthias Wessendorf
After removing the Tiles (standalone) and the Shale-Tiles JARs,
I got this interesting exception:

My application includes the jsp-2.0.jar as pointed out here:
http://tinyurl.com/jcwxh

Because of, when I haven't it included I got a classDefNotFound for
JSP EL (ELExcepption)

I think there is a mismatch between OC4J 9.0.4.1.0' JSP files...
:-(

Any ideas, howto patch/fix this ...


snip
Exception:

java.lang.VerifyError: (class: javax/faces/webapp/UIComponentTag,
method: getParentUIComponentTag signature:
(Ljavax/servlet/jsp/PageContext;)Ljavax/faces/webapp/UIComponentTag;)
Incompatible object argument for function call
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
at java.lang.Class.privateGetPublicMethods(Class.java:1778)
at java.lang.Class.getMethods(Class.java:832)
at 
oracle.jsp.parse.JspBeanInfo.determineSetPropertyOverloading(JspBeanInfo.java:394)
at oracle.jsp.parse.JspBeanInfo.getSetProperty(JspBeanInfo.java:704)
at 
oracle.jsp.parse.JspBeanDictionary.getSetPropertyInfo(JspBeanDictionary.java:193)
at oracle.jsp.parse.JspRTTag.getSetProperties(JspRTTag.java:1063)
at oracle.jsp.parse.JspRTTag.validateTagParse(JspRTTag.java:479)
at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:949)
at oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:633)
at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
at oracle.jsp.parse.JspParseTag.parseBody(JspParseTag.java:814)
at 
oracle.jsp.parse.OpenJspTagHandler.parseBody(OpenJspTagHandler.java:514)
at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:929)
at oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:633)
at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:184)
at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:154)
at 
oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:427)
at 
oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:283)
at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:438)
at 
oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:542)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:304)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
at 
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at 
com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:251)
at 
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
at 
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
at 
org.apache.shale.view.faces.ViewViewHandler.renderView(ViewViewHandler.java:146)
at 
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at 
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at 
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:124)
at 
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at 
org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:278)
at 
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
at 
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at 
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
at 
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at 
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at 
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)


/snip


On 3/1/06, Matthias Wessendorf [EMAIL PROTECTED] wrote:
 The adf-jars also contain their .tld directly under META-INF instead
 of META-INF/tlds

 -Matthias

 On 3/1/06, Matthias Wessendorf [EMAIL PROTECTED] wrote:
  Hi,
 
  I noticed a problem, with OC4J 9.0.4.1.0 and .tld files, which are
  located in a jar under META-INF. MyFaces, Tiles (core / standalone)
  and Shale stores all files there.
 
  Works fine for me in Tomcat 

Re: [OC4J] tld files inside of a jar

2006-03-01 Thread Matthias Wessendorf
Maybe this an a problem with the submitted arg (PageContext), since I
provide my own JSP-20.jar (includes javax/servlet/jsp/PageContext)

and OC4J's JSP-jars (includes also javax/servlet/jsp/PageContext)
-- servlet.jar from j2ee 1.3.x





On 3/1/06, Matthias Wessendorf [EMAIL PROTECTED] wrote:
 After removing the Tiles (standalone) and the Shale-Tiles JARs,
 I got this interesting exception:

 My application includes the jsp-2.0.jar as pointed out here:
 http://tinyurl.com/jcwxh

 Because of, when I haven't it included I got a classDefNotFound for
 JSP EL (ELExcepption)

 I think there is a mismatch between OC4J 9.0.4.1.0' JSP files...
 :-(

 Any ideas, howto patch/fix this ...


 snip
 Exception:

 java.lang.VerifyError: (class: javax/faces/webapp/UIComponentTag,
 method: getParentUIComponentTag signature:
 (Ljavax/servlet/jsp/PageContext;)Ljavax/faces/webapp/UIComponentTag;)
 Incompatible object argument for function call
 at java.lang.Class.getDeclaredMethods0(Native Method)
 at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
 at java.lang.Class.privateGetPublicMethods(Class.java:1778)
 at java.lang.Class.getMethods(Class.java:832)
 at 
 oracle.jsp.parse.JspBeanInfo.determineSetPropertyOverloading(JspBeanInfo.java:394)
 at oracle.jsp.parse.JspBeanInfo.getSetProperty(JspBeanInfo.java:704)
 at 
 oracle.jsp.parse.JspBeanDictionary.getSetPropertyInfo(JspBeanDictionary.java:193)
 at oracle.jsp.parse.JspRTTag.getSetProperties(JspRTTag.java:1063)
 at oracle.jsp.parse.JspRTTag.validateTagParse(JspRTTag.java:479)
 at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:949)
 at 
 oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:633)
 at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
 at oracle.jsp.parse.JspParseTag.parseBody(JspParseTag.java:814)
 at 
 oracle.jsp.parse.OpenJspTagHandler.parseBody(OpenJspTagHandler.java:514)
 at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:929)
 at 
 oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:633)
 at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
 at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:184)
 at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:154)
 at 
 oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:427)
 at 
 oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:283)
 at 
 oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:438)
 at 
 oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:542)
 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:304)
 at 
 oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at 
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
 at 
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
 at 
 com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:251)
 at 
 org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
 at 
 org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
 at 
 org.apache.shale.view.faces.ViewViewHandler.renderView(ViewViewHandler.java:146)
 at 
 org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372)
 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
 at 
 com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
 at 
 org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:124)
 at 
 com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
 at 
 org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:278)
 at 
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
 at 
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
 at 
 com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
 at 
 com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
 at 
 com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
 at 
 com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
 at java.lang.Thread.run(Thread.java:534)


 /snip


 On 3/1/06, Matthias Wessendorf [EMAIL 

Re: [OC4J] tld files inside of a jar

2006-03-01 Thread Dennis Byrne
Hello Mattias,

Any reason why the taglib element is in web.xml ?  If your app is living in a 
2.4 servlet world, the taglib elements are not necessary.  The spec says to 
load all TLDs from both /META-INF/ and /META-INF/tlds .  Hope this helps.

Dennis Byrne

-Original Message-
From: Matthias Wessendorf [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 1, 2006 11:15 AM
To: 'MyFaces Discussion'
Subject: [OC4J] tld files inside of a jar

Hi,

I noticed a problem, with OC4J 9.0.4.1.0 and .tld files, which are
located in a jar under META-INF. MyFaces, Tiles (core / standalone)
and Shale stores all files there.

Works fine for me in Tomcat (standalone and included into JBoss)

However, a co-workers JAR file contains the .tld under
META-INF/tlds/ that works in OC4J fine too. (no jsf components
contained, just *regular* jsp custom actions)

When I try something like this inside my web.xml
  taglib
taglib-urihttp://java.sun.com/jsf/core/taglib-uri
taglib-location/WEB-INF/core.tld/taglib-location
  /taglib


I got the (interesting) stack trace.

Any ideas? (under tomcat/jboss it works out of the box)
-Matthias

snip
Exception:

java.lang.NullPointerException
   at 
 oracle.jsp.parse.JspDirectiveTaglib.validateAttributes(JspDirectiveTaglib.java:183)
   at 
 oracle.jsp.parse.JspParseTagDirective.validateTagAttributes(JspParseTagDirective.java:179)
   at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:921)
   at 
 oracle.jsp.parse.JspParseTagDirective.parse(JspParseTagDirective.java:318)
   at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
   at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:184)
   at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:154)
   at 
 oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:427)
   at 
 oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:283)
   at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:438)
   at 
 oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:542)
   at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:304)
   at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
   at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
   at 
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
   at 
 com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:251)
   at 
 org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
   at 
 org.apache.shale.tiles.TilesViewHandler.dispatchToTile(TilesViewHandler.java:318)
   at 
 org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:159)
   at 
 org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
   at 
 com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
   at 
 org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:124)
   at 
 com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
   at 
 org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:278)
   at 
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
   at 
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
   at 
 com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
   at 
 com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
   at 
 com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
   at 
 com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
   at java.lang.Thread.run(Thread.java:534)


/snip

--
Matthias Wessendorf
Zülpicher Wall 12, 239
50674 Köln
http://www.wessendorf.net
mwessendorf-at-gmail-dot-com





Re: [OC4J] tld files inside of a jar

2006-03-01 Thread Matthias Wessendorf
No, I am J2EE 1.3 boy ...



On 3/1/06, Dennis Byrne [EMAIL PROTECTED] wrote:
 Hello Mattias,

 Any reason why the taglib element is in web.xml ?  If your app is living in 
 a 2.4 servlet world, the taglib elements are not necessary.  The spec says 
 to load all TLDs from both /META-INF/ and /META-INF/tlds .  Hope this helps.

 Dennis Byrne

 -Original Message-
 From: Matthias Wessendorf [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 1, 2006 11:15 AM
 To: 'MyFaces Discussion'
 Subject: [OC4J] tld files inside of a jar
 
 Hi,
 
 I noticed a problem, with OC4J 9.0.4.1.0 and .tld files, which are
 located in a jar under META-INF. MyFaces, Tiles (core / standalone)
 and Shale stores all files there.
 
 Works fine for me in Tomcat (standalone and included into JBoss)
 
 However, a co-workers JAR file contains the .tld under
 META-INF/tlds/ that works in OC4J fine too. (no jsf components
 contained, just *regular* jsp custom actions)
 
 When I try something like this inside my web.xml
   taglib
 taglib-urihttp://java.sun.com/jsf/core/taglib-uri
 taglib-location/WEB-INF/core.tld/taglib-location
   /taglib
 
 
 I got the (interesting) stack trace.
 
 Any ideas? (under tomcat/jboss it works out of the box)
 -Matthias
 
 snip
 Exception:
 
 java.lang.NullPointerException
at 
  oracle.jsp.parse.JspDirectiveTaglib.validateAttributes(JspDirectiveTaglib.java:183)
at 
  oracle.jsp.parse.JspParseTagDirective.validateTagAttributes(JspParseTagDirective.java:179)
at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:921)
at 
  oracle.jsp.parse.JspParseTagDirective.parse(JspParseTagDirective.java:318)
at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:184)
at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:154)
at 
  oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:427)
at 
  oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:283)
at 
  oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:438)
at 
  oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:542)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:304)
at 
  oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
  com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
at 
  com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at 
  com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:251)
at 
  org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
at 
  org.apache.shale.tiles.TilesViewHandler.dispatchToTile(TilesViewHandler.java:318)
at 
  org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:159)
at 
  org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at 
  com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at 
  org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:124)
at 
  com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at 
  org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:278)
at 
  com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
at 
  com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at 
  com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
at 
  com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at 
  com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at 
  com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
 
 
 /snip
 
 --
 Matthias Wessendorf
 Zülpicher Wall 12, 239
 50674 Köln
 http://www.wessendorf.net
 mwessendorf-at-gmail-dot-com
 





--
Matthias Wessendorf
Zülpicher Wall 12, 239
50674 Köln
http://www.wessendorf.net
mwessendorf-at-gmail-dot-com


Re: [OC4J] tld files inside of a jar

2006-03-01 Thread Mike Kienenberger
Have you looked at the various tweaks listed in the container wiki page?

http://wiki.apache.org/myfaces/Installation_and_Configuration

I had some issues with JSP EL -- I was told by Oracle to include two
more jar files (see 10.1.2.0.0 entry)

I'm fairly certain that I'm also registering the listener using the
web.xml file rather than relying on the TLD listener entries.

-Mike


On 3/1/06, Matthias Wessendorf [EMAIL PROTECTED] wrote:
 After removing the Tiles (standalone) and the Shale-Tiles JARs,
 I got this interesting exception:

 My application includes the jsp-2.0.jar as pointed out here:
 http://tinyurl.com/jcwxh

 Because of, when I haven't it included I got a classDefNotFound for
 JSP EL (ELExcepption)

 I think there is a mismatch between OC4J 9.0.4.1.0' JSP files...
 :-(

 Any ideas, howto patch/fix this ...


 snip
 Exception:

 java.lang.VerifyError: (class: javax/faces/webapp/UIComponentTag,
 method: getParentUIComponentTag signature:
 (Ljavax/servlet/jsp/PageContext;)Ljavax/faces/webapp/UIComponentTag;)
 Incompatible object argument for function call
 at java.lang.Class.getDeclaredMethods0(Native Method)
 at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
 at java.lang.Class.privateGetPublicMethods(Class.java:1778)
 at java.lang.Class.getMethods(Class.java:832)
 at 
 oracle.jsp.parse.JspBeanInfo.determineSetPropertyOverloading(JspBeanInfo.java:394)
 at oracle.jsp.parse.JspBeanInfo.getSetProperty(JspBeanInfo.java:704)
 at 
 oracle.jsp.parse.JspBeanDictionary.getSetPropertyInfo(JspBeanDictionary.java:193)
 at oracle.jsp.parse.JspRTTag.getSetProperties(JspRTTag.java:1063)
 at oracle.jsp.parse.JspRTTag.validateTagParse(JspRTTag.java:479)
 at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:949)
 at 
 oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:633)
 at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
 at oracle.jsp.parse.JspParseTag.parseBody(JspParseTag.java:814)
 at 
 oracle.jsp.parse.OpenJspTagHandler.parseBody(OpenJspTagHandler.java:514)
 at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:929)
 at 
 oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:633)
 at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
 at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:184)
 at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:154)
 at 
 oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:427)
 at 
 oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:283)
 at 
 oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:438)
 at 
 oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:542)
 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:304)
 at 
 oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at 
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
 at 
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
 at 
 com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:251)
 at 
 org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
 at 
 org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
 at 
 org.apache.shale.view.faces.ViewViewHandler.renderView(ViewViewHandler.java:146)
 at 
 org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372)
 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
 at 
 com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
 at 
 org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:124)
 at 
 com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
 at 
 org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:278)
 at 
 com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
 at 
 com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
 at 
 com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:793)
 at 
 com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
 at 
 com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
 at 
 

JSF - Spring - OpenSessionInViewFilter

2006-03-01 Thread Sebastien Boutte
Hi Aleksei,

In fact, i've just started to have the OpenSessionInFilterView to work.
But now, i've to face different kind of problems.

I can retrieve data from Hibernate using lazy initialisation ie i load
a collection objects, select one, view it (simple master-details view
city-zipcode relation) all tasks in a myfaces webapp.
but when i update one detail and want to save the master i have
a NonUniqueException that is raised.

I've read in the myfaces wiki that you have to reattach all objects to
the session at the beginning of the request. Is it the solution to my
problem (An instance which is loaded in different sessions) ?
How do you do it programmatically ? Do you have a registry of all
hibernate objects used in your application and reattach automatically
all objects at the beginnng of the request ?

Thanks

Sébastien



Re: Tree2 backward compatibility issue : node selection

2006-03-01 Thread Richard Frazer
Is the TreeWalker interface supposed to be package private?

thanks.


 From: Sean Schofield [EMAIL PROTECTED]
 Reply-To: MyFaces Discussion users@myfaces.apache.org
 Date: Mon, 20 Feb 2006 14:32:58 -0500
 To: MyFaces Discussion users@myfaces.apache.org
 Subject: Re: Tree2 backward compatibility issue : node selection
 
 I made a fix that allows your TreeModel to supply a TreeWalker now.
 Let me know if you are able to get things working the way you need.
 
 Sean
 
 On 2/20/06, Sean Schofield [EMAIL PROTECTED] wrote:
 Yes there was a fairly major change a few days ago.  Its still
 experimental and I realize now there is at least one problem.  There
 is a new interface TreeWalker and a default implementation
 TreeWalkerBase.  The idea behind this is to allow you to provide your
 own id naming scheme for dynamic trees instead of relying on the old
 0, 0:1, 0:1:0 naming scheme.  By default TreeWalkerBase implements the
 old naming scheme.
 
 The idea behind allowing other TreeModels is so the user can better
 support a dynamic tree.  TreeModel needs to implement certain methods
 to assist the renderer since only it knows about this custom scheme.
 The most important method is getNodeById.  It also provides accessor
 methods so that the tree renderer can manipulate the expand/collapse
 and selected states.
 
 The getters and setters for node are not necessary in TreeModel b/c
 the current node is known by the component.  Its set by the renderer
 when appropriate (kind of like the current row in a datatable.)  I
 don't know what you were doing in those methods before but its
 probably not necessary now since the component takes care of this for
 you.
 
 There is one problem though which is now you need to implement a
 TreeWalker.  If you are using the default node naming scheme then
 TreeWalkerBase might be sufficient.  WIth a dynamic model, however,
 this was often a problem and you might want to come up with your own
 custome node naming scheme.
 
 There is a definite bug in the current code though.  There is nowhere
 to plugin your custom TreeWalker!  I will need to address that
 shortly.  Don't worry, this code is not going to be part of the
 upcoming tomahawk release so we have a little time to works the bugs
 out.  I definitely could use the help of the tree2 users though.  I'm
 not currently using a dynamic model so I don't know if what I'm doing
 here helps/hurts you.
 
 Sean
 
 On 2/20/06, rahmoune patrick [EMAIL PROTECTED] wrote:
 Hello,
 
 I've just update my application based on the nightly of the 30/12/2005 to
 the one of downloaded the 17/02.
 
 In this application, I have created my own tree2 model.
 
 Due to the last changes in tree2, two methods are no more present in the
 TreeModel interface :
 - getNode() that returns the selected node
 - and setNodeId(nodeId) that was invoked from an action listener for node
 selection
 
 Can someone point me to the new way of implementing the node selection
 function?
 
 Thank you
 
 patrick
 
 
  
  Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs
 exceptionnels pour appeler la France et l'international. Téléchargez la
 version beta.
 
 
 



Re: JSF - Spring - OpenSessionInViewFilter

2006-03-01 Thread Enrique Medina
The problem must be that you are using request-scoped beans, don't you?If you use request-scoped beans, then you have to merge on every request, using session.merge ;-)There was a discussion about this issue at the beginning of February:
http://marc.theaimsgroup.com/?l=myfaces-userm=113890037426173w=2I would recommend using either session-scoped beans, or a session state container, accesible to all your beans, where the current object being worked is available.
2006/3/1, Sebastien Boutte [EMAIL PROTECTED]:
Hi Aleksei,In fact, i've just started to have the OpenSessionInFilterView to work.But now, i've to face different kind of problems.I can retrieve data from Hibernate using lazy initialisation ie i load
a collection objects, select one, view it (simple master-details viewcity-zipcode relation) all tasks in a myfaces webapp.but when i update one detail and want to save the master i havea NonUniqueException that is raised.
I've read in the myfaces wiki that you have to reattach all objects tothe session at the beginning of the request. Is it the solution to myproblem (An instance which is loaded in different sessions) ?How do you do it programmatically ? Do you have a registry of all
hibernate objects used in your application and reattach automaticallyall objects at the beginnng of the request ?ThanksSébastien


JSF Lifecycle and Design Question

2006-03-01 Thread j2ee Developer
I have JSF lifecycle and design question. I am building a prototype,
porting an existing Struts based application to JSF. The issue I am
facing is I believe related to the JSF lifecycle, I need input from you
folks as to whether what I am doing is the right way. 

Here is the scenario of my application - 

I have a page with a form with values populated from the database. The
end user makes changes to the fields, and presses the commandbutton
save. The values are saved to the database and the same page presented
again with the new saved values.

Here is how I have implemented it -

The constructor of the backing bean makes the call to the model layer (
eventually EJB's), gets the initial data and displays it to the page.
After user makes the changes, on pressing the commandbutton, the event
handler, makes a call to the modellayer for saving the new data. After
the save I populate the backing bean attributes with the new values,
and display the same page again. All my backing beans are request scope
( and that's how I want them). I am using Myfaces implementation, and
myfaces components.

Here is the problem I face -

The issue I am facing is that on calling save, or any other event, the
constructor is called again . So eventually it ends up that there are
double calls to the modellayer/database than what is required.

Is the way I am populating my backing beans wrong? Or is this the only way JSF handles things. Any input would be appreciated.


RE: JSF Lifecycle and Design Question

2006-03-01 Thread CONNER, BRENDAN \(SBCSI\)
Title: Message



I 
would advise against doing any kind of action as part of a managed bean's 
constructor. In my experience, you want to separate out Action methods 
from Managed Bean data. Your action methods should be the only things 
accessing the EJBs, etc. So you should have an action method that gets 
invoked before the screen is displayed. It goes out and gets the data and 
populates the data fields, which then get displayed. Your Save then is 
very simple, since JSF automatically populates your bean values (at least on 
simple screens). Your "save" method then just has to refer to the bean 
values when calling the back end to save the data.

In our 
applications, we make the distinction between Actions and Data very concrete in 
that we have Action managed beans that are separate from Data managed 
beans. This helps keep the developers on the right track, although the 
same thing can be accomplished by having Action methods and data accessors 
within the same bean.

- 
Brendan

-Original Message-From: j2ee 
Developer [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 
12:31 PMTo: users@myfaces.apache.orgSubject: JSF Lifecycle 
and Design Question
I have JSF lifecycle and design 
  question. I am building a prototype, porting an existing Struts based 
  application to JSF. The issue I am facing is I believe related to the JSF 
  lifecycle, I need input from you folks as to whether what I am doing is the 
  right way. Here is the scenario of my application - I have a 
  page with a form with values populated from the database. The end user makes 
  changes to the fields, and presses the commandbutton save. The values are 
  saved to the database and the same page presented again with the new saved 
  values.Here is how I have implemented it -The constructor of 
  the backing bean makes the call to the model layer ( eventually EJB's), gets 
  the initial data and displays it to the page. After user makes the changes, on 
  pressing the commandbutton, the event handler, makes a call to the modellayer 
  for saving the new data. After the save I populate the backing bean attributes 
  with the new values, and display the same page again. All my backing beans are 
  request scope ( and that's how I want them). I am using Myfaces 
  implementation, and myfaces components.Here is the problem I face 
  -The issue I am facing is that on calling save, or any other event, 
  the constructor is called again . So eventually it ends up that there are 
  double calls to the modellayer/database than what is required.Is the 
  way I am populating my backing beans wrong? Or is this the only way JSF 
  handles things. Any input would be appreciated. 


RE: JSF Lifecycle and Design Question

2006-03-01 Thread CONNER, BRENDAN \(SBCSI\)
Title: Message



Also, 
you shouldn't have to worry about populating the bean's values again after the 
save (unless you're changing them or re-querying the database), since the beans 
already have their values. From what I recall (although it's been awhile 
since I've worked with Struts), this is one of the areas in which JSF makes our 
life a lot easier than with Struts.

You 
may want to use t:saveState, though, to make sure your bean values get 
passed from one request to another.

- 
Brendan
-Original Message-From: CONNER, 
BRENDAN (SBCSI) Sent: Wednesday, March 01, 2006 12:59 
PMTo: MyFaces DiscussionSubject: RE: JSF Lifecycle and 
Design Question

  I 
  would advise against doing any kind of action as part of a managed bean's 
  constructor. In my experience, you want to separate out Action methods 
  from Managed Bean data. Your action methods should be the only things 
  accessing the EJBs, etc. So you should have an action method that gets 
  invoked before the screen is displayed. It goes out and gets the data 
  and populates the data fields, which then get displayed. Your Save then 
  is very simple, since JSF automatically populates your bean values (at least 
  on simple screens). Your "save" method then just has to refer to the 
  bean values when calling the back end to save the data.
  
  In 
  our applications, we make the distinction between Actions and Data very 
  concrete in that we have Action managed beans that are separate from Data 
  managed beans. This helps keep the developers on the right track, 
  although the same thing can be accomplished by having Action methods and data 
  accessors within the same bean.
  
  - 
  Brendan
  
  -Original Message-From: j2ee 
  Developer [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 01, 
  2006 12:31 PMTo: users@myfaces.apache.orgSubject: JSF 
  Lifecycle and Design Question
  I have JSF lifecycle and design 
question. I am building a prototype, porting an existing Struts based 
application to JSF. The issue I am facing is I believe related to the JSF 
lifecycle, I need input from you folks as to whether what I am doing is the 
right way. Here is the scenario of my application - I have a 
page with a form with values populated from the database. The end user makes 
changes to the fields, and presses the commandbutton save. The values are 
saved to the database and the same page presented again with the new saved 
values.Here is how I have implemented it -The constructor of 
the backing bean makes the call to the model layer ( eventually EJB's), gets 
the initial data and displays it to the page. After user makes the changes, 
on pressing the commandbutton, the event handler, makes a call to the 
modellayer for saving the new data. After the save I populate the backing 
bean attributes with the new values, and display the same page again. All my 
backing beans are request scope ( and that's how I want them). I am using 
Myfaces implementation, and myfaces components.Here is the problem I 
face -The issue I am facing is that on calling save, or any other 
event, the constructor is called again . So eventually it ends up that there 
are double calls to the modellayer/database than what is required.Is 
the way I am populating my backing beans wrong? Or is this the only way JSF 
handles things. Any input would be appreciated. 



Re: MyFaces dataTable column sorting

2006-03-01 Thread Greg
getAscending is a method that is supposedly used in conjunction with
the sortAscending dataTable attribute (as a binding value). However
even if this method does exist in the managed bean this method is
never called. None of the myfaces examples implement a getAscending
method, even though in the jsp pages this value-binding has been
specified.

At present, in the Dao etc, the boolean method 'isAscending' can be
used since it exists in the sample abstract SortableList class.

The problem I'm having at the moment is that I've implemented the
working with large tables example (dataScroller), but trying to
combine this with the sort running me around in circles (i'm figuring
things out as I go along etc) ... etc, state_saving_method, managed
bean scope (request|session), preserveDataModel, preserveSort In
respect to those values, I've followed pagedSortTable.jsf so the only
difference being that I'm using the DataModel (large tables)
implementation, yet the sort does not work immediately.

Right now I'm totally confused, given one combination of the above
mentioned params, clicking a sort column will rebuild and display the
datamodel immediately, another permutation will send the request but
it wont be untill the next request that this change will be reflected
and persist (ascross paginations) another permutation will not
reflect the changes untill the second page request but will then
subsequently lose the chosen sort value.

One problem I saw at point (when feeling closest to a solution), is
that when the page first loads _sortAscending = true, however clicking
the sort column, resends the 'true' in the request (or something) thus
no changes are reflected (since it originally was true)...

If someone who understands how things work (and maybe is/wether
immediate=true|false) is need and can put some perspective on this,
then I think it would be greatly appreciated and should be pinned
(documented etc).

G.


Re: JSF Lifecycle and Design Question

2006-03-01 Thread j2ee Developer
Thanks Brendan! Sounds interesting! Can you please explain a
little bit more on how are you seperating data beans from action beans.
This is how I have implemented my backing beans. All data is in a
formbean(struts style formbean), this formbean is a member attribute of
my actual backing bean. The actual backing bean just has the action
methods like save, clear, delete etc.
Also if I do not call the action methods in the constructor, where do I
call the action method before the screen gets displayed? On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote:







Also, 
you shouldn't have to worry about populating the bean's values again after the 
save (unless you're changing them or re-querying the database), since the beans 
already have their values. From what I recall (although it's been awhile 
since I've worked with Struts), this is one of the areas in which JSF makes our 
life a lot easier than with Struts.

You 
may want to use t:saveState, though, to make sure your bean values get 
passed from one request to another.

- 
Brendan
-Original Message-From: CONNER, 
BRENDAN (SBCSI) Sent: Wednesday, March 01, 2006 12:59 
PMTo: MyFaces DiscussionSubject: RE: JSF Lifecycle and 
Design Question

  I 
  would advise against doing any kind of action as part of a managed bean's 
  constructor. In my experience, you want to separate out Action methods 
  from Managed Bean data. Your action methods should be the only things 
  accessing the EJBs, etc. So you should have an action method that gets 
  invoked before the screen is displayed. It goes out and gets the data 
  and populates the data fields, which then get displayed. Your Save then 
  is very simple, since JSF automatically populates your bean values (at least 
  on simple screens). Your save method then just has to refer to the 
  bean values when calling the back end to save the data.
  
  In 
  our applications, we make the distinction between Actions and Data very 
  concrete in that we have Action managed beans that are separate from Data 
  managed beans. This helps keep the developers on the right track, 
  although the same thing can be accomplished by having Action methods and data 
  accessors within the same bean.
  
  - 
  Brendan
  
  -Original Message-From: j2ee 
  Developer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 01, 
  2006 12:31 PMTo: users@myfaces.apache.orgSubject: JSF 
  Lifecycle and Design Question
  I have JSF lifecycle and design 
question. I am building a prototype, porting an existing Struts based 
application to JSF. The issue I am facing is I believe related to the JSF 
lifecycle, I need input from you folks as to whether what I am doing is the 
right way. Here is the scenario of my application - I have a 
page with a form with values populated from the database. The end user makes 
changes to the fields, and presses the commandbutton save. The values are 
saved to the database and the same page presented again with the new saved 
values.Here is how I have implemented it -The constructor of 
the backing bean makes the call to the model layer ( eventually EJB's), gets 
the initial data and displays it to the page. After user makes the changes, 
on pressing the commandbutton, the event handler, makes a call to the 
modellayer for saving the new data. After the save I populate the backing 
bean attributes with the new values, and display the same page again. All my 
backing beans are request scope ( and that's how I want them). I am using 
Myfaces implementation, and myfaces components.Here is the problem I 
face -The issue I am facing is that on calling save, or any other 
event, the constructor is called again . So eventually it ends up that there 
are double calls to the modellayer/database than what is required.Is 
the way I am populating my backing beans wrong? Or is this the only way JSF 
handles things. Any input would be appreciated. 





RE: JSF Lifecycle and Design Question

2006-03-01 Thread Marti, Adrian \(Adrian\)








For initializing data or pre-populating
fields you may want to look into Shales abstractviewcontroller and the
added lifecycle methods it gives your JSF backing beans.



-adrian











From: j2ee Developer
[mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 01, 2006
2:50 PM
To: MyFaces
 Discussion
Subject: Re: JSF Lifecycle and
Design Question





Thanks Brendan!
Sounds interesting! Can you please explain a little bit more on how are you
seperating data beans from action beans. This is how I have implemented my
backing beans. All data is in a formbean(struts style formbean), this formbean
is a member attribute of my actual backing bean. The actual backing bean just
has the action methods like save, clear, delete etc.
Also if I do not call the action methods in the constructor, where do I call
the action method before the screen gets displayed? 



On 3/1/06, CONNER,
BRENDAN (SBCSI) [EMAIL PROTECTED]
wrote: 





Also, you shouldn't have to worry about
populating the bean's values again after the save (unless you're changing them
or re-querying the database), since the beans already have their values.
>From what I recall (although it's been awhile since I've worked with Struts),
this is one of the areas in which JSF makes our life a lot easier than with
Struts.











You may want to use t:saveState,
though, to make sure your bean values get passed from one request to another.















- Brendan









-Original Message-
From: CONNER, BRENDAN (SBCSI) 
Sent: Wednesday, March 01, 2006
12:59 PM
To: MyFaces
 Discussion
Subject: RE: JSF Lifecycle and
Design Question







I would advise against doing any kind of
action as part of a managed bean's constructor. In my experience, you
want to separate out Action methods from Managed Bean data. Your action
methods should be the only things accessing the EJBs, etc. So you should
have an action method that gets invoked before the screen is displayed.
It goes out and gets the data and populates the data fields, which then get
displayed. Your Save then is very simple, since JSF automatically
populates your bean values (at least on simple screens). Your
save method then just has to refer to the bean values when calling
the back end to save the data.











In our applications, we make the
distinction between Actions and Data very concrete in that we have Action
managed beans that are separate from Data managed beans. This helps keep
the developers on the right track, although the same thing can be accomplished
by having Action methods and data accessors within the same bean.











- Brendan











-Original Message-
From: j2ee Developer [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 01, 2006
12:31 PM
To: users@myfaces.apache.org
Subject: JSF Lifecycle and Design
Question





I have JSF lifecycle and design question. I am building a prototype,
porting an existing Struts based application to JSF. The issue I am facing is I
believe related to the JSF lifecycle, I need input from you folks as to whether
what I am doing is the right way. 

Here is the scenario of my application - 

I have a page with a form with values populated from the database. The end user
makes changes to the fields, and presses the commandbutton save. The values are
saved to the database and the same page presented again with the new saved
values.

Here is how I have implemented it -

The constructor of the backing bean makes the call to the model layer (
eventually EJB's), gets the initial data and displays it to the page. After
user makes the changes, on pressing the commandbutton, the event handler, makes
a call to the modellayer for saving the new data. After the save I populate the
backing bean attributes with the new values, and display the same page again.
All my backing beans are request scope ( and that's how I want them). I am
using Myfaces implementation, and myfaces components.

Here is the problem I face -

The issue I am facing is that on calling save, or any other event, the
constructor is called again . So eventually it ends up that there are double
calls to the modellayer/database than what is required.

Is the way I am populating my backing beans wrong? Or is this the only way JSF
handles things. Any input would be appreciated. 




















Re: [OC4J] tld files inside of a jar

2006-03-01 Thread Matthias Wessendorf
Ah, I saw, but haven't tried, because of we have to use 9.0.4.1.0

I'll give it a try when I am in office tomorrow

-Matthias

On 3/1/06, Mike Kienenberger [EMAIL PROTECTED] wrote:
 Have you looked at the various tweaks listed in the container wiki page?

 http://wiki.apache.org/myfaces/Installation_and_Configuration

 I had some issues with JSP EL -- I was told by Oracle to include two
 more jar files (see 10.1.2.0.0 entry)

 I'm fairly certain that I'm also registering the listener using the
 web.xml file rather than relying on the TLD listener entries.

 -Mike


 On 3/1/06, Matthias Wessendorf [EMAIL PROTECTED] wrote:
  After removing the Tiles (standalone) and the Shale-Tiles JARs,
  I got this interesting exception:
 
  My application includes the jsp-2.0.jar as pointed out here:
  http://tinyurl.com/jcwxh
 
  Because of, when I haven't it included I got a classDefNotFound for
  JSP EL (ELExcepption)
 
  I think there is a mismatch between OC4J 9.0.4.1.0' JSP files...
  :-(
 
  Any ideas, howto patch/fix this ...
 
 
  snip
  Exception:
 
  java.lang.VerifyError: (class: javax/faces/webapp/UIComponentTag,
  method: getParentUIComponentTag signature:
  (Ljavax/servlet/jsp/PageContext;)Ljavax/faces/webapp/UIComponentTag;)
  Incompatible object argument for function call
  at java.lang.Class.getDeclaredMethods0(Native Method)
  at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
  at java.lang.Class.privateGetPublicMethods(Class.java:1778)
  at java.lang.Class.getMethods(Class.java:832)
  at 
  oracle.jsp.parse.JspBeanInfo.determineSetPropertyOverloading(JspBeanInfo.java:394)
  at oracle.jsp.parse.JspBeanInfo.getSetProperty(JspBeanInfo.java:704)
  at 
  oracle.jsp.parse.JspBeanDictionary.getSetPropertyInfo(JspBeanDictionary.java:193)
  at oracle.jsp.parse.JspRTTag.getSetProperties(JspRTTag.java:1063)
  at oracle.jsp.parse.JspRTTag.validateTagParse(JspRTTag.java:479)
  at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:949)
  at 
  oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:633)
  at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
  at oracle.jsp.parse.JspParseTag.parseBody(JspParseTag.java:814)
  at 
  oracle.jsp.parse.OpenJspTagHandler.parseBody(OpenJspTagHandler.java:514)
  at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:929)
  at 
  oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:633)
  at oracle.jsp.parse.JspParseTag.parseNextTag(JspParseTag.java:705)
  at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:184)
  at 
  oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:154)
  at 
  oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:427)
  at 
  oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:283)
  at 
  oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:438)
  at 
  oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:542)
  at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:304)
  at 
  oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
  at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at 
  com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
  at 
  com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
  at 
  com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:251)
  at 
  org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
  at 
  org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
  at 
  org.apache.shale.view.faces.ViewViewHandler.renderView(ViewViewHandler.java:146)
  at 
  org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
  at 
  com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
  at 
  org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:124)
  at 
  com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
  at 
  org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:278)
  at 
  com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
  at 
  com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
  at 
  

Re: JSF Lifecycle and Design Question

2006-03-01 Thread Mike Kienenberger
On 3/1/06, Marti, Adrian (Adrian) [EMAIL PROTECTED] wrote:
 For initializing data or pre-populating fields you may want to look into
 Shale's abstractviewcontroller and the added lifecycle methods it gives your
 JSF backing beans.

That will work for one bean per page.
You can use the jsf-spring integration and the InitializingBean
interface if you need more flexibility.


AjaxAnywhere and DataScroller

2006-03-01 Thread Emmanuel Jay

Hi,

I am having problems ajax-ifying the MyFaces dataScroller with AA. I basically get a JSerror of the type:'document.forms.mainForm.elements.mainForm:ds_9898989' is null or not an object. where ds_9898989 is the id of the dataScroller (links). 


Using AA the links don't seems to be rendered if the scroller is not rendered and then rendered at a later time...

Has anybody encountered such a problem?

Thanks for your help,


Emmanuel


RE: JSF Lifecycle and Design Question

2006-03-01 Thread CONNER, BRENDAN \(SBCSI\)
Title: Message



What 
we do is something like the following:

public 
class MyDataBean implements Serializable {
 private String field1;
 private Date field2;
 // define getters and setters
}

public 
class MyActionBean implements Serializable {
 public MyDataBean myDataBean;
 // define getter and setter for 
myDataBean
 public String loadData() {
 
...
 
return outcome;
 }

 public Stirng saveData() {
 
...
 
return outcome;
 }
 ...
}

And 
then define the following relationship in faces-config.xml:

managed-beanmanaged-bean-namemyDataBean/managed-bean-namemanaged-bean-classcom.example.MyDataBean/managed-bean-classmanaged-bean-scoperequest/managed-bean-scope/managed-beanmanaged-beanmanaged-bean-namemyActionBean/managed-bean-namemanaged-bean-classcom.example.MyActionBean/managed-bean-classmanaged-bean-scoperequest/managed-bean-scopemanaged-propertyproperty-namemydataBean/property-namevalue#{myDataBean}/value/managed-property/managed-bean
 
Then 
in the screen that leads up to the screen that displays the initial value of the 
bean, your commandButton or commandLink would invoke 
#{myActionBean.loadData}. The "save" commandButton would invoke 
#{myActionBean.saveData}, whose "success" would just lead to redisplaying the 
page.

MyActionBean.loadData() would call the EJB layer to fetch the data and 
populate the fields within the object returned by getMyDataBean(). (JSF 
makes sure that this object is already instantiated.)

MyActionBean.saveData() would call the EJB layer to update the database 
with the contents of the object returned by getMyDataBean(). (JSF 
populates this bean with the contents of the request.) After this method 
return, JSF automatically populates the HTML fields with the values of this 
bean.

- 
Brendan
-Original Message-From: j2ee 
Developer [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 
1:50 PMTo: MyFaces DiscussionSubject: Re: JSF Lifecycle 
and Design Question
Thanks Brendan! Sounds 
  interesting! Can you please explain a little bit more on how are you 
  seperating data beans from action beans. This is how I have implemented my 
  backing beans. All data is in a formbean(struts style formbean), this formbean 
  is a member attribute of my actual backing bean. The actual backing bean just 
  has the action methods like save, clear, delete etc.Also if I do not call 
  the action methods in the constructor, where do I call the action method 
  before the screen gets displayed? 
  On 3/1/06, CONNER, 
  BRENDAN (SBCSI) [EMAIL PROTECTED] 
  wrote: 
  

Also, you shouldn't have to 
worry about populating the bean's values again after the save (unless you're 
changing them or re-querying the database), since the beans already have 
their values. From what I recall (although it's been awhile since I've 
worked with Struts), this is one of the areas in which JSF makes our life a 
lot easier than with Struts.

You may want to use 
t:saveState, though, to make sure your bean values get passed from 
one request to another.


- 
Brendan

-Original Message-From: 
CONNER, BRENDAN (SBCSI) Sent: Wednesday, March 01, 2006 12:59 
PMTo: MyFaces DiscussionSubject: RE: JSF Lifecycle and 
Design Question

  I would advise against 
  doing any kind of action as part of a managed bean's constructor. In 
  my experience, you want to separate out Action methods from Managed Bean 
  data. Your action methods should be the only things accessing the 
  EJBs, etc. So you should have an action method that gets invoked 
  before the screen is displayed. It goes out and gets the data and 
  populates the data fields, which then get displayed. Your Save then 
  is very simple, since JSF automatically populates your bean values (at 
  least on simple screens). Your "save" method then just has to refer 
  to the bean values when calling the back end to save the 
  data.
  
  In our applications, we 
  make the distinction between Actions and Data very concrete in that we 
  have Action managed beans that are separate from Data managed beans. 
  This helps keep the developers on the right track, although the same thing 
  can be accomplished by having Action methods and data accessors within the 
  same bean.
  
  - 
  Brendan
  
  -Original Message-From: 
  j2ee Developer [mailto:[EMAIL PROTECTED]] 
  Sent: Wednesday, March 01, 2006 12:31 PMTo: users@myfaces.apache.orgSubject: JSF 
  Lifecycle and Design Question
  I have JSF lifecycle and design 
question. I am building a prototype, porting an existing Struts based 
application to JSF. The issue I am facing is I believe related to the 
JSF lifecycle, I need input from you folks as to whether what I am doing 
is the right way. Here is the scenario of my application - 
I have a page with a form with 

RE: JSF Lifecycle and Design Question

2006-03-01 Thread CONNER, BRENDAN \(SBCSI\)
Title: Message



Oh, 
and don't forget to put the following tag in your JSP that displays the contents 
of your data bean:

t:saveState value="#{myDataBean}"/

- 
Brendan

-Original Message-From: CONNER, 
BRENDAN (SBCSI) Sent: Wednesday, March 01, 2006 2:18 PMTo: 
MyFaces DiscussionSubject: RE: JSF Lifecycle and Design 
Question

  What 
  we do is something like the following:
  
  public class MyDataBean implements Serializable {
   private String field1;
   private Date field2;
   // define getters and setters
  }
  
  public class MyActionBean implements Serializable {
   public MyDataBean myDataBean;
   // define getter and setter for 
  myDataBean
   public String loadData() {
   
  ...
   
  return outcome;
   }
  
   public Stirng saveData() {
   
  ...
   
  return outcome;
   }
   ...
  }
  
  And 
  then define the following relationship in 
faces-config.xml:
  
  managed-beanmanaged-bean-namemyDataBean/managed-bean-namemanaged-bean-classcom.example.MyDataBean/managed-bean-classmanaged-bean-scoperequest/managed-bean-scope/managed-beanmanaged-beanmanaged-bean-namemyActionBean/managed-bean-namemanaged-bean-classcom.example.MyActionBean/managed-bean-classmanaged-bean-scoperequest/managed-bean-scopemanaged-propertyproperty-namemydataBean/property-namevalue#{myDataBean}/value/managed-property/managed-bean
   
  Then 
  in the screen that leads up to the screen that displays the initial value of 
  the bean, your commandButton or commandLink would invoke 
  #{myActionBean.loadData}. The "save" commandButton would invoke 
  #{myActionBean.saveData}, whose "success" would just lead to redisplaying the 
  page.
  
  MyActionBean.loadData() would call the EJB layer to fetch the data and 
  populate the fields within the object returned by getMyDataBean(). (JSF 
  makes sure that this object is already instantiated.)
  
  MyActionBean.saveData() would call the EJB layer to update the database 
  with the contents of the object returned by getMyDataBean(). (JSF 
  populates this bean with the contents of the request.) After this method 
  return, JSF automatically populates the HTML fields with the values of this 
  bean.
  
  - 
  Brendan
  -Original Message-From: j2ee 
  Developer [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 01, 
  2006 1:50 PMTo: MyFaces DiscussionSubject: Re: JSF 
  Lifecycle and Design Question
  Thanks Brendan! Sounds 
interesting! Can you please explain a little bit more on how are you 
seperating data beans from action beans. This is how I have implemented my 
backing beans. All data is in a formbean(struts style formbean), this 
formbean is a member attribute of my actual backing bean. The actual backing 
bean just has the action methods like save, clear, delete etc.Also if I 
do not call the action methods in the constructor, where do I call the 
action method before the screen gets displayed? 
On 3/1/06, CONNER, 
BRENDAN (SBCSI) [EMAIL PROTECTED] wrote: 

  
  Also, you shouldn't have 
  to worry about populating the bean's values again after the save (unless 
  you're changing them or re-querying the database), since the beans already 
  have their values. From what I recall (although it's been awhile 
  since I've worked with Struts), this is one of the areas in which JSF 
  makes our life a lot easier than with Struts.
  
  You may want to use 
  t:saveState, though, to make sure your bean values get passed from 
  one request to another.
  
  
  - 
  Brendan
  
  -Original Message-From: 
  CONNER, BRENDAN (SBCSI) Sent: Wednesday, March 01, 2006 12:59 
  PMTo: MyFaces DiscussionSubject: RE: JSF Lifecycle 
  and Design Question
  
I would advise against 
doing any kind of action as part of a managed bean's constructor. 
In my experience, you want to separate out Action methods from Managed 
Bean data. Your action methods should be the only things accessing 
the EJBs, etc. So you should have an action method that gets 
invoked before the screen is displayed. It goes out and gets the 
data and populates the data fields, which then get displayed. Your 
Save then is very simple, since JSF automatically populates your bean 
values (at least on simple screens). Your "save" method then just 
has to refer to the bean values when calling the back end to save the 
data.

In our applications, we 
make the distinction between Actions and Data very concrete in that we 
have Action managed beans that are separate from Data managed 
beans. This helps keep the developers on the right track, although 
the same thing can be accomplished by having Action methods and data 
accessors within the same bean.

- 
Brendan

-Original Message-From: 
j2ee 

AjaxAnywhere, state management and multiple forms

2006-03-01 Thread Andrew Robinson
I'm trying to get a wizard functionality going  with AA. My parent
page has a panel that is in a default state. A button in this panel
should cause a navigation to occur to the next page.

The main page does have buttons that should continue to work.

So I have next, back, finish and cancel buttons in my wizard (inside
the AA zone).

Problem 1: on the 2nd wizard page, the form is submitting still back
to page one instead of back to page 2 since the form is outside of the
AA zone and not in it.

I would rather not submit back to the parent form each time as it
renders a datatable outside of the AA zone and other such controls
that are expensive to created. I also would like to use the navigation
rules from the faces-config.xml to handle the wizard buttons.

Problem 2: w/ server-side JSF state and multiple files, my buttons
outside of AA stop working correctly because the view state is invalid
(I'd rather not use client state if I can help it)

I know about Shale and JBoss-Seam to manage dialog state (which
basically this is), but for my day job, we are not using either at the
moment.

Has anyone come up with a work around for this?


JSF - Spring - OpenSessionInViewFilter

2006-03-01 Thread Sebastien Boutte
Hi Aleksei,

In fact, i've just started to have the OpenSessionInFilterView to work.
But now, i've to face different kind of problems.

I can retrieve data from Hibernate using lazy initialisation ie i load
a collection objects, select one, view it (simple master-details view
city-zipcode relation) all tasks in a myfaces webapp.
but when i update one detail and want to save the master i have
a NonUniqueException that is raised.

I've read in the myfaces wiki that you have to reattach all objects to
the session at the beginning of the request. Is it the solution to my
problem (An instance which is loaded in different sessions) ?
How do you do it programmatically ? Do you have a registry of all
hibernate objects used in your application and reattach automatically
all objects at the beginnng of the request ?

Thanks

Sébastien

Hi.

 I'm trying to get Spring's OpenSessionInFilterView to work but i'm not 
 very lucky.

We've got OSIV working in our JSF/MyFaces/Facelets/Spring app.

 I do :
 
 1. Put in my web.xml :

[skip]

Looks fine.

 2. My Application Context :

[...] looks fine.

 3. I Have a static class use to retrieve the hibernate's session but 
 it's not in the application context :
 
 I 've tried various methods :
 
 ApplicationContext ctx = 
 FacesContextUtils.getWebApplicationContext(FacesContext.getCurrentInstance());
 sessionFactory = (SessionFactory) ctx.getBean(sessionFactory);
 return sessionFactory.getCurrentSession();
 
 return SessionFactoryUtils.getSession(getSessionFactory(),true);
 
 But nothing is working ...

I'd suggest using Hibernate through Spring's HibernateDaoSupport, not 
accessing session factory/sessions directly.

Your setup looks fine. What exactly isn't working? Have you tried 
downtracing? Is the session set in a thread-local var in your filter? Do 
session factory/utils access this var?

Bye.
/lexi



Re: JSF Lifecycle and Design Question

2006-03-01 Thread j2ee Developer
Appreciate your response. That is very close to the way we have
implemented it here. The only distinction being that the first time
page load, in our scenario does not come from an action event (
commandbutton or commandlink). It is the first request. So I am
confused as to where do I call the load(), other than the constructor.
I understand that probably Shale or Spring can provide us this
flexibility, but we are not evaluating them right now. Does anyone has
any idea how I could implement this.
On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote:







Oh, 
and don't forget to put the following tag in your JSP that displays the contents 
of your data bean:

t:saveState value=#{myDataBean}/

- 
Brendan

-Original Message-From: CONNER, 
BRENDAN (SBCSI) Sent: Wednesday, March 01, 2006 2:18 PMTo: 
MyFaces DiscussionSubject: RE: JSF Lifecycle and Design 
Question

  What 
  we do is something like the following:
  
  public class MyDataBean implements Serializable {
   private String field1;
   private Date field2;
   // define getters and setters
  }
  
  public class MyActionBean implements Serializable {
   public MyDataBean myDataBean;
   // define getter and setter for 
  myDataBean
   public String loadData() {
   
  ...
   
  return outcome;
   }
  
   public Stirng saveData() {
   
  ...
   
  return outcome;
   }
   ...
  }
  
  And 
  then define the following relationship in 
faces-config.xml:
  
  managed-beanmanaged-bean-namemyDataBean/managed-bean-namemanaged-bean-classcom.example.MyDataBean/managed-bean-class
managed-bean-scoperequest/managed-bean-scope/managed-beanmanaged-beanmanaged-bean-namemyActionBean/managed-bean-namemanaged-bean-class
com.example.MyActionBean/managed-bean-classmanaged-bean-scoperequest/managed-bean-scopemanaged-propertyproperty-namemydataBean/property-namevalue#{myDataBean}/value
/managed-property/managed-bean
   
  Then 
  in the screen that leads up to the screen that displays the initial value of 
  the bean, your commandButton or commandLink would invoke 
  #{myActionBean.loadData}. The save commandButton would invoke 
  #{myActionBean.saveData}, whose success would just lead to redisplaying the 
  page.
  
  MyActionBean.loadData() would call the EJB layer to fetch the data and 
  populate the fields within the object returned by getMyDataBean(). (JSF 
  makes sure that this object is already instantiated.)
  
  MyActionBean.saveData() would call the EJB layer to update the database 
  with the contents of the object returned by getMyDataBean(). (JSF 
  populates this bean with the contents of the request.) After this method 
  return, JSF automatically populates the HTML fields with the values of this 
  bean.
  
  - 
  Brendan
  -Original Message-From: j2ee 
  Developer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 01, 
  2006 1:50 PMTo: MyFaces DiscussionSubject: Re: JSF 
  Lifecycle and Design Question
  Thanks Brendan! Sounds 
interesting! Can you please explain a little bit more on how are you 
seperating data beans from action beans. This is how I have implemented my 
backing beans. All data is in a formbean(struts style formbean), this 
formbean is a member attribute of my actual backing bean. The actual backing 
bean just has the action methods like save, clear, delete etc.Also if I 
do not call the action methods in the constructor, where do I call the 
action method before the screen gets displayed? 
On 3/1/06, CONNER, 
BRENDAN (SBCSI) [EMAIL PROTECTED] wrote: 

  
  Also, you shouldn't have 
  to worry about populating the bean's values again after the save (unless 
  you're changing them or re-querying the database), since the beans already 
  have their values. From what I recall (although it's been awhile 
  since I've worked with Struts), this is one of the areas in which JSF 
  makes our life a lot easier than with Struts.
  
  You may want to use 
  t:saveState, though, to make sure your bean values get passed from 
  one request to another.
  
  
  - 
  Brendan
  
  -Original Message-From: 
  CONNER, BRENDAN (SBCSI) Sent: Wednesday, March 01, 2006 12:59 
  PMTo: MyFaces DiscussionSubject: RE: JSF Lifecycle 
  and Design Question
  
I would advise against 
doing any kind of action as part of a managed bean's constructor. 
In my experience, you want to separate out Action methods from Managed 
Bean data. Your action methods should be the only things accessing 
the EJBs, etc. So you should have an action method that gets 
invoked before the screen is displayed. It goes out and gets the 
data and populates the data fields, which then get displayed. Your 
Save then is very simple, since JSF automatically populates your bean 
values (at least on simple screens). Your save method then just 
has to refer to the bean 

RE: JSF Lifecycle and Design Question

2006-03-01 Thread CONNER, BRENDAN \(SBCSI\)
Title: Message



So 
this is, in effect on your index page? No login page or 
anything?

- 
Brendan


  
  -Original Message-From: j2ee Developer 
  [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 3:44 
  PMTo: MyFaces DiscussionSubject: Re: JSF Lifecycle and 
  Design QuestionAppreciate your response. That is very 
  close to the way we have implemented it here. The only distinction being that 
  the first time page load, in our scenario does not come from an action event ( 
  commandbutton or commandlink). It is the first request. So I am confused as to 
  where do I call the load(), other than the constructor.I understand 
  that probably Shale or Spring can provide us this flexibility, but we are not 
  evaluating them right now. Does anyone has any idea how I could implement 
  this.
  On 3/1/06, CONNER, 
  BRENDAN (SBCSI) [EMAIL PROTECTED] 
  wrote:
  

Oh, and don't forget to put 
the following tag in your JSP that displays the contents of your data 
bean:

t:saveState 
value="#{myDataBean}"/


- 
Brendan



-Original Message-From: CONNER, BRENDAN (SBCSI) 

Sent: Wednesday, March 01, 2006 2:18 
PMTo: MyFaces DiscussionSubject: RE: JSF Lifecycle and 
Design Question



  What we do is something 
  like the following:
  
  public class MyDataBean 
  implements Serializable {
   private String field1;
   private Date field2;
   // 
  define getters and setters
  }
  
  public class MyActionBean 
  implements Serializable {
   public MyDataBean myDataBean;
   // 
  define getter and setter for myDataBean
   public 
  String loadData() {
   ...
   return outcome;
   }
  
   public 
  Stirng saveData() {
   ...
   return outcome;
   }
   ...
  }
  
  And then define the 
  following relationship in faces-config.xml:
  
  managed-beanmanaged-bean-namemyDataBean/managed-bean-namemanaged-bean-classcom.example.MyDataBean/managed-bean-class 
  managed-bean-scoperequest/managed-bean-scope/managed-beanmanaged-beanmanaged-bean-namemyActionBean/managed-bean-namemanaged-bean-class 
  com.example.MyActionBean/managed-bean-classmanaged-bean-scoperequest/managed-bean-scopemanaged-propertyproperty-namemydataBean/property-namevalue#{myDataBean}/value 
  /managed-property/managed-bean
   
  Then in the screen that 
  leads up to the screen that displays the initial value of the bean, your 
  commandButton or commandLink would invoke #{myActionBean.loadData}. 
  The "save" commandButton would invoke #{myActionBean.saveData}, whose 
  "success" would just lead to redisplaying the page.
  
  MyActionBean.loadData() 
  would call the EJB layer to fetch the data and populate the fields within 
  the object returned by getMyDataBean(). (JSF makes sure that this 
  object is already instantiated.)
  
  MyActionBean.saveData() 
  would call the EJB layer to update the database with the contents of the 
  object returned by getMyDataBean(). (JSF populates this bean with 
  the contents of the request.) After this method return, JSF 
  automatically populates the HTML fields with the values of this 
  bean.
  
  - 
  Brendan
  -Original Message-From: 
  j2ee Developer [mailto:[EMAIL PROTECTED]] 
  Sent: Wednesday, March 01, 2006 1:50 PMTo: MyFaces 
  DiscussionSubject: Re: JSF Lifecycle and Design 
  Question
  Thanks Brendan! Sounds 
interesting! Can you please explain a little bit more on how are you 
seperating data beans from action beans. This is how I have implemented 
my backing beans. All data is in a formbean(struts style formbean), this 
formbean is a member attribute of my actual backing bean. The actual 
backing bean just has the action methods like save, clear, delete 
etc.Also if I do not call the action methods in the constructor, 
where do I call the action method before the screen gets displayed? 

On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote: 


  
  Also, you shouldn't 
  have to worry about populating the bean's values again after the save 
  (unless you're changing them or re-querying the database), since the 
  beans already have their values. From what I recall (although 
  it's been awhile since I've worked with Struts), this is one of the 
  areas in which JSF makes our life a lot easier than with 
  Struts.
  
  You may want to use 
  t:saveState, though, to make sure your bean values get passed 
  from one request to another.
  
  
  - 
  Brendan
  
  -Original 
  

Re: JSF Lifecycle and Design Question

2006-03-01 Thread Mike Kienenberger
Oops, forgot the easiest.  One other simple initializing trick to to
create an initialized property on your bean and have it listed as
the last property.

http://mail-archives.apache.org/mod_mbox/myfaces-users/200510.mbox/[EMAIL 
PROTECTED]

On 3/1/06, j2ee Developer [EMAIL PROTECTED] wrote:
 Appreciate your response. That is very close to the way we have implemented
 it here. The only distinction being that the first time page load, in our
 scenario does not come from an action event ( commandbutton or commandlink).
 It is the first request. So I am confused as to where do I call the load(),
 other than the constructor.
   I understand that probably Shale or Spring can provide us this
 flexibility, but we are not evaluating them right now. Does anyone has any
 idea how I could implement this.



 On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote:
 
 
  Oh, and don't forget to put the following tag in your JSP that displays
 the contents of your data bean:
 
  t:saveState value=#{myDataBean}/
 
 
  - Brendan
 
 
 
  -Original Message-
  From: CONNER, BRENDAN (SBCSI)
 
  Sent: Wednesday, March 01, 2006 2:18 PM
  To: MyFaces Discussion
  Subject: RE: JSF Lifecycle and Design Question
 
 
 
 
 
  What we do is something like the following:
 
  public class MyDataBean implements Serializable {
  private String field1;
  private Date field2;
  // define getters and setters
  }
 
  public class MyActionBean implements Serializable {
  public MyDataBean myDataBean;
  // define getter and setter for myDataBean
  public String loadData() {
  ...
  return outcome;
  }
 
  public Stirng saveData() {
  ...
  return outcome;
  }
  ...
  }
 
  And then define the following relationship in faces-config.xml:
 
   managed-bean
managed-bean-namemyDataBean/managed-bean-name
 
 managed-bean-classcom.example.MyDataBean/managed-bean-class
managed-bean-scoperequest/managed-bean-scope
   /managed-bean
 
   managed-bean
managed-bean-namemyActionBean/managed-bean-name
managed-bean-class com.example.MyActionBean/managed-bean-class
managed-bean-scoperequest/managed-bean-scope
managed-property
 property-namemydataBean/property-name
 value#{myDataBean}/value
/managed-property
   /managed-bean
 
  Then in the screen that leads up to the screen that displays the initial
 value of the bean, your commandButton or commandLink would invoke
 #{myActionBean.loadData}.  The save commandButton would invoke
 #{myActionBean.saveData}, whose success would just lead to redisplaying
 the page.
 
  MyActionBean.loadData() would call the EJB layer to fetch the data and
 populate the fields within the object returned by getMyDataBean().  (JSF
 makes sure that this object is already instantiated.)
 
  MyActionBean.saveData() would call the EJB layer to update the database
 with the contents of the object returned by getMyDataBean().  (JSF populates
 this bean with the contents of the request.)  After this method return, JSF
 automatically populates the HTML fields with the values of this bean.
 
  - Brendan
 
  -Original Message-
  From: j2ee Developer [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, March 01, 2006 1:50 PM
  To: MyFaces Discussion
  Subject: Re: JSF Lifecycle and Design Question
 
 
  Thanks  Brendan! Sounds interesting! Can you please explain a little bit
 more on how are you seperating data beans from action beans. This is how I
 have implemented my backing beans. All data is in a formbean(struts style
 formbean), this formbean is a member attribute of my actual backing bean.
 The actual backing bean just has the action methods like save, clear, delete
 etc.
  Also if I do not call the action methods in the constructor, where do I
 call the action method before the screen gets displayed?
 
 
  On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote:
  
  
   Also, you shouldn't have to worry about populating the bean's values
 again after the save (unless you're changing them or re-querying the
 database), since the beans already have their values.  From what I recall
 (although it's been awhile since I've worked with Struts), this is one of
 the areas in which JSF makes our life a lot easier than with Struts.
  
   You may want to use t:saveState, though, to make sure your bean values
 get passed from one request to another.
  
  
   - Brendan
  
   -Original Message-
   From: CONNER, BRENDAN (SBCSI)
   Sent: Wednesday, March 01, 2006 12:59 PM
   To: MyFaces Discussion
   Subject: RE: JSF Lifecycle and Design Question
  
  
  
   I would advise against doing any kind of action as part of a managed
 bean's constructor.  In my experience, you want to separate out Action
 methods from Managed Bean data.  Your action methods should be the only
 things accessing the EJBs, etc.  So you should have an action method that
 gets invoked before the screen is displayed.  It goes out and gets the data
 and 

RE: JSF Lifecycle and Design Question

2006-03-01 Thread CONNER, BRENDAN \(SBCSI\)
Title: Message



If 
this is *really* your first page, you can do something like:

meta http-equiv="Refresh" content= "0; 
URL="">

that 
references an "outcome" that leads to a page that does an onload event that 
simulates the clicking of a hidden commandLink. We've done something 
similar when we want to display a page that says "Working please wait" while 
executing an action that takes a long time.

- 
Brendan

-Original Message-From: CONNER, 
BRENDAN (SBCSI) Sent: Wednesday, March 01, 2006 3:51 PMTo: 
MyFaces DiscussionSubject: RE: JSF Lifecycle and Design 
Question

  So 
  this is, in effect on your index page? No login page or 
  anything?
  
  - 
  Brendan
  
  

-Original Message-From: j2ee Developer 
[mailto:[EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 3:44 
PMTo: MyFaces DiscussionSubject: Re: JSF Lifecycle and 
Design QuestionAppreciate your response. That is very 
close to the way we have implemented it here. The only distinction being 
that the first time page load, in our scenario does not come from an action 
event ( commandbutton or commandlink). It is the first request. So I am 
confused as to where do I call the load(), other than the 
constructor.I understand that probably Shale or Spring can provide 
us this flexibility, but we are not evaluating them right now. Does anyone 
has any idea how I could implement this.
On 3/1/06, CONNER, 
BRENDAN (SBCSI) [EMAIL PROTECTED] wrote: 

  
  Oh, and don't forget to 
  put the following tag in your JSP that displays the contents of your data 
  bean:
  
  t:saveState 
  value="#{myDataBean}"/
  
  
  - 
  Brendan
  
  
  
  -Original Message-From: CONNER, BRENDAN (SBCSI) 
  
  Sent: Wednesday, March 01, 2006 2:18 
  PMTo: MyFaces DiscussionSubject: RE: JSF Lifecycle 
  and Design Question
  
  
  
What we do is something 
like the following:

public class MyDataBean 
implements Serializable {
 private String field1;
 private Date field2;
 // 
define getters and setters
}

public class 
MyActionBean implements Serializable {
 public MyDataBean myDataBean;
 // 
define getter and setter for myDataBean
 public String loadData() {
 ...
 return outcome;
 }

 public Stirng saveData() {
 ...
 return outcome;
 }
 ...
}

And then define the 
following relationship in faces-config.xml:

managed-beanmanaged-bean-namemyDataBean/managed-bean-namemanaged-bean-classcom.example.MyDataBean/managed-bean-class 
managed-bean-scoperequest/managed-bean-scope/managed-beanmanaged-beanmanaged-bean-namemyActionBean/managed-bean-namemanaged-bean-class 
com.example.MyActionBean/managed-bean-classmanaged-bean-scoperequest/managed-bean-scopemanaged-propertyproperty-namemydataBean/property-namevalue#{myDataBean}/value 
/managed-property/managed-bean
 
Then in the screen that 
leads up to the screen that displays the initial value of the bean, your 
commandButton or commandLink would invoke 
#{myActionBean.loadData}. The "save" commandButton would invoke 
#{myActionBean.saveData}, whose "success" would just lead to 
redisplaying the page.

MyActionBean.loadData() 
would call the EJB layer to fetch the data and populate the fields 
within the object returned by getMyDataBean(). (JSF makes sure 
that this object is already instantiated.)

MyActionBean.saveData() 
would call the EJB layer to update the database with the contents of the 
object returned by getMyDataBean(). (JSF populates this bean with 
the contents of the request.) After this method return, JSF 
automatically populates the HTML fields with the values of this 
bean.

- 
Brendan
-Original Message-From: 
j2ee Developer [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 01, 2006 1:50 PMTo: MyFaces 
DiscussionSubject: Re: JSF Lifecycle and Design 
Question
Thanks Brendan! Sounds 
  interesting! Can you please explain a little bit more on how are you 
  seperating data beans from action beans. This is how I have 
  implemented my backing beans. All data is in a formbean(struts style 
  formbean), this formbean is a member attribute of my actual backing 
  bean. The actual backing bean just has the action methods like save, 
  clear, delete etc.Also if I do not call the action methods in the 
  constructor, where do I call the action method before the screen gets 
  

Ajax woes with facelets and myfaces

2006-03-01 Thread Andrew Robinson
Okay, I am trying to create a wizard in an AjaxAnywhere zone. I just
posted a question to the myfaces list about this, but did not reply,
as this is a different approach and I am having different problems.

Setup (this is just shorthand):
non-ajax form.../form
ajax formaaZoneui:decorate
template=#{getfrombackingbean}//aaZone/form
AA JS stuff...

Okay, this is plain Myfaces 1.1.1 code with Facelets 1.0.10. I am
using server side state keeping.

The aaZone dynamically includes a template (I also tried ui:include
src=.../ with the same outcome) based on the state of my backing
bean. This state determines what div to show in my Ajax zone.

Flow:
Initial page: show a button to start
2nd page: input text, next and cancel controls (all tomahawk)
3rd page: display value from input text and save and cancel buttons
4th page is the initial page (back to start)

Navigation for each action button just specifies the ViewID of the
current page (always post back to myself).

The first form includes non-ajax controls. It is working right now,
the state is not corrupted.

I am fine on the initial page
I am fine on the 2nd page
The 3rd page shows the input text from page two instead of the Save
button and shows the Next button instead of the Cancel button.

The buttons have their own IDs specified. Somewhere the controls from
the previous rendering/view are getting drawn instead of the controls
from the current page.

here is some of the XHTML:
Parent page AA code:
h:form id=ajaxForm
  div style=border: 1px solid blue;
aa:zoneJSF id=ajaxZone
  !--div style=border: 1px solid red;
ui:include src=/pages/ContentMgmt/#{testBean.wizardViewId} /
  /div--
  div style=border: 1px solid red;
ui:decorate
template=/pages/ContentMgmt/#{testBean.wizardViewId} /
  /div
  The current state is: #{testBean.state}br/
  The above div comes from : #{testBean.wizardViewId}br/
/aa:zoneJSF
  /div
/h:form

Initial page AA content:
ui:composition
  This is an ajax zone
  Counter: #{testBean.counter}
  t:commandButton id=ajaxButtonSave value=Add a new Web page
action=#{testBean.putDocument}
actionListener=#{ajaxState.handlePostBack} /
/ui:composition

2nd page AA content:
ui:composition
  #{otest:log('This is the content')}
  Pass something:
  t:inputText value=#{testBean.testValue} id=testValue
required=true /
  br/
  This is the first page of my wizardbr/
  t:commandButton id=ajaxNext value=Next action=#{testBean.next}
actionListener=#{ajaxState.handlePostBack} /
  t:commandButton id=ajaxCancelAction value=Cancel
action=#{testBean.cancel}
actionListener=#{ajaxState.handlePostBack} /
/ui:composition

3rd page AA content (this is the one that is corrupted):
ui:composition
  #{otest:log('This is the content of page 2')}br/
  The value that was passed from page 1 is: #{testBean.testValue}br/
  This is the second page of my wizardbr/
  t:commandButton id=ajaxSave value=Save action=#{testBean.finish}
actionListener=#{ajaxState.handlePostBack} /
  t:commandButton id=ajaxCancel value=Cancel
action=#{testBean.cancel}
actionListener=#{ajaxState.handlePostBack} /
/ui:composition

The ajaxState bean is request scoped and is just so I can check if the
postback is an Ajax postback or a normal postback

The testBean is a session scoped bean with all my action methods and a
state variable to remember the current wizard location.

All the HTML looks great, it is only the JSF components/controls that
are incorrect.

Ideas?

Thanks,
Andrew


Re: JSF Lifecycle and Design Question

2006-03-01 Thread Adam Brod

You can just lazily load the data in
your bean. For example, myActionBean.getMyDataBean(), just call loadData()
in there. (You can keep a boolean to make sure you only load the
data once.)

Adam Brod
Product Development Team




j2ee Developer
[EMAIL PROTECTED] 
03/01/2006 04:43 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: JSF Lifecycle and Design
Question








Appreciate your response. That is very close to the way
we have implemented it here. The only distinction being that the first
time page load, in our scenario does not come from an action event ( commandbutton
or commandlink). It is the first request. So I am confused as to where
do I call the load(), other than the constructor.
 I understand that probably Shale or Spring can provide us this flexibility,
but we are not evaluating them right now. Does anyone has any idea how
I could implement this.


On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED]
wrote:
Oh, and don't forget to put the
following tag in your JSP that displays the contents of your data bean:

t:saveState value=#{myDataBean}/

- Brendan

-Original Message-
From: CONNER, BRENDAN (SBCSI) 
Sent: Wednesday, March 01, 2006 2:18
PM
To: MyFaces Discussion
Subject: RE: JSF Lifecycle and Design Question

What we do is something like the
following:

public class MyDataBean implements
Serializable {
  private
String field1;
  private
Date field2;
  //
define getters and setters
}

public class MyActionBean implements
Serializable {
  public
MyDataBean myDataBean;
  // define getter
and setter for myDataBean
  public
String loadData() {
...
return
outcome;
  }

  public
Stirng saveData() {
...
return
outcome;
  }
  ...
}

And then define the following
relationship in faces-config.xml:

managed-bean
 managed-bean-namemyDataBean/managed-bean-name
 managed-bean-classcom.example.MyDataBean/managed-bean-class

 managed-bean-scoperequest/managed-bean-scope
 /managed-bean
 
 managed-bean
 managed-bean-namemyActionBean/managed-bean-name
 managed-bean-class com.example.MyActionBean/managed-bean-class
 managed-bean-scoperequest/managed-bean-scope
 managed-property
  property-namemydataBean/property-name
  value#{myDataBean}/value 
 /managed-property
 /managed-bean
  
Then in the screen that leads
up to the screen that displays the initial value of the bean, your commandButton
or commandLink would invoke #{myActionBean.loadData}. The save
commandButton would invoke #{myActionBean.saveData}, whose success
would just lead to redisplaying the page.

MyActionBean.loadData() would
call the EJB layer to fetch the data and populate the fields within the
object returned by getMyDataBean(). (JSF makes sure that this object
is already instantiated.)

MyActionBean.saveData() would
call the EJB layer to update the database with the contents of the object
returned by getMyDataBean(). (JSF populates this bean with the contents
of the request.) After this method return, JSF automatically populates
the HTML fields with the values of this bean.

- Brendan
-Original Message-
From: j2ee Developer [mailto:[EMAIL PROTECTED]]

Sent: Wednesday, March 01, 2006 1:50 PM
To: MyFaces Discussion
Subject: Re: JSF Lifecycle and Design Question

Thanks Brendan! Sounds interesting! Can you please
explain a little bit more on how are you seperating data beans from action
beans. This is how I have implemented my backing beans. All data is in
a formbean(struts style formbean), this formbean is a member attribute
of my actual backing bean. The actual backing bean just has the action
methods like save, clear, delete etc.
Also if I do not call the action methods in the constructor, where do I
call the action method before the screen gets displayed? 

On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED]
wrote: 
Also, you shouldn't have to worry
about populating the bean's values again after the save (unless you're
changing them or re-querying the database), since the beans already have
their values. From what I recall (although it's been awhile since
I've worked with Struts), this is one of the areas in which JSF makes our
life a lot easier than with Struts.

You may want to use t:saveState,
though, to make sure your bean values get passed from one request to another.

- Brendan
-Original Message-
From: CONNER, BRENDAN (SBCSI) 
Sent: Wednesday, March 01, 2006 12:59 PM
To: MyFaces Discussion
Subject: RE: JSF Lifecycle and Design Question

I would advise against doing any
kind of action as part of a managed bean's constructor. In my experience,
you want to separate out Action methods from Managed Bean data. Your
action methods should be the only things accessing the EJBs, etc. So
you should have an action method that gets invoked before the screen is
displayed. It goes out and gets the data and populates the data fields,
which then get displayed. Your Save then is very simple, since JSF
automatically 

Re: t:inputCalendar component position

2006-03-01 Thread Mike Kienenberger
I recommend opening a JIRA issue on this.
Fixes posted to the mailing list tend to get overlooked and lost due
to the high volume of email.

Thanks.

On 2/24/06, Arshad Ali [EMAIL PROTECTED] wrote:
 I was also using calendar in scrollable div and i got the same problem, so i
 just changed the .js file like that..

 add following code first:

 // CODE ADDED BY ARSHAD ALI =
 //browser detection
 var IE = document.all?true:false

 if (!IE) document.captureEvents(Event.MOUSEMOVE)

 document.onmousemove = getMouseXY;

 var tempX = 0
 var tempY = 0

 function getMouseXY(e)
 {
   if( IE ) //if IE
   {

 tempX = event.clientX + document.body.scrollLeft
 tempY = event.clientY + document.body.scrollTop

   }
   else
   {
 tempX = e.pageX
 tempY = e.pageY
   }

   if( tempX  0 ) { tempX = 0 }
   if( tempY  0 ){ tempY = 0 }

   return true
 }
 //
 

 then comment following code in
 jscalendarPopUpCalendar_Show(ctl):

 /*
 varleftpos = 0;
 vartoppos = 0;

 var aTag = ctl;
 do {
 aTag = aTag.offsetParent;
 leftpos+= aTag.offsetLeft ;
 toppos += aTag.offsetTop;
 } while(aTag.tagName!=BODY);

   jscalendarCrossobj.left = jscalendarFixedX==-1 ? ctl.offsetLeft+
 leftpos + px: jscalendarFixedX;
jscalendarCrossobj.top = jscalendarFixedY==-1 ?ctl.offsetTop +
 toppos + ctl.offsetHeight +2 + px: jscalendarFixedY;


 */

 and asign left and top like that:

 jscalendarCrossobj.left = tempX;
  jscalendarCrossobj.top = tempY;




 regards
 Syed Arshad Ali


Re: immediate action for non commands

2006-03-01 Thread Mike Kienenberger
Use immediate=true on your pulldown as well.
Then you should have access to the converted value in
component.getValue() [it might be component.getLocalValue() -- I can't
remember right now].



On 3/1/06, Lance Frohman [EMAIL PROTECTED] wrote:
 Thanks,
  In the action, how do I tell which option of the select was clicked on (I
 am using immediate=true)?


 -Original Message-
 From: Dennis Byrne [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 28, 2006 7:41 PM
 To: MyFaces Discussion
 Subject: Re: immediate action for non commands

 The kludge you speak of is the most popular way to do this.

 One warning.  Let's say you have two controls, selectOneMenu and inputText.
 Your requirement is that the inputText is to be rendered *only* when a
 certain item (let's call it 'ITEM X') in the selectOneMenu is selected.  You
 accomplish this by hooking a js event hander into @onclick or @onchange of
 the selectOneMenu.  The js clicks a hidden commandButton and the form is
 submitted.  In the action or actionListener of the commandButton, you
 dynamically render the inputText element and the form is then rerendered.

 If the user clicks then back button, on both IE and FireFox at least, the
 browser will not go back to the server.  It will simple display the first
 page in the state it was in just *before* the form was submitted.  There are
 two important parts to keep in mind.  First, the selected item of the
 selectOneMenu was 'ITEM X'.  Second, the inputText field was *not* rendered
 when the form was submitted.  The user will have then effectivly placed the
 form into a state that is against the initial requirement.

 Dennis Byrne

 -Original Message-
 From: Lance Frohman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 28, 2006 08:57 PM
 To: ''MyFaces Discussion''
 Subject: immediate action for non commands
 
 What is the best practice if I need a drop down list -
 h:selectOneListbox - change to go to the server, as if there was an
 immediate=true on a command button.
 Depending on what is selected in the h:selectOneListbox, the page
 will be displayed differently.
 I was using a kludge with onclick= submitting a h:commandButton
 style=visibility:hidden; ...
 
 Thanks,
 Lance
 
 





RE: immediate action for non commands

2006-03-01 Thread Lance Frohman
Hope this isn't a stupid question, but how do I get the component (given the
id)
in the action method? I couldn't find a method in FacesContext, etc.

-Original Message-
From: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 01, 2006 3:36 PM
To: MyFaces Discussion
Subject: Re: immediate action for non commands

Use immediate=true on your pulldown as well.
Then you should have access to the converted value in
component.getValue() [it might be component.getLocalValue() -- I can't
remember right now].



On 3/1/06, Lance Frohman [EMAIL PROTECTED] wrote:
 Thanks,
  In the action, how do I tell which option of the select was clicked 
 on (I am using immediate=true)?


 -Original Message-
 From: Dennis Byrne [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 28, 2006 7:41 PM
 To: MyFaces Discussion
 Subject: Re: immediate action for non commands

 The kludge you speak of is the most popular way to do this.

 One warning.  Let's say you have two controls, selectOneMenu and
inputText.
 Your requirement is that the inputText is to be rendered *only* when a 
 certain item (let's call it 'ITEM X') in the selectOneMenu is 
 selected.  You accomplish this by hooking a js event hander into 
 @onclick or @onchange of the selectOneMenu.  The js clicks a hidden 
 commandButton and the form is submitted.  In the action or 
 actionListener of the commandButton, you dynamically render the inputText
element and the form is then rerendered.

 If the user clicks then back button, on both IE and FireFox at least, 
 the browser will not go back to the server.  It will simple display 
 the first page in the state it was in just *before* the form was 
 submitted.  There are two important parts to keep in mind.  First, the 
 selected item of the selectOneMenu was 'ITEM X'.  Second, the 
 inputText field was *not* rendered when the form was submitted.  The 
 user will have then effectivly placed the form into a state that is
against the initial requirement.

 Dennis Byrne

 -Original Message-
 From: Lance Frohman [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 28, 2006 08:57 PM
 To: ''MyFaces Discussion''
 Subject: immediate action for non commands
 
 What is the best practice if I need a drop down list - 
 h:selectOneListbox - change to go to the server, as if there was an 
 immediate=true on a command button.
 Depending on what is selected in the h:selectOneListbox, the page 
 will be displayed differently.
 I was using a kludge with onclick= submitting a h:commandButton 
 style=visibility:hidden; ...
 
 Thanks,
 Lance
 
 






Re: immediate action for non commands

2006-03-01 Thread Mike Kienenberger
The best way to do it is to use

component binding=#{yourBean.component} 

on your page.

This only works if you're referencing the component from the same bean
every time  (which is generally the case).

Otherwise, you need to use findComponent() or invokeOnComponent(),
which is a lot more involved.

On 3/1/06, Lance Frohman [EMAIL PROTECTED] wrote:
 Hope this isn't a stupid question, but how do I get the component (given the
 id)
 in the action method? I couldn't find a method in FacesContext, etc.

 -Original Message-
 From: Mike Kienenberger [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 01, 2006 3:36 PM
 To: MyFaces Discussion
 Subject: Re: immediate action for non commands

 Use immediate=true on your pulldown as well.
 Then you should have access to the converted value in
 component.getValue() [it might be component.getLocalValue() -- I can't
 remember right now].



 On 3/1/06, Lance Frohman [EMAIL PROTECTED] wrote:
  Thanks,
   In the action, how do I tell which option of the select was clicked
  on (I am using immediate=true)?
 
 
  -Original Message-
  From: Dennis Byrne [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 28, 2006 7:41 PM
  To: MyFaces Discussion
  Subject: Re: immediate action for non commands
 
  The kludge you speak of is the most popular way to do this.
 
  One warning.  Let's say you have two controls, selectOneMenu and
 inputText.
  Your requirement is that the inputText is to be rendered *only* when a
  certain item (let's call it 'ITEM X') in the selectOneMenu is
  selected.  You accomplish this by hooking a js event hander into
  @onclick or @onchange of the selectOneMenu.  The js clicks a hidden
  commandButton and the form is submitted.  In the action or
  actionListener of the commandButton, you dynamically render the inputText
 element and the form is then rerendered.
 
  If the user clicks then back button, on both IE and FireFox at least,
  the browser will not go back to the server.  It will simple display
  the first page in the state it was in just *before* the form was
  submitted.  There are two important parts to keep in mind.  First, the
  selected item of the selectOneMenu was 'ITEM X'.  Second, the
  inputText field was *not* rendered when the form was submitted.  The
  user will have then effectivly placed the form into a state that is
 against the initial requirement.
 
  Dennis Byrne
 
  -Original Message-
  From: Lance Frohman [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 28, 2006 08:57 PM
  To: ''MyFaces Discussion''
  Subject: immediate action for non commands
  
  What is the best practice if I need a drop down list -
  h:selectOneListbox - change to go to the server, as if there was an
  immediate=true on a command button.
  Depending on what is selected in the h:selectOneListbox, the page
  will be displayed differently.
  I was using a kludge with onclick= submitting a h:commandButton
  style=visibility:hidden; ...
  
  Thanks,
  Lance
  
  
 
 
 




JSF and ServletFilter

2006-03-01 Thread sia far


I have a servlet filter that does some authentication and if it fails it is 
supposed to forward to a simple error page displaying a message (the page 
has no jsf component). Though I have this working using struts, I am 
starting to have a hard time to make it work. I am making the following 
call:


servletContext.getRequestDispatcher(error.jsp).forward(request,response);

Is there anything extra I need to make this work? is this problem caused by 
JSF? (I have the same thing working in struts with no problems).





RE: immediate action for non commands

2006-03-01 Thread Lance Frohman
Thanks, findComponent() was pretty easy, unless I goofed:

(in action method)
UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
HtmlSelectOneListbox listBox =
(HtmlSelectOneListbox)root.findComponent(form:id);

-Original Message-
From: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 01, 2006 3:48 PM
To: MyFaces Discussion
Subject: Re: immediate action for non commands

The best way to do it is to use

component binding=#{yourBean.component} 

on your page.

This only works if you're referencing the component from the same bean every
time  (which is generally the case).

Otherwise, you need to use findComponent() or invokeOnComponent(), which is
a lot more involved.

On 3/1/06, Lance Frohman [EMAIL PROTECTED] wrote:
 Hope this isn't a stupid question, but how do I get the component 
 (given the
 id)
 in the action method? I couldn't find a method in FacesContext, etc.

 -Original Message-
 From: Mike Kienenberger [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 01, 2006 3:36 PM
 To: MyFaces Discussion
 Subject: Re: immediate action for non commands

 Use immediate=true on your pulldown as well.
 Then you should have access to the converted value in
 component.getValue() [it might be component.getLocalValue() -- I can't 
 remember right now].



 On 3/1/06, Lance Frohman [EMAIL PROTECTED] wrote:
  Thanks,
   In the action, how do I tell which option of the select was clicked 
  on (I am using immediate=true)?
 
 
  -Original Message-
  From: Dennis Byrne [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 28, 2006 7:41 PM
  To: MyFaces Discussion
  Subject: Re: immediate action for non commands
 
  The kludge you speak of is the most popular way to do this.
 
  One warning.  Let's say you have two controls, selectOneMenu and
 inputText.
  Your requirement is that the inputText is to be rendered *only* when 
  a certain item (let's call it 'ITEM X') in the selectOneMenu is 
  selected.  You accomplish this by hooking a js event hander into 
  @onclick or @onchange of the selectOneMenu.  The js clicks a hidden 
  commandButton and the form is submitted.  In the action or 
  actionListener of the commandButton, you dynamically render the 
  inputText
 element and the form is then rerendered.
 
  If the user clicks then back button, on both IE and FireFox at 
  least, the browser will not go back to the server.  It will simple 
  display the first page in the state it was in just *before* the form 
  was submitted.  There are two important parts to keep in mind.  
  First, the selected item of the selectOneMenu was 'ITEM X'.  Second, 
  the inputText field was *not* rendered when the form was submitted.  
  The user will have then effectivly placed the form into a state that 
  is
 against the initial requirement.
 
  Dennis Byrne
 
  -Original Message-
  From: Lance Frohman [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 28, 2006 08:57 PM
  To: ''MyFaces Discussion''
  Subject: immediate action for non commands
  
  What is the best practice if I need a drop down list - 
  h:selectOneListbox - change to go to the server, as if there was 
  an immediate=true on a command button.
  Depending on what is selected in the h:selectOneListbox, the page 
  will be displayed differently.
  I was using a kludge with onclick= submitting a h:commandButton 
  style=visibility:hidden; ...
  
  Thanks,
  Lance
  
  
 
 
 





[OT] Downloading J2EE Without the Sun App Server

2006-03-01 Thread Mike Duffy
Am I missing something? 

http://java.sun.com/j2ee/1.4/download.html#sdk

Is there anyway to download the latest J2EE without downloading the Sun App 
server?

Thx.

Mike

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


two window interaction

2006-03-01 Thread Dave
When a user click an icon, a 2nd window pops up to ask user to make a selection from a tree navigation.After user makes a choice, close the 2nd window. what is the way to fill the first window with the selection.Thanks!  
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 


Re: two window interaction

2006-03-01 Thread Dennis Byrne
In js from the child window.

window.opener.parent.document.getElementById('to').value = 
document.getElementById('from');
window.close();

Dennis Byrne

-Original Message-
From: Dave [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 1, 2006 09:42 PM
To: users@myfaces.apache.org
Subject: two window interaction

When a user click an icon, a 2nd window pops up to ask user to make a 
selection from a tree navigation. After user makes a choice, close the 2nd 
window. what is the way to fill the first window with the selection.

  Thanks!


   
-
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze.