Hi I'm having an issue with displaying the correct number of rows on UX list.
I've attached a PDF with screen dumps of the application that should assist in explaining the issue.
However here's a summary ...
Mobile Application
Home panel with 3 controls
1. Physio: DropdownBox control which allows user to select a Physio
2. ApptDate: TextBox of type Date which allows user to choose a date
3. Button that shows a new panel with a list of appointments for the Physio and date selected.
The Appointments panel has a number of buttons, a label and a list control
The list control called APPOINTMENTS uses two arguments ie. Physio & ApptDate from the Home panel
Next Day button increments the ApptDate by 1
Prev Day button decrements the ApptDate by 1
Heres the Inline Javascript Action code for Prev Day
{dialog.object}.setValue('ApptDate', ChangeDate({dialog.object}.getValue('ApptDate'), -1));
{dialog.object}.refreshListData('APPOINTMENTS');
{dialog.Object}.setValue('PhysioSelected', PhysioDateString());
Note the last line calls the following javascript function.
function PhysioDateString() {
// Returns a formatted string of the number of appointments on the date selected
var sFormattedText = 'empty';
var lOb = {dialog.object}.getControl('APPOINTMENTS');
{dialog.object}.runAction('refresh'); //refreshes the Appointments list AGAIN!
var iAppointments = lOb._data.length;
if (iAppointments == 0) {
sFormattedText = 'you have no appts. on ' + ChangeDate({dialog.object}.getValue('ApptDate'), 0); }
else if (iAppointments == 1) {
sFormattedText = 'you have 1 appt. on ' + ChangeDate({dialog.object}.getValue('ApptDate'), 0); }
else {
sFormattedText = 'you have ' + iAppointments + ' appts. on ' + ChangeDate({dialog.object}.getValue('ApptDate'), 0); }
return sFormattedText;
}
However I must be doing something wrong ... see attached doc for images
Image1 �you have no appts!! When there actually are 5 appointments on the 8th Oct.
Clicking Next Day button to move to the 9th Oct
Image 2 � You have 5 appts. When there are actually 0 appointment on the 9th.
Clicking Next Day button to move to the 9th Oct
Image 3 � You have no appts!! When there actually are 4 appointments on the 10th Oct.
Image 4 � You have 4 appts. When there are actually 0 appointment on the 11th.
Summary : the function is populating the record count incorrectly. It�s as if it�s referencing the rowcount of the previous list!
I've attached a PDF with screen dumps of the application that should assist in explaining the issue.
However here's a summary ...
Mobile Application
Home panel with 3 controls
1. Physio: DropdownBox control which allows user to select a Physio
2. ApptDate: TextBox of type Date which allows user to choose a date
3. Button that shows a new panel with a list of appointments for the Physio and date selected.
The Appointments panel has a number of buttons, a label and a list control
The list control called APPOINTMENTS uses two arguments ie. Physio & ApptDate from the Home panel
Next Day button increments the ApptDate by 1
Prev Day button decrements the ApptDate by 1
Heres the Inline Javascript Action code for Prev Day
{dialog.object}.setValue('ApptDate', ChangeDate({dialog.object}.getValue('ApptDate'), -1));
{dialog.object}.refreshListData('APPOINTMENTS');
{dialog.Object}.setValue('PhysioSelected', PhysioDateString());
Note the last line calls the following javascript function.
function PhysioDateString() {
// Returns a formatted string of the number of appointments on the date selected
var sFormattedText = 'empty';
var lOb = {dialog.object}.getControl('APPOINTMENTS');
{dialog.object}.runAction('refresh'); //refreshes the Appointments list AGAIN!
var iAppointments = lOb._data.length;
if (iAppointments == 0) {
sFormattedText = 'you have no appts. on ' + ChangeDate({dialog.object}.getValue('ApptDate'), 0); }
else if (iAppointments == 1) {
sFormattedText = 'you have 1 appt. on ' + ChangeDate({dialog.object}.getValue('ApptDate'), 0); }
else {
sFormattedText = 'you have ' + iAppointments + ' appts. on ' + ChangeDate({dialog.object}.getValue('ApptDate'), 0); }
return sFormattedText;
}
However I must be doing something wrong ... see attached doc for images
Image1 �you have no appts!! When there actually are 5 appointments on the 8th Oct.
Clicking Next Day button to move to the 9th Oct
Image 2 � You have 5 appts. When there are actually 0 appointment on the 9th.
Clicking Next Day button to move to the 9th Oct
Image 3 � You have no appts!! When there actually are 4 appointments on the 10th Oct.
Image 4 � You have 4 appts. When there are actually 0 appointment on the 11th.
Summary : the function is populating the record count incorrectly. It�s as if it�s referencing the rowcount of the previous list!
Comment