-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4087003
By: korsdal
hi,
i am trying to use zk instead of jsf.
in my jsf-controller-classes (managed beans) i use the @EJB annotation to inject my controller with my ejb-DAOs.
it works perfectly. EJB-sepc says you can only use this dependency-injection (@EJB) with managed classes.
now i try to use the injection in my zk-controller, which basically works as a data-binding manager to submit new form-data.
(as you demenstraded in your latest data-binding smalltalk).
no i try to inject this class with my ejb-DAO as well, but it doesn't work. (@EJB annotation doesn't do anything, it just get ignored.).
#1. how can i make my zl-controller class "managed" like a jsf-managed-bean ?
#2. any other suggestions ?
thanks for any help.
tim
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4087438
By: henrichen
Can you provide a "very" simple example and let's see what we can do? (In jsf form and in zk form)
/henri
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4568162
By: arrigonineri
I have the same problem.
Here is a simple Window what does not work propertly:
package test;
import org.zkoss.zul.*;
import org.zkoss.zk.ui.*;
import org.zkoss.zk.ui.event.*;
import org.zkforge.dojo.*;
import javax.ejb.*;
import mario.*;
public class Main extends Window
{
@EJB
MarioLocal m;
private Button b = new Button("test");
public Main()
{
super(null, "none", false);
setWidth("100%");
setHeight("600px");
b.addEventListener(Events.ON_CLICK, new EventListener()
{
public void onEvent(Event evt)
{
b.setLabel("" + m);
}
});
this.appendChild(b);
}
}
MarioLocal is the local interface to a stateless EJB in the same EAR.
when the button is pressed, m is still null.
If I implement the same in JSF m is correctly retrieved.
I cannot attach the whole zip, if you need I can upload it.
thanks for any help.
Mario
Asked: 2007-01-04 19:09:27 +0800
Seen: 626 times
Last updated: Nov 15 '10