Announcement

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

    How to make unique URL for each tab in tabbed smartclient applications

    Dear SmartClient Team,

    I am developing web application using SmartClient, PHP and MySQL.
    I have designed the UI such that navigation menu (TreeGrid) is on left side and whatever item I clink on navigation menu, there opens a new tab in right side of page. To give you an example, its similar to Yahoo Mail UI.

    Now in this I want to have a unique URL/URI for each tab opened on right side, so that in case user logout, system can remember the opened tabs and can reopen the same tabs next time when user login. Similar to Firefox feature, when we use in multi tab in Firefox.

    I was looking at smartclient reference. In that similar functionality (unique URL for each tab) has been achieved. If I click a particular navigation menu on left side, there is always a unique URL for the tab opened in response, for instance below one:
    http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#object..ListGridRecord

    Can someone let me know how to achieve this with SmartClient. To be precise, I would like to understand, what does "#object..ListGridRecord" mean in above URL and how does server interprets it. Can I achieve it using PHP on server side?

    Please respond. I would appreciate help from every corner.

    Regards,
    Gaurav

    #2
    The functionality you want is provided by History class. The string after # in URL is History ID, you can use arbitrary IDs and store whatever information you want. Use History.registerCallback() to register a function that opens requested History ID (eg. tab name/ID) on URL change and use History.addHistoryEntry() to update the page URL when other tab is selected.

    In order to restore whole set of tabs you can send a list of tabs on logout to server and restore it on page load.

    Note: URL part after # is never sent to server.

    Comment


      #3
      Thanks for giving me some pointer. I will investigate more on History class.
      It would be nice if you can show me short some sample code to use it.

      Regards,
      Gaurav

      Comment

      Working...
      X