• kmccoll
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 10
    Replies
I have the following bits of code... it all worked prior to the summer 08 upgrade (well, I changed to the new style of setters/getters).  Am I doing something wrong... the ContactInFocus variable in the controller in not getting set. 


Code:
in controller:

Id contactInFocus{get;set;}

In page:

<apex:actionFunction action="{!quickLog}" name="apex_quickLog" rerender="pbCallList" status="ajaxStatus"  oncomplete="setSelectedContacts();">
   <apex:param assignto="{!ContactInFocus}" name="contactInFocus" value=""/>
</apex:actionFunction>


... and... 

<apex:form >

 <img  src="{!URLFOR($Resource.Silk_Icons, 'tick.png')}" 
   alt="Log that you've called this contact"
   title="Log that you've called this contact"
   class="inlineIcon {!IF(each.contactedToday,'contactedToday','')}" 
   onclick="apex_quickLog(contactInFocus='{!each.contact.Id}');" /> 
</apex:form>


The code generated looks okay, e.g.:
onclick="apex_quickLog(contactInFocus='0034000000PZHDGAA5');

 

I suppose this isn't purely a VF question, and it's probably not supported anyway, but it is related so I'll ask anyway...

I have successfully implemented hover-overs for account and contact links in my Visualforce page (by using LookupHoverDetail.getHover) but I'm struggling to get the same effect for Tasks.

As there is no mini layout for Task (as far as I know) I put together a simple mini Visualforce page then used the same LookupHoverDetail.getHover code to display the task details on a mouseover.

It almost works... this new mini page shows up in an overlay, but the "bubble" around it disappears as soon as the overlay loads which makes it harder to see and doesn't point to the originating link.



My javascript skills are not up to figuring out why this happens, but might be something to do with two additional DIV elements that wrap the pageblock in a visualforce page

Code:
<div class="apexp">
    <div class="individualPalette">

... pageblock

    </div>
</div>

 Interestingly, playing around with the classes that bring in the bubble as a background image led me to try wrapping my pageblock with this:

Code:
<div class="topLeft">
   ...pageblock
</div>

 ... it almost works.  The bubble stays up, but is stuck as the topLeft version (so if the link is near the right or the bottom of the page, the arrow comes from the topRight or bottomLeft/bottomRight and points to the wrong place) - see below... this link being hovered over is the 4 months ago (edemo)



There is also an EventHover function but I think it works for events only and I couldn't get it to work in any case..

Any thoughts?  I can obviously hand-code the whole thing but I like way the standard hovers work and look.


Message Edited by kmccoll on 06-06-2008 08:41 AM
This is a pretty minor issue but thougt I'd post anyway...

If I have a commandButton inside a pageBlockButtons section of a pageBlock with location left to the default of "both" then any ID I give the commandButton will be the same on the top button as the bottom button.

This is invalid HTML and means that I can't access that button from javascript.  IE and FF both behave much the same - they don't complain, but pick the top button only.

Anybody have a workaround?

Thanks
Kenny
I'm having trouble getting header facets to display in a pageBlockList

Here's a simplified example of a page:

Code:
<apex:page standardController="Contact">
<apex:pageBlock>
<apex:pageBlockList value="{!Contact}" var="c">

 <apex:column>
  <apex:facet name="header">ID</apex:facet>
  <apex:outputField value="{!c.Id}"/>
 </apex:column>
 <apex:column>
  <apex:facet name="header"><h3>Name</h3></apex:facet>
  <apex:outputField value="{!c.Name}"/>
 </apex:column>


</apex:pageBlockList>
</apex:pageBlock>
</apex:page>

 The headers do not display.

If I replace the pageBlockList with dataTable then the headers show up fine.

Is this a bug or am I missing something?  (the documentation states that column header facets are supported for pageBlockList )

Note: the headerValue attribute of apex:column works fine,  but I need to insert some HTML tags

Thanks
Kenny

I'm having trouble setting the selectedTab attribute of a tabPanel dynamically.  It works fine if I set selectedTab to a string in the visualforce page, but if I try and use something set by the controller it doesn't work.  Am I missing something obvious or is there an issue with the tabPanel tag?  

Controller:

Code:
public class testTabController {
 String tabInFocus = System.currentPageReference().getParameters().get('tab');
 public String getTabInFocus() {
  return tabInFocus;
 }
 public void setTabInFocus( String s ) {
  this.tabInFocus = s;
 }
}

 Page:
Code:
<apex:page controller="testTabController" sidebar="false" showheader="true">

 <p>tabInFocus: &lt;{!TabInFocus}&gt;</p>
 <apex:tabPanel switchType="client" selectedTab="{!TabInFocus}" id="testTabs">
  
  <apex:tab label="Label 1" name="oneTab" id="tab1" >
   <p>This is number one</p>
  </apex:tab>
  
  <apex:tab label="Label 2" name="twoTab" id="tab2" >
   <p>This is number two</p>
  </apex:tab>
  
  <apex:tab label="Label 3" name="threeTab" id="tab3" >
   <p>This is number three</p>
  </apex:tab>
  
 </apex:tabPanel>

</apex:page>

URL:
Code:
/apex/test_tab?tab=twoTab

 


 
The tab is selected properly if I use a static string, e.g.:

Code:
<apex:tabPanel switchType="client" selectedTab="twoTab" id="testTabs">

 
Any ideas?

I have a page where an event is entered, so it has a datetime inputField.   The visualforce page renders a single text input with a datepicker, so the date and time can be entered (by typing in the time after the date has been selected), but it's not very user friendly.  The native Salesforce.com page to enter an event splits this into two fields -- date and time -- which is much more intuitive.

I'm probably missing something, but what's the best way to achieve this (without resorting to raw text inputs)?

Thanks
Kenny
I'm seeing an odd issue when displaying datetime values.

My (simplified) code is as follows:
Code:
public class testdateController {
 public Event[] getDates() {
         
        return [ SELECT Id, 
   ActivityDateTime
  FROM Event
  ORDER BY ActivityDateTime
  LIMIT 8 ];
    }
}

<apex:page controller="testdateController" showHeader="false" sidebar="false">
 <apex:dataTable value="{!dates}" var="each" cellpadding="6"  id="scheduleTable">
  <apex:column>
   <apex:facet name="header">Start Time</apex:facet>
   <apex:outputText value="{!each.ActivityDateTime}"/>
  </apex:column>                
    </apex:dataTable>
</apex:page>

This runs okay sometimes:
Code:
Start Time
Thu Feb 15 00:55:00 GMT 2007
Thu Mar 01 02:00:00 GMT 2007
Wed Apr 25 17:00:00 GMT 2007
Wed Feb 20 19:37:00 GMT 2008
Tue Feb 26 18:56:00 GMT 2008
Tue Feb 26 18:57:00 GMT 2008
(Although datetime values not being formatted)

But other times, gives java code instead of the datetimes:
Code:
Start Time
java.util.GregorianCalendar[time=1171500900000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2007,MONTH=1,WEEK_OF_YEAR=7,WEEK_OF_MONTH=3,DAY_OF_MONTH=15,DAY_OF_YEAR=46,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=55,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
java.util.GregorianCalendar[time=1172714400000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2007,MONTH=2,WEEK_OF_YEAR=9,WEEK_OF_MONTH=1,DAY_OF_MONTH=1,DAY_OF_YEAR=60,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=2,HOUR_OF_DAY=2,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
java.util.GregorianCalendar[time=1177520400000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2007,MONTH=3,WEEK_OF_YEAR=17,WEEK_OF_MONTH=4,DAY_OF_MONTH=25,DAY_OF_YEAR=115,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=5,HOUR_OF_DAY=17,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
java.util.GregorianCalendar[time=1203536220000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2008,MONTH=1,WEEK_OF_YEAR=8,WEEK_OF_MONTH=4,DAY_OF_MONTH=20,DAY_OF_YEAR=51,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=3,AM_PM=1,HOUR=7,HOUR_OF_DAY=19,MINUTE=37,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
java.util.GregorianCalendar[time=1204052160000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2008,MONTH=1,WEEK_OF_YEAR=9,WEEK_OF_MONTH=5,DAY_OF_MONTH=26,DAY_OF_YEAR=57,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=56,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]

 I can't figure out what triggers this, but seems to happen about half of the time.

I'm pretty new at vf so there's a good chance I'm missing something basic.

Thanks
Kenny

 

 

Hi,

When you use pageBlockButtons in a pageBlock, the page will display the buttons at both the top and the bottom of the pageBlock to which these buttons belong.

I wanted to disable the 'Save' button in a page untill some conditions were met using the 'disabled' attribute and rerender the button as 'enabled' whenever all checks in the controller come back ok.
Unfortunately, it seems that only the button at the top gets rerendered.

Looking at the attributes in the page I notice that both buttons got the same id but the Ajax javascript probably doesn't look for more than one match to rerender.

You can see this behaviour in the page and controller below :

<apex:page controller="buttontestController">
 
  <apex:form>
      <apex:pageblock>         
          <apex:pageblockButtons>
              <apex:commandButton value="Save" disabled="{!saveButtonDisabled}" id="savebutton"></apex:commandButton>
          </apex:pageblockButtons>
          <apex:outputlabel value="some page info"></apex:outputlabel>
          <apex:commandbutton value="Switch Save Button Rendering" action="{!someMethod}" rerender="savebutton"></apex:commandbutton>
      </apex:pageblock>
  </apex:form>
 
</apex:page>



public class buttontestController {
   
    Boolean saveButtonDisabled = false;
   
    public Boolean getSaveButtonDisabled() {
        return saveButtonDisabled;
    }
   
    public void someMethod() {
        if(saveButtonDisabled) {saveButtonDisabled = false;}
        else {saveButtonDisabled = true;}
    }

}

I guess this isn't supposed to happen ?
It's not urgent for me right now but if I come up with a workaround I'll post it here. If you've got one, feel free to do so too.


David
I have the following bits of code... it all worked prior to the summer 08 upgrade (well, I changed to the new style of setters/getters).  Am I doing something wrong... the ContactInFocus variable in the controller in not getting set. 


Code:
in controller:

Id contactInFocus{get;set;}

In page:

<apex:actionFunction action="{!quickLog}" name="apex_quickLog" rerender="pbCallList" status="ajaxStatus"  oncomplete="setSelectedContacts();">
   <apex:param assignto="{!ContactInFocus}" name="contactInFocus" value=""/>
</apex:actionFunction>


... and... 

<apex:form >

 <img  src="{!URLFOR($Resource.Silk_Icons, 'tick.png')}" 
   alt="Log that you've called this contact"
   title="Log that you've called this contact"
   class="inlineIcon {!IF(each.contactedToday,'contactedToday','')}" 
   onclick="apex_quickLog(contactInFocus='{!each.contact.Id}');" /> 
</apex:form>


The code generated looks okay, e.g.:
onclick="apex_quickLog(contactInFocus='0034000000PZHDGAA5');

 

Hi guys,

I'm trying to get a pretty standard Scriptaculous drag and drop functionality using javascript to work in a visual force page. Am not having any great deal of luck right now. Can anyone help or point me in the right direction

below is the source for the drag and drop page I have done in HTML it works fine I want to try and port it to visual force, ultimately being able to use the output from the 'debug log button there' to use in a Controller Extension and create some relationships between objects.

I'm guessing the problem is with the way visual force pages reference ID's?? But I can't be completely sure. Any help would be great. Thanks :)


Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
 <title>Drag Drop</title>
  <script src="http://script.aculo.us/prototype.js" type="text/javascript"></script>
  <script src="http://script.aculo.us/scriptaculous.js" type="text/javascript"></script>
  

 <script language="JavaScript">
 sections = ['group1','group2','group3'];

 function createNewSection(name) {
  var name = $F('sectionName');
  if (name != '') {
   var newDiv = Builder.node('div', {id: 'group' + (sections.length + 1), className: 'section', style: 'display:none;' }, [
    Builder.node('h3', {className: 'handle'}, name)
   ]);

   sections.push(newDiv.id);
   $('page').appendChild(newDiv);
   Effect.Appear(newDiv.id);
   destroyLineItemSortables();
   createLineItemSortables();
   createGroupSortable();
  }
 }

 function createLineItemSortables() {
  for(var i = 0; i < sections.length; i++) {
   Sortable.create(sections[i],{tag:'div',dropOnEmpty: true, containment: sections,only:'lineitem'});
  }
 }

 function destroyLineItemSortables() {
  for(var i = 0; i < sections.length; i++) {
   Sortable.destroy(sections[i]);
  }
 }

 function createGroupSortable() {
  Sortable.create('page',{tag:'div',only:'section',handle:'handle'});
 }

 /*
 Debug Functions for checking the group and item order
 */
 function getGroupOrder() {
  var sections = document.getElementsByClassName('section');
  var alerttext = '';
  sections.each(function(section) {
   var sectionID = section.id;
   var order = Sortable.serialize(sectionID);
   alerttext += sectionID + ': ' + Sortable.sequence(section) + '\n';
  });
  alert(alerttext);
  return false;
 }
 </script>

<style>
 body, div {
  font-family: Arial, Helvetica;
  font-size: 11px;
 }

 div.section,div#createNew {
  border: 1px solid #CCCCCC;
  margin: 30px 5px;
  padding: 0px 0px 10px 0px;
  background-color: #EFEFEF;
 }

 div#createNew input { margin-left: 5px; }

 div#createNew h3, div.section h3{
  font-size: 14px;
  padding: 2px 5px;
  margin: 0 0 10px 0;
  background-color: #CCCCCC;
  display: block;
 }

 div.section h3 {
  cursor: move;
 }

 div.lineitem {
  margin: 3px 10px;
  padding: 2px;
  background-color: #FFFFFF;
  cursor: move;
 }

 h1 {
  margin-bottom: 0;
  font-size: 18px;
 }
</style>
</head>
<body>
<div id="page">

 <div id="createNew">

  <h3>Add New Sales Contact</h3>
  <input type="text" id="sectionName" size="25">
  <input type="button" onClick="createNewSection();" value="Create Sales Contact">
 </div>

 <div id="group1" class="section">
  <h3 class="handle">Tickets</h3>
  <div id="item_1" class="lineitem">DWD2008 VIP</div>

  <div id="item_2" class="lineitem">DWD2008 GOLD</div>
  <div id="item_3" class="lineitem">DWD2008 SILVER</div>
  <div id="item_4" class="lineitem">DWD2008 BRONZE</div>
 </div>

 <div id="group2" class="section">
  <h3 class="handle">Sales Contact 1</h3>

 </div>

 <div id="group3" class="section">
  <h3 class="handle">Sales Contact 2</h3>
 </div>

</div>

<fieldset>
 <legend>group order debug</legend>

 <input type="button" onClick="getGroupOrder()" value="output group order">
 <br>
</fieldset>

<script type="text/javascript">
 // <![CDATA[
 Sortable.create('group1',{tag:'div',dropOnEmpty: true, containment: sections,only:'lineitem'});
 Sortable.create('group2',{tag:'div',dropOnEmpty: true, containment: sections,only:'lineitem'});
 Sortable.create('group3',{tag:'div',dropOnEmpty: true, containment: sections,only:'lineitem'});
 Sortable.create('page',{tag:'div',only:'section',handle:'handle'});
 // ]]>
 </script>
</body>
</html>

 


java.util.GregorianCalendar[time=1213779900000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2008,MONTH=5,WEEK_OF_YEAR=25,WEEK_OF_MONTH=3,DAY_OF_MONTH=18,DAY_OF_YEAR=170,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=9,HOUR_OF_DAY=9,MINUTE=5,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]




This is how a field of type DATE/TIME got displayed in a data table... I am using a custom controller to query the database and get this value.. Do i need to do any type conversion to display this date in proper format

Thanks
I suppose this isn't purely a VF question, and it's probably not supported anyway, but it is related so I'll ask anyway...

I have successfully implemented hover-overs for account and contact links in my Visualforce page (by using LookupHoverDetail.getHover) but I'm struggling to get the same effect for Tasks.

As there is no mini layout for Task (as far as I know) I put together a simple mini Visualforce page then used the same LookupHoverDetail.getHover code to display the task details on a mouseover.

It almost works... this new mini page shows up in an overlay, but the "bubble" around it disappears as soon as the overlay loads which makes it harder to see and doesn't point to the originating link.



My javascript skills are not up to figuring out why this happens, but might be something to do with two additional DIV elements that wrap the pageblock in a visualforce page

Code:
<div class="apexp">
    <div class="individualPalette">

... pageblock

    </div>
</div>

 Interestingly, playing around with the classes that bring in the bubble as a background image led me to try wrapping my pageblock with this:

Code:
<div class="topLeft">
   ...pageblock
</div>

 ... it almost works.  The bubble stays up, but is stuck as the topLeft version (so if the link is near the right or the bottom of the page, the arrow comes from the topRight or bottomLeft/bottomRight and points to the wrong place) - see below... this link being hovered over is the 4 months ago (edemo)



There is also an EventHover function but I think it works for events only and I couldn't get it to work in any case..

Any thoughts?  I can obviously hand-code the whole thing but I like way the standard hovers work and look.


Message Edited by kmccoll on 06-06-2008 08:41 AM
Code:
<apex:page standardController="Account">
  <apex:pageBlock title="Opportunities">
    <apex:form >
        <apex:pageBlockTable value="{!account.Opportunities}" var="opty">
          <apex:column >
            <apex:commandLink rerender="detail">
              <apex:param name="opty_id" value="{!opty.id}" />
              <apex:param name="render_details" value="true" />
              {!opty.Name}
            </apex:commandLink>
          </apex:column>
          <apex:column value="{!opty.StageName}"/>
          <apex:column value="{!opty.Type}"/>
          <apex:column value="{!opty.CloseDate}"/>
          <apex:column value="{!opty.License_Start_Date__c}"/>
          <apex:column value="{!opty.ExpirationDate__c}"/>
          <apex:column value="{!opty.Rollup_Amount__c}"/>
          <apex:column value="{!opty.Rollup_New_Amount__c}"/>
          <apex:column value="{!opty.Rollup_Renew_Amount__c}"/>
          <apex:column value="{!opty.Rollup_One_Time_Amount__c}"/>
          <apex:column value="{!opty.Owner.Name}"/>
          <apex:column value="{!opty.Active_Status__c}"/>
        </apex:pageBlockTable>
    </apex:form>
  </apex:pageBlock>
  <apex:outputPanel id="detail">
    <apex:actionStatus startText="Looking up Opportunity...">
      <apex:facet name="stop"> 
        <apex:detail subject="{!$CurrentPage.parameters.opty_id}" relatedList="false" title="false" rendered="{!$CurrentPage.parameters.render_details}" />
      </apex:facet>
    </apex:actionStatus>
  </apex:outputPanel>  
  <!-- End Default Content REMOVE THIS -->
</apex:page>
 In the above code, I am just trying to create an alternative opportunities related list for accounts adding in as many fields as we would like.  When I use the apex:column elements with date fields the values output are in a long date format (with time and timezone).  If I put an apex:outputField in the apex:column the date is formatted in short format but then the header disappears. Is there any way to format date fields in an apex:pageBlockTable element as short form and keep the header of the column? I have tried using the header attribute in the column as well, but to no avail.
This is a pretty minor issue but thougt I'd post anyway...

If I have a commandButton inside a pageBlockButtons section of a pageBlock with location left to the default of "both" then any ID I give the commandButton will be the same on the top button as the bottom button.

This is invalid HTML and means that I can't access that button from javascript.  IE and FF both behave much the same - they don't complain, but pick the top button only.

Anybody have a workaround?

Thanks
Kenny
I'm having trouble setting the selectedTab attribute of a tabPanel dynamically.  It works fine if I set selectedTab to a string in the visualforce page, but if I try and use something set by the controller it doesn't work.  Am I missing something obvious or is there an issue with the tabPanel tag?  

Controller:

Code:
public class testTabController {
 String tabInFocus = System.currentPageReference().getParameters().get('tab');
 public String getTabInFocus() {
  return tabInFocus;
 }
 public void setTabInFocus( String s ) {
  this.tabInFocus = s;
 }
}

 Page:
Code:
<apex:page controller="testTabController" sidebar="false" showheader="true">

 <p>tabInFocus: &lt;{!TabInFocus}&gt;</p>
 <apex:tabPanel switchType="client" selectedTab="{!TabInFocus}" id="testTabs">
  
  <apex:tab label="Label 1" name="oneTab" id="tab1" >
   <p>This is number one</p>
  </apex:tab>
  
  <apex:tab label="Label 2" name="twoTab" id="tab2" >
   <p>This is number two</p>
  </apex:tab>
  
  <apex:tab label="Label 3" name="threeTab" id="tab3" >
   <p>This is number three</p>
  </apex:tab>
  
 </apex:tabPanel>

</apex:page>

URL:
Code:
/apex/test_tab?tab=twoTab

 


 
The tab is selected properly if I use a static string, e.g.:

Code:
<apex:tabPanel switchType="client" selectedTab="twoTab" id="testTabs">

 
Any ideas?
I'm seeing an odd issue when displaying datetime values.

My (simplified) code is as follows:
Code:
public class testdateController {
 public Event[] getDates() {
         
        return [ SELECT Id, 
   ActivityDateTime
  FROM Event
  ORDER BY ActivityDateTime
  LIMIT 8 ];
    }
}

<apex:page controller="testdateController" showHeader="false" sidebar="false">
 <apex:dataTable value="{!dates}" var="each" cellpadding="6"  id="scheduleTable">
  <apex:column>
   <apex:facet name="header">Start Time</apex:facet>
   <apex:outputText value="{!each.ActivityDateTime}"/>
  </apex:column>                
    </apex:dataTable>
</apex:page>

This runs okay sometimes:
Code:
Start Time
Thu Feb 15 00:55:00 GMT 2007
Thu Mar 01 02:00:00 GMT 2007
Wed Apr 25 17:00:00 GMT 2007
Wed Feb 20 19:37:00 GMT 2008
Tue Feb 26 18:56:00 GMT 2008
Tue Feb 26 18:57:00 GMT 2008
(Although datetime values not being formatted)

But other times, gives java code instead of the datetimes:
Code:
Start Time
java.util.GregorianCalendar[time=1171500900000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2007,MONTH=1,WEEK_OF_YEAR=7,WEEK_OF_MONTH=3,DAY_OF_MONTH=15,DAY_OF_YEAR=46,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=3,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=55,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
java.util.GregorianCalendar[time=1172714400000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2007,MONTH=2,WEEK_OF_YEAR=9,WEEK_OF_MONTH=1,DAY_OF_MONTH=1,DAY_OF_YEAR=60,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=2,HOUR_OF_DAY=2,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
java.util.GregorianCalendar[time=1177520400000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2007,MONTH=3,WEEK_OF_YEAR=17,WEEK_OF_MONTH=4,DAY_OF_MONTH=25,DAY_OF_YEAR=115,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=5,HOUR_OF_DAY=17,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
java.util.GregorianCalendar[time=1203536220000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2008,MONTH=1,WEEK_OF_YEAR=8,WEEK_OF_MONTH=4,DAY_OF_MONTH=20,DAY_OF_YEAR=51,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=3,AM_PM=1,HOUR=7,HOUR_OF_DAY=19,MINUTE=37,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
java.util.GregorianCalendar[time=1204052160000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2008,MONTH=1,WEEK_OF_YEAR=9,WEEK_OF_MONTH=5,DAY_OF_MONTH=26,DAY_OF_YEAR=57,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=56,SECOND=0,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]

 I can't figure out what triggers this, but seems to happen about half of the time.

I'm pretty new at vf so there's a good chance I'm missing something basic.

Thanks
Kenny

 

 

My code works like this. I have n number of Lead objects. When I click a checkbox I am trying to pass the value to a javascript function. It is not working. Any help. Also How do i achieve this functionality?

<apex:page controller="registerDomainController" tabStyle="Lead">
<script>
function addUsers(userid)
{
var idsToAdd = new Array();
alert('Before adding' + userid);
idsToAdd.add(userid);
}
</script>
<apex:sectionHeader title="Add User">
<apex:form>

<apex:pageBlock>
<apex:facet name="footer">

<apex:pageBlockSection title="Add Users to the Extranet">
<apex:dataTable value="{!allLeads}" var="user" cellspacing="0" cellpadding="4" border="0" width="800px">
<apex:column>
<apex:facet name="header">First Name</apex:facet>
<apex:outputText>{!user.firstname}</apex:outputText>
</apex:column>
<apex:column>
<apex:facet name="header">Last Name</apex:facet>
<apex:outputText>{!user.lastname}</apex:outputText>
</apex:column>
<apex:column>
<apex:facet name="header">Email Address</apex:facet>
<apex:outputText>{!user.email}</apex:outputText>
</apex:column>
<apex:column>
<apex:facet name="header">Phone number</apex:facet>
<apex:outputText>{!user.phone}</apex:outputText>
</apex:column>
<apex:column>
<apex:facet name="header">Add User</apex:facet>
<apex:inputCheckbox value="{!user.id}" onclick='addUsers({!user.id})'/>
</apex:column>

</apex:dataTable>

</apex:pageBlockSection>

</apex:pageBlock>
</apex:form>
</apex:sectionHeader>
</apex:page>