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
bensondanielbensondaniel 

onclick event

Apex repeat function here would repeat the days of the week, iterating from Monday to Sunday also displaying the day alongside.

My problem is in the prevWeek.

prevWeek is a button. (supposed to be)

When it is clicked I want the changes in goprev to take place.

I need wcTopBar to display the previous weeks days.

 

Pl take a look at

 <apex:actionSupport event="onclick" action="{!goprev}" rerender="wcTopBar" />  

and let me know what is deficient to do the job.

 

 

<apex:outputPanel id="wcTopBar" layout="block" styleClass="containerAD noscroll" style="height: 37px;">
                                    <div class="overflowContainer">    
                                        <div class="weekLabels">
                                            <apex:repeat value="{!daysOfWeek}" var="d">
                                                <div class="{!d.divClass}">
                                                    <div><span style="{!d.spanStyle}"><apex:outputText value="{!d.dayName}" escape="false" /></span></div>
                                                        </div>
                                            </apex:repeat>

___________________________________________________

<div class="prevWeek" id="prevweek">
                                            <a class="t_btn _background1Hover _border1 _background1 left small">
                                                <img src="{!URLFOR($Resource.Library, 'images/prev.png')}" width="13" height="28" />
                                                <apex:actionSupport event="onclick" action="{!goprev}" rerender="wcTopBar" />   
                                              </a>
                                        </div>
______________________________________________________________________

 

public class calendarController{

  public List<dayInfo> daysOfWeek {get;set;}

   Date pw;

 public calendarController(){
        daysOfWeek = new List<dayInfo>();
        pw = system.Today().toStartOfWeek();
        daysOfWeek = calUtil.buildDaysOfWeek(pw);
}

public PageReference goprev(){
        pw = system.Today().toStartOfWeek().addDays(-7);
        daysOfWeek = calUtil.buildDaysOfWeek(pw);
        return null;
    }

 

public PageReference goprev(){
        pw = system.Today().toStartOfWeek().addDays(-7);
        daysOfWeek = calUtil.buildDaysOfWeek(pw);
        return null;
    }
__________________________________________________________

minkeshminkesh

 

Hello,

 

          Have you checked that serverside function is calling or not ?

 

Regards,

Minkesh Patel

bensondanielbensondaniel

yes I did

bensondanielbensondaniel

The app was working fine...

 

until I got this error

 

Attempt to de-reference a null object

 

An unexpected error has occurred. Your development organization has been notified. 

Ajay.DixitAjay.Dixit

Check Controller / ControllerExtension class and see if there is any null Object and any value is getting assigned to this object. This error generally comes when we assign value to some variable/ Object which is initialised with null.