10 Replies Latest reply on Nov 1, 2006 4:05 PM by antispart

    Booking Example EL #{hotelBooking.selectHotel(hot)} not work

    antispart

      Hi,

      I tried following the hotel booking example (nightly) to create a table with paging. I get an facelets EL evaluation error with the following though:
      <s:link value="Select" action="#{visitManager.selectPlayer(player)}"/>

      The example source has:
      <s:link value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>

      The error is:
      com.sun.facelets.tag.TagAttributeException: /players/list.xhtml @61,84 action="#{visitManager.selectPlayer(player)}" Error Parsing: #{visitManager.selectPlayer(player)}

      Which is actually what I'd expect. Unless Seam adds a new way of parsing the EL?

      Note: I read on an unrelated post earlier on this forum to add the following to my faces-config.xml so I did =):


      ....
      <el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>


      Thanks!

        • 1. Re: Booking Example EL #{hotelBooking.selectHotel(hot)} not
          gavin.king

          Yes, Seam extends JSF-EL.

          What is your environment (JBoss? JSF? Facelets? JSP?), and what version of Seam do you use?

          • 2. Re: Booking Example EL #{hotelBooking.selectHotel(hot)} not
            antispart

            Gavin,

            JSF RI 1.2.03
            Facelets 1.1.11
            JBoss AS 4.0.5
            JBoss Seam-1.1.0.BETA1

            Also, I noticed that the bookings example has:

            <a:support event="onkeyup" actionListener="#{hotelSearch.find}" reRender="searchResults" />

            but, the HotelSearching interface only has:
            public String find();

            but wouldn't the actionListener call find with an ActionEvent argument as well, and therefore need the following to be exposed as well:
            public String find(ActionEvent event);

            Thanks again.

            ------------

            faces-config.xml:


            <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
            ....
            <el-resolver>org.jboss.seam.jsf.SeamELResolver</el-resolver>


            I copied much of the bookings example web.xml too.

            • 3. Re: Booking Example EL #{hotelBooking.selectHotel(hot)} not
              pmuir

              I think Gavin made it possible to call actionListeners with no parameters

              • 4. Re: Booking Example EL #{hotelBooking.selectHotel(hot)} not
                antispart

                 

                "petemuir" wrote:
                I think Gavin made it possible to call actionListeners with no parameters


                Hmm, so it sounds like I'm missing something or mis-configured then. Any ideas what that could be?

                Everything else seems to be working (remoting, bijection,etc).

                • 5. Re: Booking Example EL #{hotelBooking.selectHotel(hot)} not
                  pmuir

                  huh?

                  I was explaining why this

                  "antispart" wrote:
                  but wouldn't the actionListener call find with an ActionEvent argument as well, and therefore need the following to be exposed as well:
                  public String find(ActionEvent event);


                  worked :)

                  • 6. Re: Booking Example EL #{hotelBooking.selectHotel(hot)} not
                    antispart

                    What I mean, is I have something similar and I get a 'no method found' error because it's looking for find(ActionEvent) instead of find(). Which, given what you mentioned earlier, sounds like there's something wrong on my end. Just not sure what that is...

                    • 7. Re: Booking Example EL #{hotelBooking.selectHotel(hot)} not
                      monkeyden

                      This sounds a lot like the valueChangeListener problem I had the other day. It was trying to call a no-arg method, instead of creating the ValueChangeEvent and then calling the method. I built Seam from CVS at Gavin's suggestion and all better. May or may not work for you.

                      • 8. Re: Booking Example EL #{hotelBooking.selectHotel(hot)} not
                        antispart

                         

                        "monkeyden" wrote:
                        This sounds a lot like the valueChangeListener problem I had the other day. It was trying to call a no-arg method, instead of creating the ValueChangeEvent and then calling the method. I built Seam from CVS at Gavin's suggestion and all better. May or may not work for you.


                        Just installed the nightly from Oct 31.

                        I'm still experiencing the following problems:

                        1)

                        <a:support event="onkeyup" actionListener="#{registrationManager.find}" reRender="searchResults" />

                        causes:
                        Caused by: javax.faces.el.MethodNotFoundException: /players/list.xhtml @27,106 actionListener="#{registrationManager.find}": Method not found: RegistrationManagementBean:5c4o147-mikzas-eu06jpfn-1-eu06lfng-a.find(javax.faces.event.ActionEvent)

                        unless I create a method find(ActionEvent).

                        2)
                        <s:link value="Select" action="#{visitManager.selectPlayer(player)}"/>

                        causes:
                        com.sun.facelets.tag.TagAttributeException: /players/list.xhtml @61,84 action="#{visitManager.selectPlayer(player)}" Error Parsing: #{visitManager.selectPlayer(player)}

                        Both, seem like they may be related? Any help would be greatly appreciated.

                        • 9. Re: Booking Example EL #{hotelBooking.selectHotel(hot)} not
                          gavin.king

                          Again, this is another extension Seam makes to JSF. It lets you have value changed listeners that don't take ValueChangeEvent.

                          So, as described in the "EL enhancements" chapter, if you want to use this functionality, you need to use

                          org.jboss.seam.ui.facelet.SeamFaceletViewHandler
                          as your view handler.


                          • 10. Re: Booking Example EL #{hotelBooking.selectHotel(hot)} not
                            antispart

                            Thanks Gavin, that solved both issues.