function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Arun KArun K 

Rendering pageblock from visualforce remoting

HI,

I have a requirement where I need to render component from visualforce remoting.

If I would have used actionsupport instead of visualforce remoting, I can use rerender attribute to render certain pageblock.
I am wondering how to render pageblock on click of javascrip remoting value
logontokartiklogontokartik

I would create an actionFunction and then call the actionFunction from the JS method to rerender specific components

<pre>

function jsRemotingFunction(){

// call JS Remote Method

// At end of method call ActionFunction

refreshAF();

}

<apex:actionFunction name="refreshAF" rerender="theBlock"/>
</pre>

Arun KArun K
Thanks for the reply.

It helped me. 
Now can I get the values in that rendered pageblock.

My requirement is I have a mpa where I need to click on zip whose values are coming from "javascrip remoting" and as you said I used "actionfunction" and could able to render popup. Now my requiremnt is "On click on the zip I need to get values in that pop".

"Visualforce.remoting.Manager.invokeAction
                       (
                         '{!$RemoteAction.Arun_map_1.getAdjacent_Terr}',
                           zip_id,
                           function(result, event) {
                            adjacent = result
                            //alert("Wating....")
                            console.log("adjacent :- " + adjacent)
                            if (adjacent.toString() == 'true'){
                              var query = new esri.tasks.Query();
                              query.geometry = evt.mapPoint;
                              var deferred = zipcodes.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW);
                              console.log(evt.mapPoint);
                              rerendAction();
                            //  zip_indicator()
                              }
                            else{
                            alert("Selected zip is not adjacent ..please select adjacent zip")
                           }
                          
                         
                       
                           
                        });

------------------------------------------------

<apex:actionFunction name="rerendAction" rerender="popup" action="{!showPopup1}" />
---------------------------------------------------
<apex:outputPanel id="popup" >
    
         <apex:outputPanel styleClass="popupBackground" layout="block"  rendered="{!displayPopUp}"/>
            <apex:outputPanel styleClass="customPopup" layout="block" rendered="{!displayPopUp}">
              
                <apex:outputtext value="zipname.name"/>
             
               
            </apex:outputPanel>
        </apex:outputPanel>

"