[JBoss Seam] - Proper back buttoning again...
by Zerg-Spirit
Hey,
I currently have a problem regarding the back buttoning.
Basically, I have a page to translate messages (as a matter of fact, it's my messages stored in database for my ResourceBundles).
A message owns a list of expression, each representing a translation for the message for a given Language.
The page displays a message and all its translations, and then the user push the next button to go to the next message, or the previous to come back to the previous one.
I first had the problem that when a user was using the browser's back button, and translated some expression for the displayed message, it was actually fetching the change for the previously displayed message, as for the application the state hasn't changed.
I then used jPDL page flow, defining a simple rule to avoid wrong states. Time for some code:
The page-flow:
<pageflow-definition name="auto-translate">
|
| <start-page name="TranslateItem" view-id="/admin/TranslateItem.xhtml">
| <redirect/>
| <transition name="next" to="TranslateItem">
| <action expression="#{autoTranslator.next()}" />
| </transition>
| <transition name="previous" to="TranslateItem">
| <action expression="#{autoTranslator.previous()}" />
| </transition>
| </start-page>
|
| </pageflow-definition>
As stated, it's very simple. I have only one page, and 2 cases possible: previous and next. Those are working perfectly though.
I added the little thingy to activate the back-button according to Seam Documentation. This is the code I think that might be wrong:
<page view-id="/admin/TranslateItem.xhtml" back="enabled">
| <redirect/>
| <transition to="/admin/TranslateItem.xhtml"/>
| <transition name="previous" to="previous"/>
| </page>
I'm not sure what I should put at the last line (transition name= ...).
Basically, at the moment, when a user clicks on the back button, the application sends him back to the page before the conversation was started. So there's no more wrong states in the application, but the back-button is actually not enabled at all, since I thought the user might be able to come back to a previous state with this back button according to the Seam documentation (= to the previous message in my case).
Thanks for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102154#4102154
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102154
18 years, 6 months
[JBoss Seam] - Is TestNG more convenient then JUnit?
by dmitriy.lapko
I have some doubts that TestNG is more convenient then JUnit, the main is - pour support of Eclipse IMHO. Please, correct me, if I'm wrong, but you cannot run one test method in a test class without writing xml for this test. Actually, if you want to run any test with TestNG, you have to write XML for it... I don't think that is convenient, don't you? It is really annoying - we are using annotations and at the same time we have to write xmls, what a hell...
I understand, why Seam team uses TestNG - it contains some useful annotations like @BeforeClass and so on. But for real using day-by-day it is so boredom to copy xml files, rename them, edit their contents by copy-and-paste 3 times. For EACH test!
I use last version of TestNG plugin for eclipse 5.7.0.0. It still has ugly bugs, like disappearing Run as TestNG for classes, so you have to run test clicking right button on xml.
Am I alone who is unsatisfied with TestNG plugin? Are there other plugins?
Because I don't see a lot of activities in TestNG development group and disappointed by comparison of JUnit and TestNG Eclipse support.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102153#4102153
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102153
18 years, 6 months