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
Newbie_edmNewbie_edm 

apex:actionSupport event="onchange" reload the page when we call method....

Dear Friends,

I have jquery fullcalendar plugin attched to my VF page, I have select list in the top which has locations, when user select location then it calls apex method and displays the event related to location. I have a problem here, when they change the location, it reloads the page and the calendar view goes back to week view to month view. Can you guys suggest me the way we can update the calendar events without loading the entire page..

Full Calendat ref link : http://fullcalendar.io/

Thanks,
 
Rajiv Penagonda 12Rajiv Penagonda 12
Venkat, without getting a look into your code it is hard to provide suggestions. However, based on the definition which you have provided, I am assuming that you are using an action function or a command button to do page reload when user selects a location which is resulting in your entire page reload. If this is the case, I suggest that you go with a javascript remoting feature of salesforce. Refer an example here (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_js_remoting_example.htm).

When it does is that instead of making a call to your controller method directly, you can access the feature from your javascript and refresh information on the calendar through javascript.

Hope this helps.
Mahesh DMahesh D
Hi Venkat,

Please find the below example:

Visualforce:
<apex:page controller="sample" id="mypage">
    <apex:form >            
        
        <apex:selectList id="selected_list" value="{!temp}" required="false" size="1">
            <apex:selectOption itemvalue="None" itemLabel="--None--"/>
            <apex:selectOption itemvalue="a" itemLabel="a"/>
            <apex:selectOption itemvalue="b" itemLabel="b"/>
            <apex:actionSupport event="onchange" reRender="Details" action="{!find}"/>
        </apex:selectList>
        <br/>
        <apex:panelGroup >        
            <apex:outputPanel id="Details">            
                The value based on select list value: {!temp1}            
            </apex:outputPanel>
        </apex:panelGroup>
         
    </apex:form>
</apex:page>

Apex Class:
 
public class sample 
{
    public String temp {get; set;}
    public String temp1 {get; set;}

    public sample() 
    {

    } 
    
    public void find()
    {
        if(temp == 'a')
        {
            temp1 = 'Welcome';
        }
        else if(temp == 'b')
        {
            temp1 = 'Thank you';
        }
    }            
}

Also go through the below links:

https://developer.salesforce.com/forums/?id=906F000000095tYIAQ

https://developer.salesforce.com/forums/?id=906F000000097DIIAY

https://developer.salesforce.com/forums/?id=906F000000096N7IAI

https://developer.salesforce.com/forums/?id=906F000000094zCIAQ

https://developer.salesforce.com/forums/?id=906F000000094xAIAQ

http://salesforce.stackexchange.com/questions/55744/how-actionsupport-will-work-when-used-with-selectlist-is-it-work-on-the-copy-of

http://salesforce.stackexchange.com/questions/60222/actionsupport-not-updating-select-list


Please do let me know if it helps you.

Regards,
Mahesh
Newbie_edmNewbie_edm
Guys,

Thanks lot for your reponse on this. I did try both and didnt work. I am able to get the current calendat view using java script. how can we pâss that current view to Apex controller...

 
sslodhi87sslodhi87
Hi Venkat

Once your page load you need to call the below mentioned script
<script>
$('#calendar').fullCalendar({ defaultView: 'month' aspectRatio: 1.5 });
</script>

This will help you bring back to month view.
Please let me know if this works for you:)

Thanks
Newbie_edmNewbie_edm
bydefault it goes to month view only after the page reloads after apex method called.