Topic
  • 4 replies
  • Latest Post - ‏2013-11-25T14:25:07Z by mburati
kcibmer
kcibmer
73 Posts

Pinned topic How to cause PortletB to load a different page when PortletA does?

‏2013-11-25T11:52:44Z |

Greetings.  I have two portlets on the same page; both use DSUI.  When OrdersSummary goes to its update page, I want OrdersDetail to load a blank page. 

Using the DSUI-provided button, OrdersDetail will not load the blank page.  So, I made my own button in the DSUI to load the Update Page, and set its post-load behavior to "reload the top-most page".  This works in that it does cause OrdersDetail to load a blank page, BUT I don't know just what to call using this button in order to duplicate the behavior of the built-in button.

I have it set to call DSUIToUpdateUsingSelectedRow, which seemed to me to be the perfect method.  However, I don't know what to pass it, and the resulting update page doesn't show the data of the selected row.  I tried passing the whole row from the LoopVar, and also just the ORDER_ID, but with no joy.

My sample models are attached; they use the OrdersServiceProvider from the Building Models feature set.

Attachments

  • mburati
    mburati
    2575 Posts

    Re: How to cause PortletB to load a different page when PortletA does?

    ‏2013-11-25T13:19:30Z  

    Darren,

    I haven't had time to look at your models yet, but here's a quick initial thought on it...

    First, whenever I've seen DSUI used across two portlets, the source portlet typically is focussed on the list/paging/sorting use case and the target portlet does the details, update and delete.    To have the details in the target and update in the source seems a little confusing from a use case pov to me, so I'd suggest double checking whether you really want to do it that way before spending too much time on it.

    Back to your original question,  try enabling the DSUI generated button you want (and disabling yours) and then (a) selecting the right-arrow on the DSUI builder in the builder call outline list, then the page you want in the WebApp tree on the right, then the source view of that page and look at what it generated there and (b) right-click inspect element on that button in FF/FB or Chrome to see that it's going to do (you can see the method it's going to call and the arguments its trying to send from there).

     

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • kcibmer
    kcibmer
    73 Posts

    Re: How to cause PortletB to load a different page when PortletA does?

    ‏2013-11-25T14:05:01Z  
    • mburati
    • ‏2013-11-25T13:19:30Z

    Darren,

    I haven't had time to look at your models yet, but here's a quick initial thought on it...

    First, whenever I've seen DSUI used across two portlets, the source portlet typically is focussed on the list/paging/sorting use case and the target portlet does the details, update and delete.    To have the details in the target and update in the source seems a little confusing from a use case pov to me, so I'd suggest double checking whether you really want to do it that way before spending too much time on it.

    Back to your original question,  try enabling the DSUI generated button you want (and disabling yours) and then (a) selecting the right-arrow on the DSUI builder in the builder call outline list, then the page you want in the WebApp tree on the right, then the source view of that page and look at what it generated there and (b) right-click inspect element on that button in FF/FB or Chrome to see that it's going to do (you can see the method it's going to call and the arguments its trying to send from there).

     

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

    Hi, Mike.  Yeah, I wondered if someone would ask about this use case.  Actually, there is the Summary portlet and then two other portlets on this page which display DIFFERENT information about the selected item in the Summary.  So when I choose to edit the row in the summary, I don't want to confuse the user by having the other two portlets show details about a different item.

    Example:  The Summary shows five rows of customer data.  The user clicks on a link in row 1 and the two detail portlets show all the accounts that customer has, and the recent calls the customer has made to the call center.  (These details are made using completely different providers than what I have in the summary).

    Now I want to update the customer data in row 2 (not row 1), so I click its Edit button.  I don't want the two other portlets still showing details for the customer in row 1 -- I want them showing a blank page instead, so I was hoping to fire an event on the OnPageLoad of the update page in the summary portlet.  This event does get fired and consumed by the two other portlets, but they don't show an update -- because I cannot tell the DSUI-generated Edit button to "load top-most page".

    So I mocked up an example which uses a DSUI and has the behavior I'm describing.  It's not my precise use case, but it shows what I'm trying to do and I hope someone can tell me how to get that done.

    I will take a look at the generated code.  And I'm wondering if there's a writeup which describes the artifacts created by DSUI and how to use them.

  • kcibmer
    kcibmer
    73 Posts

    Re: How to cause PortletB to load a different page when PortletA does?

    ‏2013-11-25T14:17:45Z  
    • mburati
    • ‏2013-11-25T13:19:30Z

    Darren,

    I haven't had time to look at your models yet, but here's a quick initial thought on it...

    First, whenever I've seen DSUI used across two portlets, the source portlet typically is focussed on the list/paging/sorting use case and the target portlet does the details, update and delete.    To have the details in the target and update in the source seems a little confusing from a use case pov to me, so I'd suggest double checking whether you really want to do it that way before spending too much time on it.

    Back to your original question,  try enabling the DSUI generated button you want (and disabling yours) and then (a) selecting the right-arrow on the DSUI builder in the builder call outline list, then the page you want in the WebApp tree on the right, then the source view of that page and look at what it generated there and (b) right-click inspect element on that button in FF/FB or Chrome to see that it's going to do (you can see the method it's going to call and the arguments its trying to send from there).

     

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

    Ok, here's my quick update.  When I use the DSUI-generated edit button, it calls a method called OrdersSummaryDSUIUpdateFromListPage and passes the ORDER_ID (I can see this from Firebug).

    This method does not exist if I do not enable the generated button.  Also, this method is not visible in the chooser, but if I paste it in to the Action field of my button, and pass in the ORDER_ID from the LoopVar, it works.  Is calling a valid-yet-not-visible method supported?

    I now have the DSUI-generated button in the UI, so I used a Visibility Setter to hide it. (I first used a Data Column Modifier to do so but the DSUI gave a warning that it couldn't find the element.  It still worked, but I didn't want to see that warning in the DSUI builder.)

    Attached is my modified Summary portlet.  I'm now going to try to fold this in to my real portlets and see how it goes.  Thanks for the tip on discovering what the generated code actually calls.

    Attachments

  • mburati
    mburati
    2575 Posts

    Re: How to cause PortletB to load a different page when PortletA does?

    ‏2013-11-25T14:25:07Z  
    • kcibmer
    • ‏2013-11-25T14:17:45Z

    Ok, here's my quick update.  When I use the DSUI-generated edit button, it calls a method called OrdersSummaryDSUIUpdateFromListPage and passes the ORDER_ID (I can see this from Firebug).

    This method does not exist if I do not enable the generated button.  Also, this method is not visible in the chooser, but if I paste it in to the Action field of my button, and pass in the ORDER_ID from the LoopVar, it works.  Is calling a valid-yet-not-visible method supported?

    I now have the DSUI-generated button in the UI, so I used a Visibility Setter to hide it. (I first used a Data Column Modifier to do so but the DSUI gave a warning that it couldn't find the element.  It still worked, but I didn't want to see that warning in the DSUI builder.)

    Attached is my modified Summary portlet.  I'm now going to try to fold this in to my real portlets and see how it goes.  Thanks for the tip on discovering what the generated code actually calls.

    Darren,

    Some methods show up if you click "Show More" and some are hidden intentionally when they're intended more for internal use and not necessarily for use by other builders.    In the Eclipse -> Windows -> Preferences -> Web Experience Factory  preferences there's a checkbox to show hidden elements, to help advanced users see more what's being generated by builders (hidden by default to try to avoid confusing new users).    I'll check whether that particular DSUI Update From List Page should've been hidden in the first place - its possible that ones in a gray area and should be moved to the not-hidden-by-default side of the fence.

    As for your previous question, I don't know of anything documenting all the internal methods and controls that DSUI generates other than the builder inputs doc.    It's often better in the long run to teach people how to find what builders generate in the WebApp Tree View and Page Source view in the designer and in the generated JSPs and code, so they'll really understand it before modifying what's generated by the builder, than to give a list of generated items and hope people understand it before they start changing things.

     

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.