Telegram_2022-06-24T04

<< Click to Display Table of Contents >>

Navigation:  Telegram > 2022 > 06 > 24 >

Telegram_2022-06-24T04

Telegram link

 

2022-06-24T04:11:58

 

Your event OnAsyncChange of IWSearchField is wrong. You are clearing and adding items to the wrong combobox.

 

procedure TIWFormSearch.IWSearchFieldAsyncChange(Sender: TObject;

 

EventParams: TStringList);

 

begin

 

IWSearch.Clear;

 

if IWSearchField.ItemIndex = 0 then

 

begin

 

IWSearch.Items.add('AUDI');

 

IWSearch.Items.add('FIAT');

 

IWSearch.Items.add('SEAT');

 

end

 

else

 

if IWSearchField.ItemIndex = 1 then

 

begin

 

IWSearch.Items.add('APPLE');

 

IWSearch.Items.add('BANANA');

 

IWSearch.Items.add('STRAWBERRY');

 

end;

 

IWSearch.RefreshItems;

 

end;

 


 

Telegram link

 

2022-06-24T04:12:04

 

This is the correct code and it works as expected

 


 

Telegram link

 

2022-06-24T04:16:48

 

However, the template is causing the update to fail.

 

if you disable your template you will see that it works correctly.

 

the point with the template is that the bootstrap library is changing the control at runtime into a list with links (it is not a combobox anymore), so the update won't work

 


 

Telegram link

 

2022-06-24T04:18:17

 

How can i disabile Template? Sorry i m new to use intraweb

 


 

Telegram link

 

2022-06-24T04:22:51

 

Any help?

 


 

Telegram link

 

2022-06-24T04:25:11

 

ok if i disable template i don' t have search box in combobox....

 


 

Telegram link

 

2022-06-24T04:42:33

 

the template uses the bs select. you need to refresh it:

 

WebApplication.CallbackResponse.AddJavaScriptToExecuteASCData('$(\.selectpicker\).selectpicker(\refresh\);');

 


 

Telegram link

 

2022-06-24T04:43:43

 

this is not IW, but how Bootstrap select works. The select don't detect the change of the underlying ComboBox, so you need to refresh it yourself

 


 

Telegram link

 

2022-06-24T04:43:51

 

procedure TIWFormSearch.IWSearchFieldAsyncChange(Sender: TObject;

 

EventParams: TStringList);

 

begin

 

IWSearch.Clear;

 

if IWSearchField.ItemIndex = 0 then

 

begin

 

IWSearch.Items.add('AUDI');

 

IWSearch.Items.add('FIAT');

 

IWSearch.Items.add('SEAT');

 

end

 

else

 

if IWSearchField.ItemIndex = 1 then

 

begin

 

IWSearch.Items.add('APPLE');

 

IWSearch.Items.add('BANANA');

 

IWSearch.Items.add('STRAWBERRY');

 

end;

 

IWSearch.RefreshItems;

 

WebApplication.CallbackResponse.AddJavaScriptToExecuteASCData('$(\.selectpicker\).selectpicker(\refresh\);');

 

end;

 


 

Telegram link

 

2022-06-24T04:51:57

 

Ok It Works... But when i change from CARS to FRUIT or viceversa i don' t have any more 'Nothing selected' but i have Empty Combobox

 


 

Telegram link

 

2022-06-24T04:52:46

 

The

 

othing selected\ is something from BS select, not IW. I will need to check how to restore it