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
GargGarg 

Show start and end date as per week # selected

Hi,

 

I have a requirement wherein I have to select a week from picklist and using which I have to display start and end date of that week.

 

I am able to accomplish this using:

 

<apex:page standardcontroller="dropdown__c" extensions="mytest2">
Please select required week:

    <apex:form >              
       
        <apex:actionRegion >
       <apex:inputField value="{!dropdown__c.week__c}" id="stage">
         <apex:actionSupport event="onchange"
                             status="status" action="{!save}" rerender="dropdown__c"/>
         </apex:inputField>
         </apex:actionRegion>
         
      
        
    </apex:form>
</apex:page>

 

public class mytest2 {
 ApexPages.StandardController GstdController;
    public mytest2(ApexPages.StandardController controller) {
GstdController = Controller;
    }
    public PageReference save() {
   //  save();//invoke standard Save method
     
 PageReference pr = GstdController.save();
        pageReference pv = GstdController.view();
      //  return pv;
    //  return Apexpages.currentPage();//refresh current page
     // return null;
     
     return pv;
    }

}

 

But now the problem lies is that when I select a week, page gets refreshed and then only the start date and end date is shown.

 

I want that on the same page where we selected the week, the start and end date should be shown:

 

Something like:

 

Select Week- lets say user select week 2 from picklist

 

Then the output should be

 

Select Week- (in picklist value-2 is selected)

 

and there only the output should be shown (below the selected picklist value only):

Start Date

1/7/2013

    End Date

1/13/2013
 
If you need any clarification, please let me know.
 
Thanks.