1 2 3 Previous Next 36 Replies Latest reply on Jun 21, 2006 5:02 AM by rsmithaa Go to original post
      • 15. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.

         

        "gavin.king@jboss.com" wrote:
        This is a bug. I will fix it.


        Thanks Gavin. Have a nice weekend.

        PS: @gengar: Could it be that you are a German? I saw a German word in one of your configs.

        • 16. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
          gavin.king

          OK, I am not able to figure out how to reproduce this. Please attach a runnable test case to reproduce this here:

          http://jira.jboss.com/jira/browse/JBSEAM-248

          • 17. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
            gengar

            Did anybody send Gavin a test case? If not, you (Gavin) need a example app, is it right?

            @Newlukai Yes, I'm from germany. If you want to know it exactly, Magdeburg ;-).

            • 18. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
              gavin.king

              Nope, I do not yet have any test.

              • 19. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.

                I'm still a trainee so I've to go to school this week. Because of that I can't send you a "real" testcase. All I can do is to build a whole JBoss environment at home and then to create a testcase out of my mind.
                Did you try the "@DataModel with Tomahawk" code from the wiki? If it's really a bug it should also occur with this code?!?
                At Monday I can send you a "real" testcase, i. e. my app.

                I'm not sure which misbehaviour we are talking about. Which one did Gavin call a bug: Is it my original post or do you mean that you have to use @DataModelSelection(value="getField") instead of @DataModelSelection(value="field")?

                @gengar: Greets from Saarbrücken.

                • 20. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.

                  I'm still a trainee so I've to go to school this week. Because of that I can't send you a "real" testcase. All I can do is to build a whole JBoss environment at home and then to create a testcase out of my mind.
                  Did you try the "@DataModel with Tomahawk" code from the wiki? If it's really a bug it should also occur with this code?!?
                  At Monday I can send you a "real" testcase, i. e. my app.

                  I'm not sure which misbehaviour we are talking about. Which one did Gavin call a bug: Is it my original post or do you mean that you have to use @DataModelSelection(value="getField") instead of @DataModelSelection(value="field")?

                  @gengar: Greets from Saarbrücken.

                  • 21. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.

                    Sorry for posting twice. The machines at school are very slow... Please delete it. Thanks.

                    • 22. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.

                      OK. Today I wanted to write a testacase but I saw tat Seam was updated so O tried the update. The problem seems to be solved.

                      • 23. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.

                        Hi,

                        the problem isn't solved. So I'm going to write a testcase. Any hints how such a testcase should look like?

                        • 24. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.

                          Where and how can I send you my modified messages example?

                          • 25. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.

                            The nasty thing about this problem is, that when I use the this workaround with the value attribute bijection doesn't work anymore.
                            The only way to deploy my app is to use the value attribute with the getter method (without get it doesn't work for me too). And when the app is deployed and I click an element in the dataTable, the selection isn't injected to the seam component. Whether in my app nor in the modified messages example.

                            So I would welcome a hint or a bugfix. And I've to ask again, where should I send or attach the test app?

                            • 26. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.

                              I've found another workaround: Just remove the @DataModelSelectionIndex annotation. Then you can remove the value attribute from the @DataModelSelection and injection works.

                              So there seems to be a problem when someone uses both annotations @DataModelSelection and @DataModelSelectionIndex.

                              • 27. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                                rsmithaa

                                Gavin,

                                I'm having the same issues as Newlukai, and as this person stated it appears somewhat random, but it related to the combination of @DataModelSelection, and @DataModelSelectionIndex.

                                Below you will find three fragment; simplified code, modified component.java from the seam project, and the logged output.

                                Please let me know if anything else would be helpful.

                                simplified ScheduleBean to show annotations

                                @Stateful
                                @Name("scheduleEditor")
                                @LoggedIn
                                @Interceptors(SeamInterceptor.class)

                                @PersistenceContext
                                private EntityManager em;

                                @In
                                private transient FacesContext facesContext;

                                @In
                                private transient Context sessionContext;

                                @In(required = true)
                                private Customer currentCustomer;

                                @DataModel
                                private List activityLogs;

                                @DataModelSelectionIndex
                                private int activityLogIndex;

                                @DataModelSelection
                                @Out(scope = ScopeType.CONVERSATION, required = false)
                                private ActivityLog activityLog;

                                @Create
                                public void initialize() {
                                }

                                @SuppressWarnings("unchecked")
                                @Factory("activityLogs")
                                public void find() {
                                }


                                @Destroy
                                @Remove
                                public void destroy() {
                                }

                                added log.info statements to component.java

                                for (Field field: selectionFields)
                                {
                                log.info("@DataModelSelection field: " + field.toString());
                                Annotation ann = dataModelSelectionFieldAnnotations.get(field);
                                log.info("@DataModelSelection ann: " + ann.toString());
                                String name = createUnwrapper(ann).getVariableName(ann);
                                log.info("@DataModelSelection name: " + name);
                                if ( name.length() == 0 )
                                {
                                if ( hasMultipleDataModels )
                                {
                                throw new IllegalStateException( "Missing value() for @DataModelSelection with multiple @DataModels" );
                                }
                                name = defaultDataModelName;
                                }
                                Field existing = dataModelSelectionFields.put( name, field );
                                if (existing!=null)
                                {
                                throw new IllegalStateException("Multiple @DataModelSelection fields for: " + name);
                                }
                                }

                                Logged results:
                                05:16:49,144 INFO [Component] Component: scheduleEditor, scope: CONVERSATION, type: STATEFUL_SESSION_BEAN, class: com.aftertherun.bean.schedule.ScheduleBean, JNDI: atrapp/ScheduleBean/local
                                05:16:49,144 INFO [Component] @DataModelSelection field: private int com.aftertherun.bean.schedule.ScheduleBean.activityLogIndex
                                05:16:49,144 INFO [Component] @DataModelSelection ann: @org.jboss.seam.annotations.datamodel.DataModelSelectionIndex(value=)
                                05:16:49,144 INFO [Component] @DataModelSelection name:
                                05:16:49,144 INFO [Component] @DataModelSelection field: private com.rocksolid.beans.ActivityLog com.aftertherun.bean.schedule.ScheduleBean.activityLog
                                05:16:49,144 INFO [Component] @DataModelSelection ann: @org.jboss.seam.annotations.datamodel.DataModelSelection(value=)
                                05:16:49,144 INFO [Component] @DataModelSelection name:
                                05:16:49,144 ERROR [[/]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
                                java.lang.IllegalStateException: Multiple @DataModelSelection fields for: activityLogs
                                at org.jboss.seam.Component.initMembers(Component.java:536)
                                at org.jboss.seam.Component.(Component.java:199)
                                at org.jboss.seam.Component.(Component.java:159)
                                at org.jboss.seam.Component.(Component.java:154)
                                at org.jboss.seam.Component.(Component.java:149)
                                at org.jboss.seam.init.Initialization.addComponent(Initialization.java:381)
                                at org.jboss.seam.init.Initialization.addComponents(Initialization.java:343)
                                at org.jboss.seam.init.Initialization.init(Initialization.java:195)
                                at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:32)

                                • 28. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                                  gavin.king

                                  Oh yes, this will not work anymore, after the stuff I did to generalize the databinding architecture (@DataModelSelection and @DataModelSelectionIndex are now no longer handled by special code). You can have one or the other, but you can't have both at the same time.

                                  If this is really a problem, add an issue to JIRA and I can see what I can do about it.

                                  • 29. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.

                                    Hmm. I can determine the selectionIndex for my own. But as Seam is a framework and those annotations are public they should work, even if I use both.
                                    Additionally I think that the @DataModelSelectionIndex delivers the index more efficiently than my workaround, which iterates the whole list searching the selected element. OK, I could go the other way letting Seam inject the index and then ask the list for the element at this position.

                                    In my opinion they should work together or this behavious should be documented at a place where everybody recognizes it to prevent posts like mine.