My app uses a table to display the names of records. The user has to select
a record from the table in order to edit it, delete it, etc. If the user
tries to click the edit or delete button without selecting a record, it gets
an error message. I check to see if the message needs to be displayed by
using a boolean variable and changing it to true when a table select event
occurs. It works fine with the buttons, but not when i added the same
functions to the menu. I have the same choices in a menu, that check for
the same variable. If i have selected a record, they work fine. But if i
haven't selected a record, nothing happens. I dont get my error message
like i do with the buttons. Code snippets follow. Thanks for any help,
Andrew
case tblSelectEvent:
{
file://set the databse cursor to the selected contact
cursor += event->data.tblSelect.row;
checker = true;
}
break;
case ctlSelectEvent:
{
case ListWindowInstallButton:
if( checker == true )
{
-- perfoms action since record selected --
checker = false;
}
else
{
FrmAlert( NoneSelectedAlert );
drawTable();
}
break;
-- Other buttons here--
--This part works fine --
}
.
.
.
switch( event->data.menu.itemID )
{
file://function to change records, edit, delete, new, etc.
case FunctionsEdit:
if( checker == true )
{
checker = false;
FrmGotoForm( InputOneForm );
}
else
{
newRecord();
FrmGotoForm( InputOneForm );
file://drawTable();
}
break;
--other menu choices here---
--problems with this part of the code--
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/