You need to sign in to do that
Don't have an account?
ankush
Unable to rerender div block
We have a radio button called employer not found and on click on that we are trying to display a div on the page using java script which is displaying properly.
But when custom validations fire the rerendering of the div block not happening. Can some one help us on this
Below is the code
Page.
<apex:selectRadio value="{!employerchange}" layout="pageDirection" id="employerchange"
onchange="Showdiv(this)">
<apex:selectOptions value="{!items3}" />
</apex:selectRadio>
<div id="empnotfound"
style="visibility: hidden; position: absolute;">
<apex:outputLabel style="color:#174689;font-size:18px;"
value="Employer Details" />
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer Name" />
<sup id="sup1">* </sup>
<apex:inputText id="empname" label="Employer Name"
value="{!empname}" html-placeholder=" Employer Name"
style="width:315px;margin-left:80px; {!empnamestyle}" required="false" />
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer current Position" />
<sup id="sup1">* </sup>
<apex:inputText id="currentpos" label="Current Position"
html-placeholder=" Current Position" value="{!empcurrentpos}"
style="width:315px;margin-left:7px; {!empcurposstyle}" required="false" />
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer street" />
<sup id="sup1">* </sup>
<apex:inputText required="false" id="empStreet" label="Street"
html-placeholder=" Street" value="{!empstreet}"
style="margin-left:80px;width:315px {!empstreetstyle}" />
<br />
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer city" />
<sup id="sup1">* </sup>
<apex:inputText required="false" id="empCity" label="City"
html-placeholder=" City" value="{!empcity}"
style="margin-left:95px;width:315px {!empcitystyle}" />
<br />
<div class="half-line">
<br />
</div>
<div>
<div style="display: inline-block">
<apex:outputLabel style="color:#3295ba;" value="Employer State/Province" />
<sup id="sup1">* </sup>
</div>
<div id="empstatetext"
style="display: inline-block; visibility: hidden; position: absolute;">
<apex:inputText id="empState" label="State" value="{!empstatetext}"
html-placeholder=" State/Province" style="margin-left:16px;width:315px {!empstatetextstyle}"
required="false" />
</div>
<div id="empstatelist"
style="display: inline-block; visibility: hidden; position: absolute; margin-left: 16px;">
<apex:selectList size="1" required="false" value="{!empstatelist}">
<apex:selectOptions value="{!items6}" />
</apex:selectList>
</div>
</div>
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer Country" />
<sup id="sup1">* </sup>
<apex:selectList size="1" required="false"
style="margin-left:63px;width:127px;" value="{!empcountry}"
onChange="empShowState(this)">
<apex:selectOptions value="{!items5}" />
</apex:selectList>
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer Zip/Postal Code" />
<sup id="sup1">* </sup>
<apex:inputText required="false" id="empZip" label="Zip"
html-placeholder=" Zip Code" value="{!empzip}"
style="margin-left:3px;width:315px {!empzipstyle}" />
<br />
<div class="half-line">
<br />
</div>
if(getrbtnvalue=='Employer not found')
{
document.getElementById('empnotfound').style.visibility='visible';
}
But when custom validations fire the rerendering of the div block not happening. Can some one help us on this
Below is the code
Page.
<apex:selectRadio value="{!employerchange}" layout="pageDirection" id="employerchange"
onchange="Showdiv(this)">
<apex:selectOptions value="{!items3}" />
</apex:selectRadio>
<div id="empnotfound"
style="visibility: hidden; position: absolute;">
<apex:outputLabel style="color:#174689;font-size:18px;"
value="Employer Details" />
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer Name" />
<sup id="sup1">* </sup>
<apex:inputText id="empname" label="Employer Name"
value="{!empname}" html-placeholder=" Employer Name"
style="width:315px;margin-left:80px; {!empnamestyle}" required="false" />
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer current Position" />
<sup id="sup1">* </sup>
<apex:inputText id="currentpos" label="Current Position"
html-placeholder=" Current Position" value="{!empcurrentpos}"
style="width:315px;margin-left:7px; {!empcurposstyle}" required="false" />
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer street" />
<sup id="sup1">* </sup>
<apex:inputText required="false" id="empStreet" label="Street"
html-placeholder=" Street" value="{!empstreet}"
style="margin-left:80px;width:315px {!empstreetstyle}" />
<br />
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer city" />
<sup id="sup1">* </sup>
<apex:inputText required="false" id="empCity" label="City"
html-placeholder=" City" value="{!empcity}"
style="margin-left:95px;width:315px {!empcitystyle}" />
<br />
<div class="half-line">
<br />
</div>
<div>
<div style="display: inline-block">
<apex:outputLabel style="color:#3295ba;" value="Employer State/Province" />
<sup id="sup1">* </sup>
</div>
<div id="empstatetext"
style="display: inline-block; visibility: hidden; position: absolute;">
<apex:inputText id="empState" label="State" value="{!empstatetext}"
html-placeholder=" State/Province" style="margin-left:16px;width:315px {!empstatetextstyle}"
required="false" />
</div>
<div id="empstatelist"
style="display: inline-block; visibility: hidden; position: absolute; margin-left: 16px;">
<apex:selectList size="1" required="false" value="{!empstatelist}">
<apex:selectOptions value="{!items6}" />
</apex:selectList>
</div>
</div>
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer Country" />
<sup id="sup1">* </sup>
<apex:selectList size="1" required="false"
style="margin-left:63px;width:127px;" value="{!empcountry}"
onChange="empShowState(this)">
<apex:selectOptions value="{!items5}" />
</apex:selectList>
<div class="half-line">
<br />
</div>
<apex:outputLabel style="color:#3295ba;" value="Employer Zip/Postal Code" />
<sup id="sup1">* </sup>
<apex:inputText required="false" id="empZip" label="Zip"
html-placeholder=" Zip Code" value="{!empzip}"
style="margin-left:3px;width:315px {!empzipstyle}" />
<br />
<div class="half-line">
<br />
</div>
if(getrbtnvalue=='Employer not found')
{
document.getElementById('empnotfound').style.visibility='visible';
}
Andy Boettcher
You can only rerender Visualforce elements. You can replace your <div> with an <apex:outputPanel> (which converts to a SPAN)