MyFaces CODI and Weld 1.0.1

2011-03-09 Thread Christian Kaltepoth
Hey all,

we are currently developing an application based on Weld 1.0.1 and
MyFaces CODI. Unfortunately we have some strange problems regarding
CODI's @Transactional not always being applied correctly. It seems to
be completely ignored in some situations.

I've reproduced this problem with Matthias' Modern-EE-JSF2.0 example
application. I did just two modifications:

1. Weld doesn't support to inject the EntityManager via
@PersistenceContext. So I created a class named EntityManagerProducer
to create request scoped EntityManager instances. Then I replaced
@PersistenceContext in the DAO with @Inject. This works fine with
OpenWebBeans.

2. Then I removed OpenWebBeans and added Weld 1.0.1 to the
dependencies. After that @Transactional immediately stopped working.
It seems like the TransactionalInterceptor doesn't get invoked at all.
No transactions are started and changes to the database aren't
persisted any more.

You can get the example application here:

https://github.com/chkal/modern-ee-app20

Here are the modifications I made to the application:

https://github.com/chkal/modern-ee-app20/commits/master

Does anyone have an idea what is causing this? I'm not really sure if
it is a CODI or a Weld issue.

Thanks

Christian


-- 
Christian Kaltepoth
Blog: http://chkal.blogspot.com/
Twitter: http://twitter.com/chkal


Re: MyFaces CODI and Weld 1.0.1

2011-03-09 Thread Christian Kaltepoth
Hi Mark,

thank you very much for your response. I've tried your suggestion and
it worked great. I didn't knew about the BDA part in the spec and
assumed that CODI's beans.xml would globally enable the interceptor.
You are right! This BDA stuff is crap! :-)

@Matthias: Nice workaround! ;)

Thanks

Christian



2011/3/9 Mark Struberg strub...@yahoo.de:
 Hi Christian!

 The major difference between Weld and OpenWebBeans in the interceptor area is 
 that Weld strictly follows the Bean Definition Archive (BDA) part of the 
 spec. This got added pretty late (in the last few weeks before the spec went 
 final and imo is complete crap [1] ;)

 In Weld you have to add the interceptors section to ALL jars as well as to 
 the WAR you like to use the interceptor in. Whereas in OWB it is enough to 
 just have it enabled in 1 of the beans.xml files.

 So please try adding those section to all your beans.xml files and plz report 
 back if that worked out.

 LieGrue,
 strub


 [1] https://issues.jboss.org/browse/CDI-18
 --- On Wed, 3/9/11, Christian Kaltepoth christ...@kaltepoth.de wrote:

 From: Christian Kaltepoth christ...@kaltepoth.de
 Subject: MyFaces CODI and Weld 1.0.1
 To: MyFaces Discussion users@myfaces.apache.org
 Date: Wednesday, March 9, 2011, 12:31 PM
 Hey all,

 we are currently developing an application based on Weld
 1.0.1 and
 MyFaces CODI. Unfortunately we have some strange problems
 regarding
 CODI's @Transactional not always being applied correctly.
 It seems to
 be completely ignored in some situations.

 I've reproduced this problem with Matthias'
 Modern-EE-JSF2.0 example
 application. I did just two modifications:

 1. Weld doesn't support to inject the EntityManager via
 @PersistenceContext. So I created a class named
 EntityManagerProducer
 to create request scoped EntityManager instances. Then I
 replaced
 @PersistenceContext in the DAO with @Inject. This works
 fine with
 OpenWebBeans.

 2. Then I removed OpenWebBeans and added Weld 1.0.1 to the
 dependencies. After that @Transactional immediately stopped
 working.
 It seems like the TransactionalInterceptor doesn't get
 invoked at all.
 No transactions are started and changes to the database
 aren't
 persisted any more.

 You can get the example application here:

 https://github.com/chkal/modern-ee-app20

 Here are the modifications I made to the application:

 https://github.com/chkal/modern-ee-app20/commits/master

 Does anyone have an idea what is causing this? I'm not
 really sure if
 it is a CODI or a Weld issue.

 Thanks

 Christian


 --
 Christian Kaltepoth
 Blog: http://chkal.blogspot.com/
 Twitter: http://twitter.com/chkal








-- 
Christian Kaltepoth
Blog: http://chkal.blogspot.com/
Twitter: http://twitter.com/chkal


Re: commandbutton does not call the backend bean

2010-09-28 Thread Christian Kaltepoth
Seems like the validation failed for some reason. Did you add a
h:messages to the page? You could also try to skip the model update
(and valdiation) by setting the immediate attribute of the button to
true.

Christian


2010/9/28, Xiaobo Yang xiaobo.y...@gmail.com:
 Hi all,

 I'm using MyFaces 1.1.5 and Tomahawk 1.1.6 in an application and got a
 problem with a button. When I clicked the button, it did not call the
 backend bean but stayed in the same page. I noticed the lines below in
 the log file.

 org.apache.myfaces.lifecycle.LifecycleImpl - exiting from
 lifecycle.execute in PROCESS_VALIDATIONS(3) because getRenderResponse
 is true from one of the after listeners
 org.apache.myfaces.lifecycle.LifecycleImpl - entering
 RENDER_RESPONSE(6) in org.apache.myfaces.lifecycle.LifecycleImpl

 Could anybody explain what are the possible reasons to cause
 PROCESS_VALIDATIONS to stop?

 Many thanks,
 Xiaobo



-- 
Christian Kaltepoth
Blog: http://chkal.blogspot.com/
Twitter: http://twitter.com/chkal


Re: Issues installing Tomahawk

2009-08-01 Thread Christian Kaltepoth
Are there any more information you could give us regarding
this problem? Are there any exceptions that are thrown?
error 503 doesn't provide much information for isolating
the problem.

Christian


On Friday 31 July 2009 11:30:03 Steve ColombiƩ wrote:
 Hello everybody,

 I'm trying to install Tomahawk, but it always gives me a server error.

 I'm using Netbeans 6.5, JSF 1.2 (Sun implementation) and Glassfish V2.
 I've followed the Setup Guide :
 - Add the tomahawk.jar library to the WEB-INF/lib directory
 - Configure the filtrer in web.xml
 - Add the the taglib to my pages when I use Tomahawk components

 But when I browse any page of my application (even those which don't use
 Tomahawk components), it gives me a error 503.

 Does anybody have any hint about this ?

 Thanks in advance,
 Steve ColombiƩ.



-- 
Christian Kaltepoth
Blog: http://chkal.blogspot.com/
Twitter: http://twitter.com/chkal


Re: t:datatable, select a row and go to another page

2008-11-11 Thread Christian Kaltepoth
On Tuesday 11 November 2008 03:25:57 tong123123 wrote:
 there is a t:datatable for storing the header
 table information, when user select a row,
 display a new page for the detail information
 of this select item, how to do this in JSF?

 I think I need to use t:datatable, with a field
 outputLink, so user can select the link in a row (master
 table) and then go to the detail table
 in another page, but the problem is
 how to know which row (or a key)
 user has pressed in the t:datatable
 in the detail page?

 is there any method to carry the user pressed
 value in the outputLink?

Take a look at the MyFaces Wiki:

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

This wiki page describes common patterns to solve the From List to Detail 
problem..

Christian


Re: Table rows without table

2008-08-10 Thread Christian Kaltepoth
On Sunday 10 August 2008 21:22:05 Markus Mehrwald wrote:
 Hello,

 actually this is not really a MyFaces problem but hopefully someone can
 help me although.
 I have got a panel grid with two columns and a few rows. In this panel
 grid I want to have something like a data table or a data list but not
 as separate table in a column of the panel grid but only the rows i. e.
 without a own table tag.
 I tried to implement my own iterator which writes only tr and td
 tags without the table tags because I have already table tags from
 the panel grid. Unfortunately the panel grid always creates table tags
 around my iterator.
 Hopefully a small illustration will be helpfully for understanding what
 I want:

 Thank you for any kind of help!

There are several ways to achieve this:

* Use Tomahawks extended datatable with embedded=true. This prevents 
rendering of HTML table tags and just renders simple rows. 

See: http://myfaces.apache.org/tomahawk/tlddoc/t/dataTable.html

* Use Tomahawks dataList component with layout=simple. This will simply 
render all children for each row, so you will have to render the tr and 
td tags yourself.

See: http://myfaces.apache.org/tomahawk/tlddoc/t/dataList.html

* If you are using facelets, you could also use ui:repeat

See: https://facelets.dev.java.net/nonav/docs/dev/docbook.html#template-repeat


Kind regards

Christian


Re: Replacing expression factory

2008-08-09 Thread Christian Kaltepoth
On Thursday 07 August 2008 12:08:00 XMaNIaC wrote:
 Hi,

 In JSF-RI you can:

 context-param
param-namecom.sun.faces.expressionFactory/param-name
param-valueorg.jboss.el.ExpressionFactoryImpl/param-value
 /context-param

 to use JBOSS-EL and have method invocation. Is this possible in MyFaces?

 Regards

Very interesting question. I just did some code research to find out if
there is some possibility to define a custom ExpressionFactory implementation.

I found the context parameter 'org.apache.myfaces.EXPRESSION_FACTORY'.
But to my surprise this parameter is only evaluated in a JSP 2.0 environment.
It was introduced in order to make MyFaces 1.2.x work with JSP 2.0. See
MYFACES-1693 for details.

I think it would be a great improvement for MyFaces to support this parameter
in a JSP 2.1 environment as well. This feature would allow to use other EL
implementations like JBoss EL.

See: 

http://www.ilikespam.com/blog/el-function-parameters-with-jboss-el



Re: Replacing expression factory

2008-08-09 Thread Christian Kaltepoth
On Saturday 09 August 2008 12:30:22 Matthias Wessendorf wrote:
  Very interesting question. I just did some code research to find out if
  there is some possibility to define a custom ExpressionFactory
  implementation.
 
  I found the context parameter 'org.apache.myfaces.EXPRESSION_FACTORY'.
  But to my surprise this parameter is only evaluated in a JSP 2.0
  environment. It was introduced in order to make MyFaces 1.2.x work with
  JSP 2.0. See MYFACES-1693 for details.
 
  I think it would be a great improvement for MyFaces to support this
  parameter in a JSP 2.1 environment as well. This feature would allow to
  use other EL implementations like JBoss EL.

 +1
 Christian, can you create a jira ticket for such an enhancement?

OK, done :-)

https://issues.apache.org/jira/browse/MYFACES-1902


Re: [Tomahawk][Faceslets][Seam] Tomahawk controls not rendered

2008-06-29 Thread Christian Kaltepoth
On Friday 27 June 2008 22:20:13 Guy Bashan wrote:
 Hi,

 I am using Tomahawk, Facelets and Seam. Page it rendered properly. When I
 add Tomahawk control it is not rendered on the screen. When I change from
 t to h and refresh the page, the control is rendered.

 Has anyone encountered a similar problem?

Perhaps the taglib.xml file for Tomahawk is missing. In this case Facelets 
will ignore your t tags and render them directly to the output page.

If this is the case, take a look here:

http://code.google.com/p/tomahawk-facelets/

Kind regards

Christian


Re: How to get managed bean object in java script

2007-07-05 Thread Christian Kaltepoth
Hi,

take a look at Shale Remoting [1]. It provides a way to call backing bean 
methods from javascript via ajax.

[1] http://shale.apache.org/shale-remoting/

Kind Regards,

Christian


Am Freitag, 6. Juli 2007 06:21 schrieb [EMAIL PROTECTED]:
 Hi,

 How to get managed bean object inside java script
 method? If anybody has any idea please let me know.

 Regards,

 Basha


Re: Possible bug in t:inputHidden tag/component?

2007-03-27 Thread Christian Kaltepoth
Hi Eivind,

 Suddenly all my commandLinks and commandButtons didn't work anymore, I
 could press them and the form would submit (causing a reload of the page),
 but no actions would be fired, and the updateActionListeners stopped
 working as well.

Did you use the h:messages/ tag in your page to display potential validation 
errors? Perhaps some validation error occurred that is not displayed. This 
would cause your action method and the listeners to be ignored because of the 
failure in the validation phase.

Kind regards

Christian


-- 
Christian Kaltepoth [EMAIL PROTECTED]
GnuPG Key: http://www.kaltepoth.de/gnupg/pubkey.asc
Fingerprint: 9F04 0A94 CC40 C3EF 1A69  B2BB 51F4 4C84 BEB6 F127


Re: Possible bug in t:inputHidden tag/component?

2007-03-27 Thread Christian Kaltepoth
Hi Eivind,

 Suddenly all my commandLinks and commandButtons didn't work anymore, I
 could press them and the form would submit (causing a reload of the page),
 but no actions would be fired, and the updateActionListeners stopped
 working as well.

Did you use the h:messages/ tag in your page to display potential validation 
errors? Perhaps some validation error occurred that is not displayed. This 
would cause your action method and the listeners to be ignored because of the 
failure in the validation phase.

Kind regards

Christian


-- 
Christian Kaltepoth [EMAIL PROTECTED]
GnuPG Key: http://www.kaltepoth.de/gnupg/pubkey.asc
Fingerprint: 9F04 0A94 CC40 C3EF 1A69  B2BB 51F4 4C84 BEB6 F127