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.

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

1 Answer 1

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>
2
  • with only one it explode in one generic visualforce error page
    – Amiga 500
    Dec 21, 2016 at 17:07
  • @Amiga500 - then something else is going on because this is the way it should
    – Eric
    Dec 21, 2016 at 17:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .