4 Replies Latest reply on Mar 14, 2013 5:01 AM by mostafa mahmoud

    create richfaces component

    mostafa mahmoud Newbie

      Hello

      I want to create component for user address

      so i can import this compenet in many XHTML pages inside my project

      I want to use the Address more than one time in the page

      I create compenet using approach of faclet custom tag.

       

      I face problem if put more than one my address tag in the same page.

       

      if there is solution of this problem or is there another way to create component klike my address input for Richfaces sp please reply

       

       


        • 1. Re: create richfaces component
          Michal Petrov Master

          Hi,

           

          it would help if you tell us what kind of problem you are facing, and if you could show us the code of your component as well.

          • 2. Re: create richfaces component
            mostafa mahmoud Newbie

            Hi Michal

            Many Thanks for ur reply

            I uploaded the description rar file with the question above "Address input problem (1).rar"

            please find it

            • 3. Re: create richfaces component
              Michal Petrov Master

              Okay, next time you might want to write the stuff down here on the forum.

               

              As for problem #1:

              - simply remove the inner '#{' and '}' and then use concat on the string

               

              oncomplete="#{rich:component(myDynamicPopupID.concat('_fixedStaticPopupPanelID'))}.show()
              

               

              Problem #2:

              I'm not quite sure what are yu trying to do

               

              <i4fteam:addressInput richMessagePlace="@right" selectedAddressObject="#{testCustomComponentBean.address1}"
                                            containerId="myPanelGridContainerID" addressInputId="idOfAddressInput_1_"/>
              

               

              you set the selectedAddressObject attribute, but what happens to it then? You are not using the value anywhere in the code of the component.

               

              If you're simple setting the value into the component Bean then when you use the component multiple times the value is rewritten with each new component. If that is the case add a listener to the <a4j:ajax> which will set the object to what you need.

               

              <a4j:ajax … listener="#{testCustomComponentBean.setObject(object)}" />
              

               

              also you're including the popup page multiple times, you probably don't want to do that.

              1 of 1 people found this helpful
              • 4. Re: create richfaces component
                mostafa mahmoud Newbie

                Many Thanks Michal

                your answer fix my errors