質問

I am having problems while trying to render a pageblocksection in visualforce. The code that i have used is as given below.

 <apex:pageBlockSection title="My Content Section" columns="2">
      <apex:pageBlockSectionItem>
           <apex:outputLabel value="Account Site"/>
           <apex:outputPanel>
                <apex:inputText value="{!account.site}" id="account__site" 
                 onclick="changefont(this)"> 
                <apex:actionSupport event="onclick" 
                            rerender="thePageBlock" status="Status"/>
           </apex:outputPanel>
      </apex:pageBlockSectionItem>
 </apex:pageBlockSection>

Here I am trying to render a page block and a javascript function at the same time, i,e the checking of a checkbox(Account Site). The problem here is when i try to execute the changefont(this) function in the onclick of apex:inputText and then try to render "thePageblock" in event="onclick" of apex:actionSupport the rendering does not take place. Is there a problem with my code or should i do this a different way.

Thanks..

役に立ちましたか?

解決

Try calling your Javascript function from the onsubmit or oncomplete attribute of your apex:actionSupport tag:

<apex:inputText value="{!account.site}" id="account__site" > 
    <apex:actionSupport event="onclick" rerender="thePageBlock"
                        status="Status" onsubmit="changefont(this)" />
</apex:inputText>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top