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?

2
  • 1
    where is the piece of the code?
    – Nitin
    Jan 21, 2016 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, 2016 at 8:31

1 Answer 1

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)}"  />

You must log in to answer this question.

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