• prafs
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi everybody,
I am trying to populate selectlist options through onload javascript function, but some how this is not working. I have pasted the code below that iam working on, could any body please suggest any changes to make it working.
<apex:page >
<script> window.onload = list1;
function list1()
{
var list=document.getElementById('listchosen');
for(var i=0;i<10;i++)
list.add(new Option('xxx','xxx'));
}
</script>
<apex:outputPanel id="result"> <apex:form >
<b>Please select :</b>
<apex:selectList id="listchosen" multiselect="false" size="1"> </apex:selectList>
</apex:form>
</apex:outputPanel>
</apex:page>

 

I have looked through a number of board discussions and read through the related articles but cannot seem to get a solution to work so any help is really appreciated!  I have a VF that I have built that works great.  The only issue I have is that when it requires more than one page, it most often puts the page break in the middle of one of the tables.  Is there anyway to have a dynamic page break that is not driven by number of records?  I ask this because I want it as much on a single page as possible but there are two tables and I do not know how to do number of records when I am dependent on two different tables populating that will have a different number of records each time? 

 

Also, if possible to add page numbers that would be great but not as important as the dynamic page break.

 

Below is the code of the page I need this on.

 

Thanks!!

 

<apex:page renderas="PDF" standardController="Account" showHeader="false" sidebar="false">
<p><b><font size="4">{!Account.Name}</font></b></p>
<p><b><font size="2">Claim Check as of {!if(Month(Today())=1,"January","")}{!if(Month(Today())=2,"February","")}{!if(Month(Today())=3,"March","")}{!if(Month(Today())=4,"April","")}{!if(Month(Today())=5,"May","")}{!if(Month(Today())=6,"June","")}{!if(Month(Today())=7,"July","")}{!if(Month(Today())=8,"August","")}{!if(Month(Today())=9,"September","")}{!if(Month(Today())=10,"October","")}{!if(Month(Today())=11,"November","")}{!if(Month(Today())=12,"December","")} {!Day(Today())}, {!Year(Today())}
</font></b></p>
<p></p>
<p><b>RELATED POLICIES:</b></p>
<table border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Policy Number</th>
<th>Policy Period</th>
<th>Underwriter</th>
<th>Underwriting Branch Office</th>
</tr>
<apex:repeat var="rp" value="{!Account.Policies5__r}">
<tr>
<td>{!rp.Name} </td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Effective_Date__c}"/></apex:outputText> - <apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rp.Expiration_Date__c}"/></apex:outputText></td>
<td>{!rp.Underwriter__r.Name}</td>
<td>{!rp.Underwriting_Branch_Office__c}</td>
</tr>
</apex:repeat>
</table>
<p><b>RELATED CLAIMS:</b></p>
<table border="1" cellspacing="2" cellpadding="5">
<tr>
<th>Claim Number</th>
<th>Insured</th>
<th>Claimant Name</th>
<th>Policy Number</th>
<th>Claim Status</th>
<th>Date Reported</th>
<th>Examiner</th>
</tr>
<apex:repeat var="rc" value="{!Account.Claims__r}">
<tr>
<td>{!rc.Name} </td>
<td>{!rc.Insured_Lookup__r.name}</td>
<td>{!rc.Claimant_Name__c}</td>
<td>{!rc.Policy__r.name}</td>
<td>{!rc.Status__c}</td>
<td><apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!rc.Date_Reported__c}"/></apex:outputText></td>
<td>{!rc.Owner.name}</td>
</tr>
</apex:repeat>
</table>
<p/>
<div class="bPageFooter" id="bodyFooter"><div class="footer">Privileged and Confidential - LVL Claims Services, LLC</div></div>
</apex:page>

  • November 16, 2011
  • Like
  • 0

Dear All,

 

Could you please help me to give example Apex source code to get latest Due Date from all Tasks under each Account that will be implemented on Account Trigger.

 

Thank you very much in advance.

 

Best Regards

Anong

 

  • December 29, 2011
  • Like
  • 0
Hi everybody,
I am trying to populate selectlist options through onload javascript function, but some how this is not working. I have pasted the code below that iam working on, could any body please suggest any changes to make it working.
<apex:page >
<script> window.onload = list1;
function list1()
{
var list=document.getElementById('listchosen');
for(var i=0;i<10;i++)
list.add(new Option('xxx','xxx'));
}
</script>
<apex:outputPanel id="result"> <apex:form >
<b>Please select :</b>
<apex:selectList id="listchosen" multiselect="false" size="1"> </apex:selectList>
</apex:form>
</apex:outputPanel>
</apex:page>