You Are Here:

Community: Wiki

This page was last modified on 12 December 2007, at 12:06.

How to enable empty strings in query dialogs

From Forum Nokia Wiki

By default query dialogs will show the OK softkey only if you enter some text in to the edit control(s). This behaviour can be changed by overriding the UpdateLeftSoftKeyL() function. All other functions for queries work as they would normally, for example RunLD() or ExecuteLD().

In the case of multiline queries, note the following:

  • Use the ControlByLayoutOrNull() function with a control id of EMultiDataFirstEdwin or EMultiDataSecondEdwin.
  • You must call SetDataL() in the case of multiline data query controls.

Below is an implmentation of the class; no RSS is provided as the standard resource works just fine.

class CAllowsEmptyStringsDialog : public CAknTextQueryDialog
{
public:
 
static CAllowsEmptyStringsDialog* NewL(
TDes& aText, TTone aTone = ENoTone);
 
protected:
 
CAllowsEmptyStringsDialog(TDes& aText, const TTone& aTone);
 
protected: // from CAknTextQueryDialog
 
void UpdateLeftSoftKeyL();
};
CAllowsEmptyStringsDialog* CAllowsEmptyStringsDialog::NewL(
TDes& aText, TTone aTone)
{
CAllowsEmptyStringsDialog* self =
new (ELeave) CAllowsEmptyStringsDialog(aText, aTone);
return self;
}
 
CAllowsEmptyStringsDialog::CAllowsEmptyStringsDialog(
TDes& aText, const TTone& aTone)
: CAknTextQueryDialog(aText, aTone)
{
// No implementation required
}
 
void CAllowsEmptyStringsDialog::UpdateLeftSoftKeyL()
{
MakeLeftSoftkeyVisible(ETrue);
}
// Use as::
{
CAllowsEmptyStringsDialog* dialog = CAllowsEmptyStringsDialog::NewL(name);
dialog->ExecuteLD(R_ALLOWSEMPTYSTRING_PROMPT_QUERY);
}

Links

Querying Strings

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia