5 Replies Latest reply on Feb 4, 2011 12:27 PM by coenos

    Seam 2.1.2 problem with rich:tabPanel in XXXEdit.xhtml

    ahmadadly

      Hi, I used Seam 2.1.1.GA and post some topics on it. From 2 days ago, I have downloaded Seam 2.1.2 and Create a sample project to see what is new in it, and should we migrate to it or no.
      But I faced a problem with one-to-many relations in Edit page. My scenario is:
      I have Organization entity with relation many-to-one with OrganizationType and Industry entities



      OrganizationType --------------< Organization >-------------- Industry

      When I generated the entities using seam-gen tool, I got in OrganizationEdit.xhtml rich:tabPanel with 2 tabs





      <rich:tab label="Organization type *" labelClass="required">
      .....
          <s:button id="#{organizationHome.instance.organizationType != null ? 'changeParent' : 'selectParent'}" value="#{organizationHome.instance.organizationType != null ? 'Change' : 'Select'} organizationType" view="/OrganizationTypeList.xhtml">
              <f:param name="from" value="OrganizationEdit"\>
          </s:button>
      ......
      </rich:tab\>



      and


      <rich:tab label="Industry *" labelClass="required">
      .....
          <s:button id="#{organizationHome.instance.industry != null ? 'changeParent' : 'selectParent'}" value="#{organizationHome.instance.industry != null ? 'Change' : 'Select'} industry"
                             view="/IndustryList.xhtml">
              <f:param name="from" value="OrganizationEdit"/>
          </s:button>
      ......
      </rich:tab\>



      This causes runtime error with that message




      java.lang.IllegalStateException: duplicate Id for a component changeParent

      It sounds like a bug in seam-gen template, am I right? can any one help?


      Thanks in advance.

        • 1. Re: Seam 2.1.2 problem with rich:tabPanel in XXXEdit.xhtml
          lvdberg

          Sounds like a problem but to be honest we only use Seam-gen to give the project a first go, In most cases we need to work with an as-is database and mapping the sometimes masterpieces of DB-design take most of the time. Having a basic set of accesspages is great, but just the start.


          Probably changing the switch-type of the tabs to ajax will solve the problem, because in that case the tab's content is not rendered, hence no id-conflict will occur.


          Until now we've upgraded whenever the requiremsnts ask for it (because of additional functionality or bug fixes in newer versions).


          JIRA ?


          Leo





           

          • 2. Re: Seam 2.1.2 problem with rich:tabPanel in XXXEdit.xhtml
            ahmadadly

            I agree with you about Seam-gen to give the project a first go.


            About changing switch-type, it is already ajax switching but this didn't fix the problem.



            <rich:tabPanel switchType="ajax">



            In fact I added a quick fix to it by modifying the template edit.xhtml.ftl
            to be



            <#assign parentIdName = parentPojo.shortName?cap_first>
            <s:button id="${'#'}{${homeName}.instance.${property.name} != null ? 'change${parentIdName}Parent' : 'select${parentIdName}Parent'}"



            instead of


            <s:button id="${'#'}{${homeName}.instance.${property.name} != null ? 'changeParent' : 'selectParent'}"



            Finally, I think creating a JIRA ticket may be nice so far or just fixing it by the same way that I did, but I am wondering about specifying ID property of <s:button>, while Seam 2.1.1.GA without this specifying.


            Thanks for your support :)


            • 3. Re: Seam 2.1.2 problem with rich:tabPanel in XXXEdit.xhtml

              thanks! that helped me fixing the same problem immediately (but I only fixed the generated class, not the generation template as you explain).


              The problem still kexists in seam 2.2 - Isn't  that an issue to be reported in an issue tracker so it can be fixed in the seam distribution?
              Or is it already fixed in later versions?

              • 4. Re: Seam 2.1.2 problem with rich:tabPanel in XXXEdit.xhtml

                it's already reported in jira, but not yet solved: https://jira.jboss.org/jira/browse/JBSEAM-4273

                • 5. Re: Seam 2.1.2 problem with rich:tabPanel in XXXEdit.xhtml
                  coenos

                  Hi,


                  it's still not solved in Seam 2.2.1.Final which I am using now. The workaround does not work anymore either, instead of using parentIdName, you need to use parentName




                  <s:button id="${'#'}{${homeName}.instance.${property.name} != null ? 'change${parentName}Parent' : 'select${parentName}Parent'}"



                  Cheers,
                  Coenos