1 2 Previous Next 17 Replies Latest reply on Mar 16, 2010 12:50 AM by bsgcic Go to original post
      • 15. Re: Using new matchingEntityConverter class. Getting java.lang.ClassCastException
        bsgcic

        Hi Alexander,


        That is great news that the @Scope(CONVERSATION) helped you. So, you were able to get the matchngEntityConverter class working? I still have not tried that again yet due to being swamped with other things but am curious to know how that went for you. I may want to try using that again later on.


        In regards to the error you mentioned:


        org.jboss.seam.Entity$NotEntityException with message:


        "Not an entity class: java.util.ArrayList"


        I am not sure about that one. I vaguely recall that I may have removed @DataModel from the definition of private List<MyOption> myOptionsList; in the MyOptionListAction class due to an error with having the @DataModel there.


        I am not sure if the @Factory is a must or not. I also vaguely recall issues when I tried commenting it out.


        I may not be completely understanding the following question: "separated the list for options to the UseOfMyOptionsListAction instead of inplace definition of vclForchosenMyOptions?".


        In terms of :


        <h:selectManyListbox id="theSelectManyCheckboxlistId"
         value="#{useOfMyOptionsList.chosenMyOptions}"
         valueChangeListener="#{useOfMyOptionsList.vclForchosenMyOptions}"
        >
        



        My implementation certainly may not be the best or most efficient way. Initially, I did not have the valueChangeListener part. I added that after so that I could trigger a method upon change of the selectManyListbox by the user. Actually, when doing so,  useOfMyOptionsList.chosenMyOptions was not being assigned the new value when the method was run and therefore the first statement of vclForchosenMyOptions is:


        setChosenMyOptions((List<MyOption>) valueChangeEvent.getNewValue());
        



        By doing this, I can use the value of chosenMyOptions right away in the method. I suppose, it may in fact be redundant to also have the


        value="#{useOfMyOptionsList.chosenMyOptions}"
        



        part also but I have not tried it without that part.


        When I first got the s:convertEntity to work via the initial way (i.e., using components.xml), I literally cried out in joy, hugged my family, and took them to DisneyLand! It was so tough and such a long struggle to get that to actually work. Then when I got the 2nd way to work, I fealt happy that I finally was getting some trackion in bettering my understanding of Seam.


        Jeff

        • 16. Re: Using new matchingEntityConverter class. Getting java.lang.ClassCastException
          dendroid66

          Hello Jeff,


          Just wanted to thank you again because your answers inspired me to achieve my objective and to find an appropriate solution.
          Now I move on to the new task.


          So, finally, I didn't give up EntityHome/EntityQuery framework and it works just as needed:


          - Factory is not a necessary thing to get converter (built-in) works
          - @Scope(CONVERSATION) is a MUST for a entity query component
          - dynamic list is defined at the EntityHome of a dependent entity (using @Datamodel annotation - I didn't check if it is mandatory)
          - more than one converter for different persistence units has been used (it works,but I didn't mix them at one page)


          Have a good day!

          • 17. Re: Using new matchingEntityConverter class. Getting java.lang.ClassCastException
            bsgcic

            Hello Alexander,


            Sounds very good. Your insight is also helpful.


            Have a nice day!


            Jeff

            1 2 Previous Next