[JBoss Seam] - Re: Submit form and open results in new window
by supernovasoftware.com
I use something like the following to hide the browser menus.
| <input id="index"
| onclick="javascript:openNewWindow('/start.xhtml','appwin','status=yes,resizable=yes,toolbar=no,scrollbars=yes' + winCenterCoordinates(1024,768));window.opener=null;window.close();"
| type="submit"
| value="Enter" />
|
Javascript
| function openNewWindow(URLtoOpen, windowName, windowFeatures) {
| newWindow = window.open(URLtoOpen, windowName, windowFeatures);
| }
|
| function winCenterCoordinates(w, h) {
| LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
| TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
| position = ',top = ' +TopPosition + ',left = ' +LeftPosition + ',height = ' +h + ',width = ' +w;
| return position;
| }
|
Does anyone have any advice on opening then widow or not based on an Ajax request.
Currently I have a login form. This works normally. After successful login, the user is taken to a page with the button shown above. Here they click this button and a new window opens with the browser menus hidden.
I would prefer to give them a validation error if it fails and then open an new browser widow only if it is successful.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112122#4112122
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112122
18 years, 4 months
[JBoss Seam] - Invoking seam component from Non-seam environment
by ramkavipriya
Hi,
In my application,I am having a bean which implements @Asynchronous method,gets invoked by the caller (a seam component).
In the bean which implements @Asynchronous method,I need to send email notifications.
For this I am using seam mail support (<m:message>).
I am using some heler bean with setter and getter values and basically these values are used in .xhtml page.
During running,the Asynchronous method gets called and in the helper bean the values are set.
But I am getting the exception something like
javax.faces.FacesException: Missing final '@domain' ().
When I debugged it,this is happening because the bean values are null as the FacesContext is new.
How to resolve this issue?
My email code looks like below.
public void sendMailBySeamAPI(String key,String value,MailBean mb){
Renderer renderer = (Renderer)Component.getInstance("renderer");
mb.setEmail(key);
setEmail(key);
setName(value);
mb.setName(value);
String pageName = "/secure/responseEmail.xhtml";
try {
log.debug("In send mail page.."+pageName);
renderer.render(pageName);
} catch (Exception e) {
log.debug("Error send mail", e);
}
}
Using Seam 1.2.1 and my application runs in tomcat ejb micro container.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112117#4112117
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112117
18 years, 4 months
[JBoss Seam] - Identity.loggedIn and Session expiring
by b.reeve
Hello !
| 1. Is there a way we can map identity.loggedIn to a method to keep checking against some criteria. For eg: If I want to redirect the user to login page when the session expires, can I configure identity.loggedIn = loginBean.sessionExpired.
|
| 2. Or, I found in the forum that an event can be raised for sessionExpired. But then how do I redirect the user to myLogin page on this event.
|
| | <event type="org.jboss.seam.sessionExpired">
| | <action execute="#{redirect.toSomeViewID}"/>
| | </event>
| |
|
| 3. Also if I do
|
| | <page view-id="*" action="#{loginBean.sessionExpired}">
| | <navigation>
| | <rule if="login">
| | <redirect view-id="/index.xhtml" />
| | </rule>
| | </navigation>
| | </page>
| |
| what happens when sessionExpired method returns null
|
| Any help would be appreciated.
|
| Thanks !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112115#4112115
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112115
18 years, 4 months
[EJB 3.0] - Recommended testing framework
by adam.conroy
Hi, I have spent the past 2 days implementing Cactus into my JBOSS 4.2.2 server with EJB 3.0 only to find, after much struggling, that it does not support (easily) JBOSS4x nor does it support EJB 3.0, nor even Ant 1.7.
I've done quite a bit of research that is (hopefully) non-exhaustive. The options I've found to test with are:
Cactus
Seam (looks like it uses Cactus, though, is it beefed up for 1.5?)
J2EEUnit (dead project)
JBOSS Embedded
My question is: what is the recommended way to test EJB3's? Ideally, from within a container, though not necessary.
I'm coming from a Tomcat+Spring+Struts background where we just instantiated the Spring context and let the IoC do its thing and just not commit transactions in integration tests.
Is there a comparable strategy in a JBOSS4 project? This is a mature product that I am working on so any drastic/large framework changes are out of the question.
Thank you,
Adam Conroy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112113#4112113
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112113
18 years, 4 months