8 Replies Latest reply on Jul 5, 2013 7:02 AM by thetrickster888

    Add broker details to a real estate in a web app

    noelvranckx

      Hi,

       

      I've created a webapp to create a real estate listing. Each of these listings belong to a real estate broker. A broker can have multiple listings. To avoid that we need to add the broker details again for each listing I was wondering if I could combine multiple data sets.

       

      1. Setup a broker

      2. Setup a listing and add to a broker in order to add the broker details available on the listing view.

       

      Any idea if this is possible in some way?

       

      Many thanks,

       

      Noël

        • 1. Re: Add broker details to a real estate in a web app
          thetrickster888 Level 4

          Yes. You just need two web apps.  One for the listings and the other for Brokers.  Create them both and add some sample data to them.  Then, simply goto your Listings web app and add a new field called "Brokers".  Choose the data field type as "Data Source" and choose your Brokers Web App.

           

          Now, when you add new Listings web app items there will be a field called "Brokers" that you can associate that listing with.

           

          There is a hiccup, though.  I'm pretty sure BC only lets you associate one external web app item for a data source field.  You can't associate multiple broker web app items to a single Listings web app item.  You'll have to repeat the process of adding fields above and just add as many Broker fields (ie- Broker1, Broker2, Broker3} to your listings web app and for each field choose Data Source as the field type and click your brokers web app to source from that app.

           

          In your listings detail layout, you'll have to add multiple broker tags to show all the brokers.  If there are no brokers selected I just think nothing gets output from that tag.

           

          Give it a shot.

          • 2. Re: Add broker details to a real estate in a web app
            noelvranckx Level 1

            Hi, Many thanks for your reply ! It solves partialy my problem... I'm not there yet but still it puts me already in the good direction. Thanks again for your input. Realy appriciated !

            • 3. Re: Add broker details to a real estate in a web app
              cedric@bc-experts.com Level 1

              Just a follow up question - Would it be possible to display the fields from that brokers webapp? lets say we have Broker Name, Broker location, Broker mobile number.. Can we display these items on the Listings webapp, if so, how?

               

              Thanks!

              • 4. Re: Add broker details to a real estate in a web app
                thetrickster888 Level 4

                Not without some Ajax.  The datasource tag you use in your layout will display a link to that external web app item.  You can use jQuery's .ajax() method or the .get() method to grab a certain DIV from the URL of the linked datasource and populate a DIV on your current web app item. It's a little tough to do and you need to make sure it's working with Internet Explorer since IE sometimes bugs out with ajax requests but it's possible.

                • 5. Re: Add broker details to a real estate in a web app
                  cedric@bc-experts.com Level 1

                  Hi, actually I figured this out and it was very simple let me share it here so anyone who wants to have this kind of info show on their listing will get an idea

                   

                  1. Create listing webapp

                  2. Create members webapp

                  3. Create datasource field on listing webapp to connect to members webapp

                  3. Create layout for listing (list,detailed)

                  4. Create layout for members (list)

                  5. On layout for listing (where you will display members/broker details) insert a new webapp module e.g. {module_webapps,123,i,{tag_datasource_id}}

                   

                  This will then call the list layout of the members webapp created based from the ID of the datasource chosen.

                  • 6. Re: Add broker details to a real estate in a web app
                    thetrickster888 Level 4

                    Very smart workaround... now that you mention this I think I remember seeing someone do this on the forum.  I'm starting to collect forum posts like this in a Github Gist.  I'll add this forum link too.  Feel free to add a comment on my gist of other important workaround forum threads or other BC resources for advanced functionality to my gist:

                     

                    https://gist.github.com/thetrickster/5913679

                    • 7. Re: Add broker details to a real estate in a web app
                      Liam Dilley Adobe Community Professional & MVP

                      You actaully do not need to ajax anything since the data source tag id is the id of the web app item of which will render inside a module

                      It is not a workaround thetrickster, its native code so its the best option which has been around for some time now with the tag, but moreover there are lots of modules which have allowed/allows you to do this and more
                      Try do it native first, do a lot more then you realise.

                      • 8. Re: Add broker details to a real estate in a web app
                        thetrickster888 Level 4

                        Yea I had a brain malfunction. BC has conditioned me to think about

                        javascript solutions first! I've noted this solution and will try to

                        remember it.