salesforce - Rerender a pageblock -


if run page first time, pageblocks shows message "choose user, account or opp" because nothing choosen. if have selected user, account or opp pageblock show list/detail of account or opp. if change user @ top, want panel/pageblocks resetet, how can that? added pageblocks rerender function, doesn't work. wrong code?

<apex:form >  <apex:pageblock id="pbuser">     <apex:pageblocksection >         <apex:outputpanel >             <apex:selectlist value="{!selecteduserid}" size="1" multiselect="false">                 <apex:selectoptions value="{!listofuser}" />                  <apex:actionsupport event="onchange" action="{!fetchaccounts}" <u><b>rerender="pbacc, pbopp, pboppd"</b></u>/>                           </apex:selectlist>         </apex:outputpanel>     </apex:pageblocksection> </apex:pageblock>  <apex:pageblock <u><b>id="pbacc"</b></u>>     <apex:pageblocksection rendered="{!if(acclist.size >0,true,false)}" id="pbsacc">         <apex:outputpanel style="overflow:scroll;height:200px;" layout="block" id="panelacc">             <apex:pageblocktable value="{!acclist}" var="acc" onrowclick="highlightacc(this)">                 <apex:column headervalue="name">                     <apex:outputfield value="{!acc.name}"/>                     <apex:actionsupport event="onclick" action="{!fetchopps}" <u><b>rerender="pbopp, pboppd"</b></u>>                         <apex:param assignto="{!selectedaccountid}" value="{!acc.id}" name="selectedaccountid"/>                     </apex:actionsupport>                 </apex:column>                         <apex:column headervalue="street">                     <apex:outputfield value="{!acc.billingstreet}" />                 </apex:column>                 <apex:column headervalue="city">                     <apex:outputfield value="{!acc.billingcity}" />                 </apex:column>             </apex:pageblocktable>            </apex:outputpanel>     </apex:pageblocksection>      <apex:pageblocksection rendered="{!if(acclist.size <1,true,false)}">         <apex:outputpanel style="overflow:scroll;height:200px;" layout="block">            choose user.         </apex:outputpanel>     </apex:pageblocksection> </apex:pageblock>  <apex:pageblock <u><b>id="pbopp"</b></u>>     <apex:pageblocksection rendered="{!if(opplist.size >0,true,false)}" id="pbsopp">         <apex:outputpanel style="overflow:scroll;height:200px;" layout="block" id="panelopp">             <apex:pageblocktable value="{!opplist}" var="opp" onrowclick="highlightopp(this)">                 <apex:column headervalue="name">                     <apex:outputfield value="{!opp.name}"/>{!opp.id}                     <apex:actionsupport event="onclick" action="{!fetchoppdetail}" <u><b>rerender="pboppd"</b></u>>                         <apex:param assignto="{!selectedoppid}" value="{!opp.id}" name="selectedoppid"/>                     </apex:actionsupport>                 </apex:column>                         <apex:column headervalue="amount">                     <apex:outputfield value="{!opp.amount}"/>                 </apex:column>             </apex:pageblocktable>            </apex:outputpanel>     </apex:pageblocksection>      <apex:pageblocksection rendered="{!if(opplist.size <1,true,false)}">         <apex:outputpanel style="overflow:scroll;height:200px;" layout="block">             choose account.         </apex:outputpanel>     </apex:pageblocksection> </apex:pageblock>  <apex:pageblock <u><b>id="pboppd"</b></u> mode="inlineedit">     <apex:pageblockbuttons location="top">         <apex:commandbutton action="{!saveinlinechanges}" value="save" id="savebutton"/>         <apex:commandbutton action="{!fetchoppdetail}" value="cancel" id="cancelbutton"/>     </apex:pageblockbuttons>     <apex:pageblocksection rendered="{!if(oppdetail.size >0,true,false)}" id="pbsoppd">         <apex:outputpanel style="overflow:scroll;height:200px;" layout="block" id="paneloppd">             <apex:pageblocktable value="{!oppdetail}" var="oppd">                 <apex:column headervalue="name">                     <apex:outputfield value="{!oppd.name}">                         <apex:inlineeditsupport showonedit="savebutton, cancelbutton" hideonedit="editbutton" event="ondblclick" changedstyleclass="myboldclass" resetfunction="resetinlineedit"/>                     </apex:outputfield>                 </apex:column>                         <apex:column headervalue="amount">                     <apex:outputfield value="{!oppd.amount}" />                 </apex:column>             </apex:pageblocktable>            </apex:outputpanel>     </apex:pageblocksection>      <apex:pageblocksection rendered="{!if(oppdetail.size <1,true,false)}">         <apex:outputpanel style="overflow:scroll;height:200px;" layout="block">             chosse opportunity.         </apex:outputpanel>     </apex:pageblocksection> </apex:pageblock>  </apex:form> 

thanks, sascha

i suspect problem have misplaced html in actionsupport definition. change:

<apex:actionsupport event="onchange" action="{!fetchaccounts}" <u><b>rerender="pbacc, pbopp, pboppd"</b></u>/>               

to:

<apex:actionsupport event="onchange" action="{!fetchaccounts}" rerender="pbacc, pbopp, pboppd"/>   

(this applies other actionsupport elements further down page also)


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -