You need to sign in to do that
Don't have an account?
Pundareekam Kudikala
Unable to reRender using CommandButton
Here is my code below.
<apex:page sidebar="false" controller="SightingsValidatorController" tabStyle="Sightings_Validator__tab">
<apex:sectionHeader title="{!TEXT($User.Validation_Specialization__c)}" subtitle="Sightings Validation" />
<apex:form >
<apex:pageBlock title="Details for {!detailSighting.Species__r.Name} by {!detailSighting.CreatedBy.Name}" id="sightingDetails" rendered="{!detailsRenderFlag}" >
<apex:pageBlockSection collapsible="false">
<apex:panelGrid >
<apex:panelGrid columns="2">
Validation Status <apex:inputField value="{!detailSighting.Validation_Status__c}"/>
</apex:panelGrid>
<apex:panelGrid columns="1">
Comment:<apex:inputTextarea cols="47" rows="8"/>
</apex:panelGrid>
</apex:panelGrid>
<apex:map width="500px" height="200px" mapType="satellite" zoomLevel="3" id="themap">
<apex:mapMarker position="{!detailSighting.Location__Latitude__s},{!detailSighting.Location__Longitude__s}"/>
</apex:map>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock title="Overview">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!reset}" value="Reset"/>
</apex:pageBlockButtons>
<apex:pageBlockSection collapsible="false" columns="1" >
<apex:pageBlockTable value="{!Sightings}" var="a" id="sightings" rows="5">
<apex:column headerValue="Date" >
<apex:outputLink value="/{!a.Id}">
<apex:outputText value="{0,date,long}">
<apex:param value="{!a.Date__c}" />
</apex:outputText>
</apex:outputLink>
</apex:column>
<apex:column headerValue="Species Name">
<apex:outputText value="{!a.Species__r.Name}" style="{!if(a.Species__r.Rarity__c='Very Rare', 'color:red;font-weight:bold;', if(a.Species__r.Rarity__c='Rare','color:red;',''))}"></apex:outputText>
</apex:column>
<apex:column headerValue="Seen By" value="{!a.CreatedBy.Name}"/>
<apex:column headerValue="Show Details">
<apex:image value="{!$Resource.GoogleMapsIcon}" />
<apex:actionSupport event="onclick" action="{!ShowDetails}" reRender="sightingDetails">
<apex:param name="PARAM1" value="{!a.Id}" assignTo="{!selectedRowId}"/>
</apex:actionSupport>
</apex:column>
<apex:column value="{!a.Validation_Status__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
<apex:pageBlockSection columns="3" >
<apex:outputText ></apex:outputText>
<apex:outputPanel >
<apex:commandButton value="First" action="{!setCon.first}" disabled="{!!setCon.hasPrevious}">
</apex:commandButton>
<apex:commandButton value="Previous" action="{!setCon.previous}" disabled="{!!setCon.hasPrevious}" title="Previous" />
<apex:outputText >Page {!setCon.pageNumber} of {!TotalPageNumbers} </apex:outputText>
<apex:commandButton value="Next" action="{!setCon.next}" disabled="{!!setCon.hasNext}" title="Next">
</apex:commandButton>
<apex:commandButton value="Last" action="{!setCon.last}" disabled="{!!setCon.hasNext}" title="Last" />
</apex:outputPanel>
<apex:outputText ></apex:outputText>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
I want to rerender sightingDetails of pageblock. When i put reRender attribute in CommandButtons hilighted, my command buttons are not working. I am using standardset controller
<apex:page sidebar="false" controller="SightingsValidatorController" tabStyle="Sightings_Validator__tab">
<apex:sectionHeader title="{!TEXT($User.Validation_Specialization__c)}" subtitle="Sightings Validation" />
<apex:form >
<apex:pageBlock title="Details for {!detailSighting.Species__r.Name} by {!detailSighting.CreatedBy.Name}" id="sightingDetails" rendered="{!detailsRenderFlag}" >
<apex:pageBlockSection collapsible="false">
<apex:panelGrid >
<apex:panelGrid columns="2">
Validation Status <apex:inputField value="{!detailSighting.Validation_Status__c}"/>
</apex:panelGrid>
<apex:panelGrid columns="1">
Comment:<apex:inputTextarea cols="47" rows="8"/>
</apex:panelGrid>
</apex:panelGrid>
<apex:map width="500px" height="200px" mapType="satellite" zoomLevel="3" id="themap">
<apex:mapMarker position="{!detailSighting.Location__Latitude__s},{!detailSighting.Location__Longitude__s}"/>
</apex:map>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock title="Overview">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!reset}" value="Reset"/>
</apex:pageBlockButtons>
<apex:pageBlockSection collapsible="false" columns="1" >
<apex:pageBlockTable value="{!Sightings}" var="a" id="sightings" rows="5">
<apex:column headerValue="Date" >
<apex:outputLink value="/{!a.Id}">
<apex:outputText value="{0,date,long}">
<apex:param value="{!a.Date__c}" />
</apex:outputText>
</apex:outputLink>
</apex:column>
<apex:column headerValue="Species Name">
<apex:outputText value="{!a.Species__r.Name}" style="{!if(a.Species__r.Rarity__c='Very Rare', 'color:red;font-weight:bold;', if(a.Species__r.Rarity__c='Rare','color:red;',''))}"></apex:outputText>
</apex:column>
<apex:column headerValue="Seen By" value="{!a.CreatedBy.Name}"/>
<apex:column headerValue="Show Details">
<apex:image value="{!$Resource.GoogleMapsIcon}" />
<apex:actionSupport event="onclick" action="{!ShowDetails}" reRender="sightingDetails">
<apex:param name="PARAM1" value="{!a.Id}" assignTo="{!selectedRowId}"/>
</apex:actionSupport>
</apex:column>
<apex:column value="{!a.Validation_Status__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
<apex:pageBlockSection columns="3" >
<apex:outputText ></apex:outputText>
<apex:outputPanel >
<apex:commandButton value="First" action="{!setCon.first}" disabled="{!!setCon.hasPrevious}">
</apex:commandButton>
<apex:commandButton value="Previous" action="{!setCon.previous}" disabled="{!!setCon.hasPrevious}" title="Previous" />
<apex:outputText >Page {!setCon.pageNumber} of {!TotalPageNumbers} </apex:outputText>
<apex:commandButton value="Next" action="{!setCon.next}" disabled="{!!setCon.hasNext}" title="Next">
</apex:commandButton>
<apex:commandButton value="Last" action="{!setCon.last}" disabled="{!!setCon.hasNext}" title="Last" />
</apex:outputPanel>
<apex:outputText ></apex:outputText>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
I want to rerender sightingDetails of pageblock. When i put reRender attribute in CommandButtons hilighted, my command buttons are not working. I am using standardset controller
Try this Pundareekam Kudikala,