[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

problem with search on typing

marcin

11/14/2005 6:09:00 PM

Hi, I have created a form with one StringEdit (ItemId) and a Grid containing
records from the InventTable. I have built a query range (qbr) on
InventTable.ItemId. When user types chars in the StringEdit control my code
filters InventTable by mean of overriden method:

public void textChange()
{
super();
qbr.Value(StrFmt('%1*',ItemId.ValueStr()));
InventTable_DS.ExecuteQuery();
}

everything works fine except fact that ExecuteQuery() causes my StringEdit
to get focus - so all text is selected... any ideas? Regards, marcin
2 Answers

mortenm

11/15/2005 10:18:00 AM

0

Hi marcin,

We made a form that would run executeQuery for each char the user typed. It
worked ok when typing lower case letters, but no when typing upper case
letters. The methods we changed were:

public void textChange()
{
;

super();

element.delAutoCompleteString(this);

qbrName.value("*" + this.text() + "*");
CustTable_ds.executeQuery();
}

public void enter()
{
#define.WM_KEYDOWN (0x0100)
#define.VK_END (0x23)
#define.VK_DOWN (0x28)

int i;

super();

if (this.text())
{
WinApi::sendMessage(this.hWnd(), #WM_KEYDOWN, #VK_END, '');
}
}

public boolean modified()
{
boolean ret;
;

ret = super();

qbrName.value("*" + this.text() + "*");
CustTable_ds.executeQuery();

return ret;
}

Maybe this could help you.

Regards,
Morten Mile

"marcin" wrote:

> Hi, I have created a form with one StringEdit (ItemId) and a Grid containing
> records from the InventTable. I have built a query range (qbr) on
> InventTable.ItemId. When user types chars in the StringEdit control my code
> filters InventTable by mean of overriden method:
>
> public void textChange()
> {
> super();
> qbr.Value(StrFmt('%1*',ItemId.ValueStr()));
> InventTable_DS.ExecuteQuery();
> }
>
> everything works fine except fact that ExecuteQuery() causes my StringEdit
> to get focus - so all text is selected... any ideas? Regards, marcin

marcin

11/15/2005 11:49:00 AM

0

Thanks Morten, it solves my problem. It really does not work when holding
shift key. You can type upper case letters with caps lock on. Anyway in my
case ItemIds are pure numbers. Regards, Marcin