+ Start a Discussion
speddireddyspeddireddy 

rerendering a visualforce page component from apex class function

can anybody help me out with how to call or render a visualforce page component from an apex class function so that i will be able to display the updates of the function which calls out an external http request and recieves data and then updates it and posts the data back..

venkat-Dvenkat-D

You can have a variable in apex class

 

public boolean bIdentifier {get; set;}

 

and in the apex class once you get the rsponse from request, you set the identifier to true and in the button from where rquest is called you can rerender your section.

 

In the visualforce page use this variable in rendered="{!bIdentifier}" in the component you want to rerender.

 

 

MGusingTheForceMGusingTheForce

Any solution to this? I'm trying to do the same thing

vivek12345vivek12345

Hello,

 

One solution can be

 

Step 1:

 

Using Boolean variables in your controller which will change its values based on your data retrieves.

 

Step 2:

 

On your visual force page put your data table or table under 2 output panel and pass the ids to that panel.

 

Step 3:

 

After putting both the output panels your code will look like

<apex:outputPanel id="table">

 <apex:outputPanel rendered="{!displayPopUp}" >

                <apex:pageBlockTable value="{!dates}" var="days" >

 

 

Step 4:

 

Now finally you need to rerender your output panel (id Table).

 

<apex:commandButton action="{!showdata}" value="Refresh Table " rerender=" table" id="showpopup" />

 

 

In the above cases I am refreshing my data table by a clicking a button, in your case you need to sort out from where you need to rerender.

 

Please let me know if this solves your issues.

 

Thanks

Vivek