On April 27, 2024, our Sign-in and Create Account options will be unavailable from 9am-12pm ET. During this maintenance window, developer account access and free trial registration will be unavailable.

Yet another DCT Date Picker Thread

I am trying to implement my first calendar date picker callout in a DCT and I'm close but it's not completely working yet.  Another co-worker implemented a date picker in TagUI so I stole all that code for my DCT.  It works in TagUI.  I click on the callout button, the calendar widget appears, I click on a date and it closes the calendar widget and enters the date I picked in the format I want in the metadata capture field.  Beautiful.

 

However, for my DCT, I am seeing the calendar widget pop up when I click on the callout button.  That's a good thing.  But when I click on a date, nothing happens.  The calendar widget just stays there and nothing happens. 

 

So I need some help figuring out why the widget doesn't close and send my selected date back to my DCT.

 

This is the code I have injected into the DCT:

 

<script language="javascript" src="/iw-cc/base/widget/calendar/calendar_init.js"></script>

IWEventRegistry.addItemHandler("/markets/sale_information/start_date", "onCallout", showCalendar);

function showCalendar(item) {
function DateCallBack(date) {item.setValue(formatDate(date, "MM/dd/yyyy"));};
var theCalendarWindow = fwShowCalendar("-callback", DateCallBack, "-initialdate", new Date().valueOf());
}

 

And here's the item definition:

 

 

<root-container name="markets" location="markets">
     <container name="sale_information" location="sale_information" min="1" max="1">
          <label>Sale Information</label>
          <item name="start_date" pathid="start_date">
               <label>Sale Start</label>
               <description>Enter the date this sale will begin</description>
               <text required="f" size="35">
                    <callout url="" label="select date"/>
               </text>
          </item>
     </container>
</root-container>