Topic
7 replies Latest Post - ‏2013-04-23T13:08:22Z by mburati
SystemAdmin
SystemAdmin
9029 Posts
ACCEPTED ANSWER

Pinned topic Issues with Cooperative Portlets and OnPage load

‏2012-11-30T14:10:56Z |
HI,
we have two portlets one is list portlet which has some links, other is results portlets.
we have a onPage load event action in list portlet....in this we are reading values from the URL and performing some action and showing the results...these results are links...if we click on the link a cooperative source event will fire and results portlet on the same page gets the value and based on the value displays the results.

here the problem is for the link(for which the action is Co operative source action), if we select post action behavior as "almost reload the top most page", page is reloading and results portlet displaying the results properly but the the list portlet which has onPageLoad event trying to get the values from the URL and this time they are not there so the links list is empty,
if we choose smart refresh or other links list in the first portlet stays but...second portlet is getting the velue from the Co operative Source event but it's not refreshing the latest results...

could any one has solution fro this,,
Thanks,
Saikiran V
Updated on 2012-12-05T21:11:10Z at 2012-12-05T21:11:10Z by mburati
  • mburati
    mburati
    2400 Posts
    ACCEPTED ANSWER

    Re: Issues with Cooperative Portlets and OnPage load

    ‏2012-11-30T14:37:31Z  in response to SystemAdmin
    Thank you for describing your use case and scenario well - that helps.
    Unfortunately, in this case, even more detail would help, including the version of WEF and especially the version of WebSphere Portal (8.0? 7.0.0.2? 7.0? 6.1.5?).

    Typically Cooperative Portlet Source Link makes the link for you and thus you don't typically need to specify whether it should reload the outermost page or a specific location like a WEF action Link. It sounds like you're taking something that's already a link and then turning it into a Cooperative Portlet link, which could be confusing the mechanism a little?

    In a Portal 6.1.5, 7.0, 7.0.0.2 or 8.0 "Server Side Aggregation" based page, portal typically needs to refresh the whole portal page to have two portlets update for a wired event. In Portal 7.0 "Client Side Aggregation" in the page builder theme (specific to the 7.0.0.x CSA support, which I do not believe is ther in the 8.0 theme) a pair of wired portlets can be refreshed without the whole page being refreshed, but that's a less typical case, which is why I'm asking which version of portal and portal page type you're using so we can understand which of the various mechanisms may be involved here.

    If you're on a server side aggregation page and need to send a property broker / wired based event then the whole portal page is likely going to be refreshed when you send that event. If you have state (eg, the params) in the first portlet that you'd like to hang on to when that happens (which you may want to do anyway in case the user or something else on the page accidentally refreshes the portal page) then you can save those in a WEF Variable(s). Then a request handler in the first portlet could look for the url params first and if there use them and if not use the ones last saved in your state variable(s).

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
    • dkukreja
      dkukreja
      1 Post
      ACCEPTED ANSWER

      Re: Issues with Cooperative Portlets and OnPage load

      ‏2012-11-30T16:31:09Z  in response to mburati
      Thanks for the reply ..

      We are using WEF8 and Portal 8 .
      If we use state variable , what will be the scope of these variables?

      We want the user to work on multiple listings at one. So, it is possible that the same page is open in multiple tabs with different value of the param for each tab.
      • mburati
        mburati
        2400 Posts
        ACCEPTED ANSWER

        Re: Issues with Cooperative Portlets and OnPage load

        ‏2012-12-05T21:07:34Z  in response to dkukreja
        Daljeet,
        For a shared variable it would be shared for that portlet (and other portlets in the same WAR) across those tabs, so you're correct that might not be a good option for your particular use case.

        ..Mike Burati
        http://www-10.lotus.com/ldd/pfwiki.nsf/
        The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
    • SystemAdmin
      SystemAdmin
      9029 Posts
      ACCEPTED ANSWER

      Re: Issues with Cooperative Portlets and OnPage load

      ‏2012-11-30T16:39:17Z  in response to mburati
      the links are normal links(using link builder)...for this link action i am calling a method...
      in the method im firing Cooperative Source event

      public static void formFEBLink(WebAppAccess webAppAccess, String appId, String formId, String entryId, String state){
      String selectedAppUrl="";

      //generating url using inputs
      webAppAccess.getVariables().setString("selectedAppURL", selectedAppUrl);
      webAppAccess.callMethod("pb286Action_appLinkSourceAction");
      }

      Thanks,
      Saikiran V
      • mburati
        mburati
        2400 Posts
        ACCEPTED ANSWER

        Re: Issues with Cooperative Portlets and OnPage load

        ‏2012-12-05T21:11:10Z  in response to SystemAdmin
        If you need to send an event from portlet 1 to portlet 2 and want portlet 2 to refresh itself without portlet 1 refreshing itself or the portal page, then using WEF event(s) instead of Cooperative Portlet events might help.

        For example, assuming the portlets are on the same portal page, portlet 1 could send a server side event that calls an action in portlet 2 and uses smart refresh so that it doesn't refresh itself and then that could be a combined server/client event such that the client event would be sent at the end of the server event. Portlet 2 could be listening for the client event and then update its page when it received that client (Javascript) event.

        There are portlet communication samples in the WEF Wiki (which include client event) and I believe the Rich Web UI samples on the WEF Wiki may also show use of combined WEF server/client side events:
        http://www-10.lotus.com/ldd/pfwiki.nsf/dx/Web_Expereince_Factory_Samples_Categorized

        I hope that info helps,
        ..Mike Burati
        http://www-10.lotus.com/ldd/pfwiki.nsf/
        The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
        • BSR9_manish_kumar
          BSR9_manish_kumar
          8 Posts
          ACCEPTED ANSWER

          Re: Implementing a servlet in Portlet Factory

          ‏2013-04-23T11:44:19Z  in response to mburati

          Hi Micheal ,

          I need to implement a captcha servlet in WEF .As a java application it is running fine .I have put a Img tag and on that image tag through URL

          It is calling the servlet and it is rendering the image at that span.In portlet factory i don't know how should i implement the servlet  .

          Please help me on this if u can share  a sample that will be really helpful.

           

          Thanks In Advance

           

          Manish

          • mburati
            mburati
            2400 Posts
            ACCEPTED ANSWER

            Re: Implementing a servlet in Portlet Factory

            ‏2013-04-23T13:08:22Z  in response to BSR9_manish_kumar

            This really should be a new discussion topic, rather than a new unrelated question at the bottom of the cooperative portlet discusison topic, if you want more people to find it / possibly answer it.

            I don't know of any WEF captcha samples myself.   If this is for login to portal, then there may be a sample somewhere on how to integrate captcha with portal login (and I know I've seen one somewhere on devworks for integrating captcha with WebSeal).

            One option, instead of a servlet, may be to use the Content Launch builder and implement the code in a WEF :LJO, instead of adding a new servlet to your WAR/project.

            If you must add a servlet, then you should be able to add a servlet via the deployment descriptor extension mechanism.   Look in your project's WebContent/WEB-INF/bin/deployment/extensions folder.  The subfolders in there allow you to add extension fragments (eg, a servlet) to the various types of deployment descriptors.    There should be a readme file in each with info about how to do that.

            I hope that info helps,
            ..Mike Burati
            http://www-10.lotus.com/ldd/pfwiki.nsf/
            The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.