RE: How configure DialogContextListener?
I'll open the RFE as soon as possible. At the moment to solve the problem I have done: 1) Created a my DialogContextManagerListener overriding the onCreate method to add my DialogContextListener to the DialogContext: public class DialogContextManagerListener extends AbstractDialogContextManagerListener { public void onCreate(DialogContext context) { context.addDialogContextListener(new MyDialogContextListener()); super.onCreate(context); } } 2)Created a my DialogLifecycleListener overriding the onInit method to add my previous DialogContextManagerListener to the DialogContextManager: public class DialogLifecycleListener extends AbstractDialogLifecycleListener { public void onInit(DialogContextManager manager) { manager.addDialogContextManagerListener( new DialogContextManagerListener()); super.onInit(manager); } } 3) Configured, in my faces-config.xml the previous DialogLifecycleListener: managed-bean managed-bean-name org.apache.shale.dialog.LIFECYCLE_LISTENER /managed-bean-name managed-bean-class prova.DialogLifecycleListener /managed-bean-class managed-bean-scopeapplication/managed-bean-scope /managed-bean Is it correct? Thanks in advance Mario -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: 29 maggio 2007 03.19 To: user@shale.apache.org Subject: Re: How configure DialogContextListener? On 5/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks, but there is no way to configure a listener statically (for example using a configuration file)? I need to configure the same listener for each dialog started, but I understand that both solution need to be done by the programmer. At the moment, there is no mechanism to declaratively register a listener. That would make a useful RFE if you wanted to file an issue for it. Craig Mario -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: 25 maggio 2007 19.03 To: user@shale.apache.org Subject: Re: How configure DialogContextListener? On 5/25/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, how can i configure a DialogContextListener? Two different ways: (1) Get access to the DialogContext instance for the currently active dialog, then call addDialogContextListener() on it, passing the instance of your listener. This is the usual JavaBeans pattern for registering event listeners. (2) If you are using the getData/setData methods to save state information for your dialog, *and* the class of the object you pass to setData implements DialogContextListener, it will automatically be registered as a listener and will receive events, for as long as it is the data value for this dialog. Craig Regards Mario This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
RE: How configure DialogContextListener?
Thanks, but there is no way to configure a listener statically (for example using a configuration file)? I need to configure the same listener for each dialog started, but I understand that both solution need to be done by the programmer. Mario -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: 25 maggio 2007 19.03 To: user@shale.apache.org Subject: Re: How configure DialogContextListener? On 5/25/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, how can i configure a DialogContextListener? Two different ways: (1) Get access to the DialogContext instance for the currently active dialog, then call addDialogContextListener() on it, passing the instance of your listener. This is the usual JavaBeans pattern for registering event listeners. (2) If you are using the getData/setData methods to save state information for your dialog, *and* the class of the object you pass to setData implements DialogContextListener, it will automatically be registered as a listener and will receive events, for as long as it is the data value for this dialog. Craig Regards Mario This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
Re: How configure DialogContextListener?
On 5/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks, but there is no way to configure a listener statically (for example using a configuration file)? I need to configure the same listener for each dialog started, but I understand that both solution need to be done by the programmer. At the moment, there is no mechanism to declaratively register a listener. That would make a useful RFE if you wanted to file an issue for it. Craig Mario -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: 25 maggio 2007 19.03 To: user@shale.apache.org Subject: Re: How configure DialogContextListener? On 5/25/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, how can i configure a DialogContextListener? Two different ways: (1) Get access to the DialogContext instance for the currently active dialog, then call addDialogContextListener() on it, passing the instance of your listener. This is the usual JavaBeans pattern for registering event listeners. (2) If you are using the getData/setData methods to save state information for your dialog, *and* the class of the object you pass to setData implements DialogContextListener, it will automatically be registered as a listener and will receive events, for as long as it is the data value for this dialog. Craig Regards Mario This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
How configure DialogContextListener?
Hi, how can i configure a DialogContextListener? Regards Mario This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
Re: How configure DialogContextListener?
On 5/25/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, how can i configure a DialogContextListener? Two different ways: (1) Get access to the DialogContext instance for the currently active dialog, then call addDialogContextListener() on it, passing the instance of your listener. This is the usual JavaBeans pattern for registering event listeners. (2) If you are using the getData/setData methods to save state information for your dialog, *and* the class of the object you pass to setData implements DialogContextListener, it will automatically be registered as a listener and will receive events, for as long as it is the data value for this dialog. Craig Regards Mario This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.