0

I have the following piece of code.

<apex:commandButton action="{!AuthorModel.saveAuthorList}" id="saveButton" value="Save"  rerender="pageblocktableid"/>

My requirement is that I want to refresh the entire page if x field is not null. If x field is null then only pageblocktableid is rendered.(Because otherwise the error message is not being displayed as I had to write return null) Is this possible to do so?

  • 1
    where is the piece of the code? – Nitin Jan 21 '16 at 8:18
  • 1
    @Rimii by code that was mean all page code. Basic idea would be to try formula in rerender like rerender="{!IF(ISNULL(X),'pageblocktableid','allpage')} " – kurunve Jan 21 '16 at 8:31
0

You can use two command buttons and use rendered attribute to display one at a time. One will rerender pageblock and other will refresh the page:

<apex:commandButton action="{!AuthorModel.saveAuthorList}" id="saveButton" value="Save"  rendered="{!IF(ISNULL(x),false,true)}" rerender="pageblocktableid"/>


<apex:commandButton action="{!AuthorModel.saveAuthorList}" id="saveButton" value="Save" rendered="{!IF(ISNULL(x),true,false)}"  />
| improve this answer | |

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.