IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 4 replies
  • Latest Post - ‏2013-01-29T23:43:15Z by SystemAdmin
SystemAdmin
SystemAdmin
9029 Posts

Pinned topic Partial page refresh help needed

‏2013-01-29T00:26:26Z |
Hi,
I require help on partial page refresh. I have a page A. In that page A I have one inserted page B. In page B I have a data page. I want to do a parial refresh of data in data page. Please provide me a sample code or please correct my approach in the attached model. I am refreshing the span which contains that inserted page in the button builder post-action behavior, but outer page is also getting refreshed. Please let me know if any input is needed from attached code clarification point of view.

Thanks,
Neel
Updated on 2013-01-29T23:43:15Z at 2013-01-29T23:43:15Z by SystemAdmin
  • mburati
    mburati
    2554 Posts

    Re: Partial page refresh help needed

    ‏2013-01-29T03:39:26Z  
    The model you attached is referencing a service provider that was not attached, so I wasn't able to run it, but I see a couple of things that do not look quite correct:

    - The main page has 4 begin/open span tags, but 5 end/close span tags, so the html is not well formed. Try removing the 5th end span tag.

    - The button says to refresh the refreshWrapper on the main page, but the action it is calling is only executing the searchPage (which is an inner included page), so the partial page refresh code is likely looking for the refreshWrapper in the response to match up with the refreshWrapper in the browser page and not finding it because you're only executing the inner page. Try dispatching the whole page so that the refreshWrapper will be there in the returned html that the PPR Javascript will look for to merge in with the existing page and refreshWrapper already in the browser.

    - In general, Smart Refresh should help enough in WEF701 and later that you shouldn't typically need to use explicit PPR with named page locations, but rather just use the default post page refresh and let it refresh the portlet or contained model or page as needed.

    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.
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Partial page refresh help needed

    ‏2013-01-29T18:49:19Z  
    • mburati
    • ‏2013-01-29T03:39:26Z
    The model you attached is referencing a service provider that was not attached, so I wasn't able to run it, but I see a couple of things that do not look quite correct:

    - The main page has 4 begin/open span tags, but 5 end/close span tags, so the html is not well formed. Try removing the 5th end span tag.

    - The button says to refresh the refreshWrapper on the main page, but the action it is calling is only executing the searchPage (which is an inner included page), so the partial page refresh code is likely looking for the refreshWrapper in the response to match up with the refreshWrapper in the browser page and not finding it because you're only executing the inner page. Try dispatching the whole page so that the refreshWrapper will be there in the returned html that the PPR Javascript will look for to merge in with the existing page and refreshWrapper already in the browser.

    - In general, Smart Refresh should help enough in WEF701 and later that you shouldn't typically need to use explicit PPR with named page locations, but rather just use the default post page refresh and let it refresh the portlet or contained model or page as needed.

    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.
    Hi Mike,
    Thanks for your quick response. I attached the zip file which contains all artifacts including provider and consumer. Please import it to run. I want to rectify my errors and clear this concept. Seek your help.

    Thanks a ton,
    Neel
  • mburati
    mburati
    2554 Posts

    Re: Partial page refresh help needed

    ‏2013-01-29T21:59:50Z  
    Hi Mike,
    Thanks for your quick response. I attached the zip file which contains all artifacts including provider and consumer. Please import it to run. I want to rectify my errors and clear this concept. Seek your help.

    Thanks a ton,
    Neel
    As the second bullet in my previous response suggested, your Button is telling it to refresh the refreshWrapper portion of the main page, but the action it's calling was not returning the main page (so there was not refreshWrapper in the response for it to refresh the browser page with). Change your getData action to process pageMain instead of the inserted pageSearch and see if that helps. It looks like it worked for me with your models otherwise unchanged after making that one change to the action list.

    Note, to verify the main page is not refreshing in the browser (as opposed to watching closely for flicker) you can add JSP code to the page above the refreshWrapper that looks like this:

    
    <%=System.currentTimeMillis()%>
    


    If the browser is not updating that portion of the outer page, then the number produced by that JSP should not change when it refreshes the inner portion of the page.

    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.
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Partial page refresh help needed

    ‏2013-01-29T23:43:15Z  
    • mburati
    • ‏2013-01-29T21:59:50Z
    As the second bullet in my previous response suggested, your Button is telling it to refresh the refreshWrapper portion of the main page, but the action it's calling was not returning the main page (so there was not refreshWrapper in the response for it to refresh the browser page with). Change your getData action to process pageMain instead of the inserted pageSearch and see if that helps. It looks like it worked for me with your models otherwise unchanged after making that one change to the action list.

    Note, to verify the main page is not refreshing in the browser (as opposed to watching closely for flicker) you can add JSP code to the page above the refreshWrapper that looks like this:

    <pre class="jive-pre"> <%=System.currentTimeMillis()%> </pre>

    If the browser is not updating that portion of the outer page, then the number produced by that JSP should not change when it refreshes the inner portion of the page.

    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.
    It worked..Thank you Mike