Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Second entry point?

    I need an external application to be able to interact to one of my listGrids in smartGWT and I am wondering how is the best way to do it.

    Should I create a second webapp for this? I would have to copy almost all components/logic only for using this listgrid.
    It would be better to use the same webapp I use, but with a "special" page instead of the main page defined in <entry-point class='zedes2.client.Zedes2' />

    Is it possible to create a second entry-point in this case?
    What would you recommend to do?

    Using smartgwt 4.1p Power.

    #2
    You need to be more specific about "interact".

    Comment


      #3
      In the most simple case, I need another window that opens a "special page", not the entry point defined for the main case.

      For example:
      localhost:8080/app ist the main case
      I want to open another window with one listGrid from my app, without opening the main page.
      I.e. a "second entry point" for this case.

      Comment


        #4
        Would a query param and a "If" work for you (and your security model, if present)?

        Comment


          #5
          Just to make it official - what Blama suggested (a URL param) is perfectly valid way of doing this.

          Another common way to handle this is creating a second GWT entrypoint via another .gwt.xml module, but for most cases, the fact that is roughly doubles compile time and makes the project more complicated is not worth it.

          Comment


            #6
            This is a related question so I'll go ahead and ask it in this thread.

            How about a use case where you want to craft a link for a user that will open up your SmartGWT application and then open up a specific form/record in the app.

            For example some kind of link like: yourapp.com/appname?productId=1234 Would load the full application, then load the 'Product form' for the product with the key of 1234. Is this possible and do you have a suggested way of implementing it?

            Comment


              #7
              We're not sure what the gist of the question is..

              Yes, you can pass a productId as a URL param and arrange that your application navigates directly to a particular screen and loads specific data.

              This means your new page loads the same resources as the main app, but they are cached, so this costs nothing.

              You should of course design your code so that, if the URL param is present, you create only the relevant components and load only the relevant data.

              Comment


                #8
                The use case is there is a separate GUI application not written in SmartGWT that holds some information. If the user would like to know more detailed information about a certain 'product' we would like to be able to link them to the SmartGWT application and have that specific 'product' open. We would still like the user to be able to view all other screens in the app, which it would be fine for us to load the whole app, then load the screen for the specific product. Does that make sense?

                Comment


                  #9
                  Saying a "separate GUI application" is way too vague. Are we talking a web application or something else? What technology?

                  One thing we can point to is the RestHandler (see QuickStart Guide), which allows any third-party application to access the same data services your SmartGWT GUI uses via a simple REST API.

                  Comment


                    #10
                    Sorry, for the vagueness, I didn't think the approach would differ. The separate app is written in Ruby on Rails, so that would be the first to achieve, but there could be other applications that would like a similar link in the future. Or for example, just a link in a MS Word document that could load the specific entity in the SmartGWT app.

                    We will consider exposing some of our data to other applications with the RestHandler in the future, but were wondering if it was feasible to provide links that would load specific entities within the application.

                    Comment


                      #11
                      Hi wolf,

                      without trying: This has to be possible as this is exactly what the showcase does. If you open a sample in the showcase, the URL changes (although it is only an anchor and not a query param here). When you c&p the link to another browser, the same sample opens after loading the page.

                      @Isomorphic: Is there some best practice for this available in the docs? Eg. when to use anchors and when query params? How is it best done?

                      Best regards,
                      Blama

                      Comment


                        #12
                        Thanks for pointing that out Blama. Yes, that is similar functionality to what I would like to achieve, but also pass in the key field to open the correct record.

                        Comment


                          #13
                          Changing an anchor does not navigate, changing a URL param does. So your question is tantamount to: do I want to navigate to a new page? That's something that can't be answered in general; it would take a deep dive into the specific application scenario to answer.

                          Comment


                            #14
                            If I'm understanding you correctly, in our scenario it would be fine for a user to click for example 'www.yourapp.com/appname?productId=1234' in an MS Word document, and that would open the browser (or a new tab/window of the browser if its already open) and load the application and specific record in a new page. We wouldn't be concerned if the user already had the app open in a different tab/window. Loading the whole app in a new tab would be fine for us. Maybe that's not what you were asking though.

                            Comment

                            Working...
                            X