1 reply Latest Post - ‏2012-11-26T22:12:43Z by mburati
7 Posts

Pinned topic Partial Page Refresh override until dijit.dialog prompts user

‏2012-11-19T14:05:10Z |
I have a situation where I have some delete links on a page and when the delete link is clicked, the item is removed from the list but it doesn't give the user a prompt or anything asking them if they are sure if they want to delete it. I am currently using the Partial Page refresh when the links are removed so the page doesn't jump to the very top.

So I modified the process so that when the page loads, I am getting the Web Experience Factory href and the onclick events out of the link and storing it into an array. I am replacing the function on the link with my own custom javascript function that will then prompt the user with a dijit.dialog whether they want to delete or not while keeping the partial page refresh.

Basically the code that I am using to process the delete action is below when the user select yes from the dijit dialog

//set the form action
dojo.query("").attr("action", '/some/Href/Action/From/Array');

//get a handle on the form that is being submitted
var _f = document.getElementById('wpf_reload_region_0confRegviewsconfRegSessionsAdminEntry_Default_Default13b18f3aa462b6_1');

//execute the same onclick method that was put on the page using WEF.
wpf_pprV701201106101909.submit(_f, , wpf_pprV701201106101909.smartRefreshHandler, {execScripts:true, eventPfx: \" confRegviewsconfRegSessionsAdminEntry_Default_Default13b18f3aa462b6Ajax \"});
I know I should not be referencing the "wpf_pprV701201106101909.submit" directly as it looks like it is based on some versioning of the current version of WEF I am using. And it appears that the next time I upgrade portlet factory, my code would be hosed.

Do you have any suggestions as to how I can dynamically get a handle on the "wpf_pprV701201106101909" or is there a different builder that I can use to get the same result to the end user where I can use the partial page refresh and prompt them before the user processes the action?

Any help or suggestions will be greatly appreciated.


Nate D.
Updated on 2012-11-26T22:12:43Z at 2012-11-26T22:12:43Z by mburati
  • mburati
    2542 Posts

    Re: Partial Page Refresh override until dijit.dialog prompts user

    ‏2012-11-26T22:12:43Z  in response to nate_duncan
    You're right to be concerned about referencing a versioned internal object name like that - it will change on fixpack updates, APAR fixes etc, in addition to release version upgrades.

    Rather than moving the onclick, maybe try something like prefixing it with a JS confirm()?

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