0

i have a javascript function that must delete an item from a cart and it's work well, i have a command button in which there is a render already and i want that my javascript function reREnder a section in my visualforce page.

This is my action

      <apex:pageBlockSectionItem >
                    <apex:actionFunction name="remove" action="{!remove}" />
                    <apex:actionFunction name="renderABC"  reRender="try"/>  
     </apex:pageBlockSectionItem>

this is my pageblock that i want to rerender: <apex:pageBlockSection columns="1" id="try" >

this is my javascript function:

function updateCart() { 
var remove = window.confirm("Do you want to delete all");
if (remove){        
alert ('i'am deleting... ');
remove();
renderABC();
return remove;`
  }
}

i tried with only one apex actionFunction but it doesnt work the same, there is somethings that i am not taking in serious consideration?

Thanks in advance.

  • have u tried puttting that section in outputPanel and then rerender it from action function? – Pranay Jaiswal Dec 21 '16 at 16:13
  • Yes, but it's seem not working yet – Amiga 500 Dec 21 '16 at 16:14
  • can you post full code? – Pranay Jaiswal Dec 21 '16 at 16:23
  • yes, code about controller or visualforce page? – Amiga 500 Dec 21 '16 at 16:29
  • all would help us solve better – Pranay Jaiswal Dec 21 '16 at 16:31
1

I would suggest using a single function to do this:

function updateCart() { 
var remove = window.confirm("Do you want to delete all");
if (remove){        
remove();
return remove;`
  }
}

then

<apex:pageBlockSectionItem >
                    <apex:actionFunction name="remove" action="{!remove}" rerender="try"/>

     </apex:pageBlockSectionItem>
  • with only one it explode in one generic visualforce error page – Amiga 500 Dec 21 '16 at 17:07
  • @Amiga500 - then something else is going on because this is the way it should – Eric Dec 21 '16 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.