[JBoss Seam] - captureCurrentView
by monkeyden
Having some trouble with captureCurrentView().
The use case is:
Actor is on any page within the application. Let's call it "Page A".
Actor clicks the "Sign Up" link
Actor is presented with the "Sign Up" page
Actor enters necessary info and selects "Submit"
Actor is brought to the "Sign Up Confirm" page, which displays a "Continue" button
Actor selects the continue button and is brought back to Page A.
I have an RegisterAction:
@Name("registerAction")
| @Scope(CONVERSATION)
| public class RegisterAction{
| @Begin
| public String begin(){
| redirect.captureCurrentView();
| return "signupPage";
| }
|
| public String register() {
| //create records
| ....
|
| //explicitly log the user in
| identity.setUsername(user.getUserName());
| identity.setPassword(user.getUserPassword());
| loginAction.login();
| result = "confirm";
| }
|
| @Create
| public void create(){
|
| }
|
| @End
| public String takeMeBack(){
| redirect.returnToCapturedView();
| return null;
| }
| }
I have a commandLInk which points to begin()
<ice:commandLink id="signUpLink" value="#{messages['personalizationBar.label.signUp']}" action="#{registerAction.begin}"></ice:commandLink>
And I have a commandButton on the Confirm page, which points to takeMeBack()
<ice:commandButton id="continueButton"
| image="images/btn_continue.gif"
| onmouseover="javascript:this.src='images/btn_continue_hover.gif'"
| onmouseout="javascript:this.src='images/btn_continue.gif'"
|
| action="#{registerAction.takeMeBack}"/>
|
I also have navigation rules in pages.xml
<page view-id="/userMaintenance/signup.xhtml">
| <navigation from-action="#{registerAction.register}">
| <rule if-outcome="confirm">
| <redirect view-id="/userMaintenance/signupConfirm.xhtml" />
| </rule>
| <rule if-outcome="failure">
| <redirect view-id="/userMaintenance/signup.xhtml" />
| </rule>
| </navigation>
| </page>
|
The problem is, it appears that Seam is redirecting to the captured view after the register() method, when I return "confirm", rather than when the "Continue" button calls takeMeBack(). I wouldn't expect Seam to do the redirect automatically ever, but if it did, I wouldn't expect it to happen until after @End is encountered.
Any clues? Am I misunderstanding how captureCurrentView works?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054490#4054490
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054490
18Â years, 11Â months
[JBoss Seam] - Re: Do file upload component support jpeg and png only?
by nhpvti
"shakenbrain" wrote : You can upload any kind of file with the file upload component.
Yes, I can upload any content and I can see binary data of the gif image in the database with contentType field set to image/gif
But the problem is that web browsers (e.g. IE7, Firefox 2.x, Opera 9.x) don't show uploaded gif images.
"shakenbrain" wrote :
| The seamspace example, however, accepts only certain types of image files. I believe it looks at the content-type of the uploaded file and rejects it when not one of the accepted types.
<s:fileUpload id="picture" data="#{register.picture}" accept="image/gif"
| contentType="#{register.pictureContentType}" />
But if you mean accept attribute, it was intended for file filtering by web browsers and is ignored.
http://htmlhelp.com/reference/html40/forms/input.html
anonymous wrote : The file input type creates a field through which users can upload files from their local computer or network. The VALUE attribute specifies the name of the initial file, but it is typically ignored by browsers as a security precaution. The ACCEPT attribute gives a comma-separated list of media types accepted, allowing the browser to filter out inappropriate files. Current browsers generally ignore the ACCEPT attribute.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054489#4054489
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054489
18Â years, 11Â months
[JBoss Seam] - Re: DataModel using Set does not work
by andreigh.ts
Thank you all for the answers.
Can you please help me out - There still are some problems and searching on the forum seemsto be bugs, but I am not sure. Can you please confirm.
Here are the problems:
1) Stateful component - Conversation scope; outjecting Set DataModel (defaulting to Conversation scope).
Problem - UI is not refreshed, even though the Factory method is called on the add event.
| @Stateful
| @Scope(ScopeType.CONVERSATION)
| @Name("requestWizardQuestions")
| public class RequestWizardQuestionsAction implements RequestWizardQuestions {
| ...
| @DataModel
| public Set<RfqRequestQuestion> requestQuestionsList;
|
| @DataModelSelection
| @Out(required=false)
| private RfqRequestQuestion selectedQuestion;
|
| @Factory("requestQuestionsList")
| public void initQuestionsList() {
| requestQuestionsList = rfqRequest.getRfqRequestQuestions());
| }
|
| public void addNewQuestion() {
| rfqRequest.getRfqRequestQuestions().add(new RfqRequestQuestion());
| initQuestionsList();
| }
| ...
| }
|
Replacing Set with List works.
Is this a bug signaled here: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=106232
?
2) Stateful component - Conversation scope; outjecting DataModel to PAGE scope.
Problem - The @DataModelSelection is null (seems not to be injected) after clicking the item in UI.
| @Stateful
| @Scope(ScopeType.CONVERSATION)
| @Name("requestWizardQuestions")
| public class RequestWizardQuestionsAction implements RequestWizardQuestions {
| ...
| @DataModel(scope=ScopeType.PAGE)
| public List<RfqRequestQuestion> requestQuestionsList;
|
| @DataModelSelection
| @Out(required=false)
| private RfqRequestQuestion selectedQuestion;
|
| @Factory("requestQuestionsList")
| public void initQuestionsList() {
| requestQuestionsList = new ArrayList<RfqRequestQuestion>(rfqRequest.getRfqRequestQuestions());
| }
|
| public void deleteQuestion() {
| rfqRequest.getRfqRequestQuestions().remove(selectedQuestion); entityManager.remove(selectedQuestion);
| }
|
| ...
| }
|
deleteQuestion is called when clicking an item in the List, but selectedQuestion is null.
Is this the bug posted here:
http://jira.jboss.com/jira/browse/JBSEAM-308
?
Am I doing something wrong, or are just 2 bugs?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054488#4054488
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054488
18Â years, 11Â months
[EJB 3.0] - JBoss EJB 3.0 TrailBlazer doesn't seem to work for me
by happytour
Greetings,
I'm starting using EJB 3 with JBoss 4.0.5GA and I deployed the EJB 3 TrailBlazer (EJBTrail.ear). I launced the browser and I went in the Message Driven Beans section. Here I pressed the "Try the message driven calculation" button, I accepted the default values in the Investment calculator windows and I pressed on the Calculate button. I got HTTP 500 saying "javax.naming.NameNotFoundException mdb not bound". This is true since I didn't deploy any queue named mdb. However, the same page is saying:
If the queue does not exist, the JBoss container automatically creates it at deploy time. There is no XML configuration file needed!
So I don't understand wether I have or not to explicitly deploy the queue.
Okay, I deployed the queue with the following service:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <server>
| <mbean code="org.jboss.mq.server.jmx.Queue"
| name="jboss.mq.destination:service=Queue,name=mdb">
| <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
| </mbean>
| </server>
|
After doing this, I got the following message in the console:
[mdb] Bound to JNDI name: queue/mdb
Now when I repeat the test and I click on the Calculate button, as described previously, I get the message:
Please wait a while, I am checking wether the message has arrived.
But the result is not displayed, meaning that the message didn't arrive. No error message is displayed in the server's console.
Could someone please explain how to get running this nice tutorial ?
Kind regards,
Nicolas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054485#4054485
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054485
18Â years, 11Â months