1 2 Previous Next 25 Replies Latest reply on Feb 3, 2007 7:23 PM by pmuir Go to original post
      • 15. Re: selectItems exception
        damatrix

        Hi,
        I took the dreaded path of writing my own converter for my entity and guess what? That doesn't work as well. I mean the selectOneMenu does get populated with the entities alright, but after selecting one and clicking save h:commandButton my action method doesn't get called, with no exception or message. However my action method does get called if i change to an s:button, though the outjected object returns with null fields.

        May i ask how different an s:button is from an h:commandButton apart from being able to pass method parameters in the former?

        Anyway i want to try your most recent suggestion but i don't know how to configure my project to make use of the source files directly. I'm using NetBeans 5.5 if that's any help. Really wanna try something just to get this problem solved. Thanx for the patience.

        • 16. Re: selectItems exception
          damatrix

          Ignore that last post. Somehow there was an error on my page so i thought u didn't get the previous message. I'll get cracking on what u suggested. Thanx.

          • 17. Re: selectItems exception
            pmuir

            I'm not really sure what you're after here. The difference between s:button and h:commandButton has been explained above. I'm not asking to package the source in your project - just to debug the code at the method specified above - and this isn't the appropriate place to discuss debugging using Netbeans as an IDE (and I know nothing about Netbeans).

            If you can debug the call to BasicEntityConverter.getAsObject and tell me whether it is called or not, and if it is, whether it completes, and if not, at what line it fails I can help more. Alternatively get together a simple test case (this means no more code than absolutely necessary to show the problem, a working build.xml and details of what libraries I need to include) and mail it to me.

            • 18. Re: selectItems exception
              pmuir

              Good luck :)

              • 19. Re: selectItems exception
                damatrix

                Sorry aba the last post. i just didn't realise that this topic had gone on to 2 pages long.

                i'm creating a small project to debug the BasicEntityConverter.getAsObject. Howeverl, i checked the source package and i found a tld and some other configuration files along with the source. am i supposed to include them directly uder my web-inf folder to be able to debug it?

                • 20. Re: selectItems exception
                  pmuir

                  No

                  Just include the jar as normal but make the source available to your ide so you can debug it.

                  • 21. Re: selectItems exception
                    damatrix

                    Hi,

                    I was able to debug the source for BasicEntityConverter. However i only saw a getIdAsObject not getAsObject (i take it urs was a typo).

                    Anyway, i set breakpoints at all the catch clauses as well as at the end where the id and class are returned. It does get called, and no exception was thrown, returning at the end of the method as it should with the id of the entity and its class/type.

                    Could the fact that the object in the selectOneMenu has a OneToMany relationship with the object it is being associated be any part of this problem?

                    Let me know what u think.

                    • 22. Re: selectItems exception
                      pmuir

                      Post the WHOLE of the facelet (and any templates) you are displaying in.

                      • 23. Re: selectItems exception
                        damatrix

                        Ok, here we go then

                        
                        <!-- <?xml version="1.0" encoding="UTF-8"?> -->
                        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                        <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                         xmlns:ui="http://java.sun.com/jsf/facelets"
                         xmlns:h="http://java.sun.com/jsf/html"
                         xmlns:f="http://java.sun.com/jsf/core"
                         xmlns:s="http://jboss.com/products/seam/taglib"
                         xmlns:a="https://ajax4jsf.dev.java.net/ajax"
                         xmlns:si="http://jboss.com/products/seam/selectitems/taglib"
                         template="../templates/marketingLayout.xhtml">
                        
                        
                         <ui:define name="title">TradeWinds - New stand</ui:define>
                        
                         <ui:define name="sidebar">
                         <p>
                         This the stand configuration panel.
                         </p>
                         </ui:define>
                         <ui:define name="links">
                         <p>
                         <h3> Click Save to persist your changes or Cancel to return</h3>
                         </p>
                         </ui:define>
                         <ui:define name="content">
                         <h:form id="standNewForm">
                         <fieldset>
                         <s:validateAll>
                         <div class="entry">
                         <div class="label"><h:outputLabel for="code" value="Code"/></div>
                         <div class="input">
                         <s:decorate>
                         <h:inputText id="code" value="#{standManger.objectTitle}">
                         <a:support event="onblur" actionListener="#{standManager.checkTitle}" reRender="titleErrors"/>
                         </h:inputText>
                         <br/>
                         <a:outputPanel id="titleErrors"><h:outputText value="#{standManager.message}" rendered="#{standManager.message != null}"/></a:outputPanel>
                         </s:decorate>
                         </div>
                         </div>
                         <div class="entry">
                         <div class="label"><h:outputLabel for="description" value="Description"/></div>
                         <div class="input">
                         <h:inputText id="description" value="#{stand.description}"/>
                         <br/>
                         </div>
                         </div>
                         <div class="entry">
                         <div class="label"><h:outputLabel for="pavilion" value="Pavilion "/></div>
                         <div class="input">
                         <h:selectOneMenu id="pavilion" value="#{stand.pavilion}" required="true">
                         <si:selectItems value="#{pavilionList}" var="pav" label="#{pav.title}"/>
                         </h:selectOneMenu>
                         <br/>
                         </div>
                         </div>
                         <div class="entry">
                         <div class="label"><h:outputLabel for="type" value="Stand type"/></div>
                         <div class="input">
                         <h:selectOneMenu id="type" value="#{stand.standType}" required="true">
                         <si:selectItems value="#{standTypeList}" var="type" label="#{type.title}"/>
                         </h:selectOneMenu>
                         <br/>
                         </div>
                         </div>
                         </s:validateAll>
                        
                         <div class="entry errors">
                         <h:messages globalOnly="true"/>
                         </div>
                        
                         <div class="entry">
                         <div class="label"> </div>
                        
                         <div class="input">
                         <h:commandButton id="save" action="#{standManager.saveObject}" value="Save"/>
                        
                         <h:commandButton id="cancel" immediate="true" action="#{standManager.cancel}" value="Cancel"/>
                         </div>
                         </div>
                         </fieldset>
                         </h:form>
                        
                         </ui:define>
                        </ui:composition>
                        
                        


                        the template it references is as ff:

                        <!-- <?xml version="1.0" encoding="UTF-8"?> -->
                        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                        <html xmlns="http://www.w3.org/1999/xhtml"
                         xmlns:ui="http://java.sun.com/jsf/facelets"
                         xmlns:h="http://java.sun.com/jsf/html"
                         xmlns:f="http://java.sun.com/jsf/core">
                         <head>
                         <title><ui:insert name="title">GTFC - TradeWinds</ui:insert></title>
                         <link rel="stylesheet" type="text/css" href="../../css/styles.css"/>
                         </head>
                         <body>
                         <div id="document">
                         <div id="container">
                         <div id="sidebar">
                         <ui:insert name="sidebar" >
                         <ui:include src="marketingSidebar.xhtml"/>
                         </ui:insert>
                         </div>
                        
                         <div id="content">
                         <script language="JavaScript" src="../../js/datePicker.js"/>
                        
                         <div class="section">
                         <ui:insert name="links" >
                         <ui:include src="marketingLinks.xhtml"/>
                         </ui:insert>
                         <br/>
                         <br/>
                         <ui:insert name="content">
                         <ui:include src="content.xhtml"/>
                         </ui:insert>
                         </div>
                         </div>
                         </div>
                         <div id="footer">
                         <ui:insert name="footer">
                         <ui:include src="footer.xhtml"/>
                         </ui:insert>
                         </div>
                         </div>
                         </body>
                        </html>
                        
                        
                        


                        Hope it helps.

                        • 24. Re: selectItems exception
                          damatrix

                          Hi,
                          I've been able to put together a small demonstration of the problem i'm facing that you can run yourselt to see (you suggested this somewhere along the line). Can i have your email address to send it to as i can't get it anywhere in the forum. mine is emorny@gmail.com.

                          thanx.

                          • 25. Re: selectItems exception
                            pmuir

                            Oops, I forgot to reply to you, Sorry!

                            In the code you posted you haven't got a messages component for the selectOneMenu - take the globalOnly of h:messages and check there aren't any errors.

                            I'll send you mail.

                            1 2 Previous Next