Can you please try using the OnAsyncCheckClick event instead. This event has an Index parameter that contains the index value of the CheckBox that was clicked.
1. Wrap the TTIWCheckListBox items with a span that changes the cursor to a pointer and that calls a javascript function of the intraweb form on which the TTIWCheckListBox resides that will trigger a calback to the Intraweb server ...
This example procedure would build something like that ...
procedure TExampleIntrawebForm.UpdateCheckListBox;
var
sl: TStringList;
I: Integer;
begin
sl := CheckListBoxItems.Items;
UserSession.DM.GetCheckListBoxData(sl);
for I := 0 to sl.Count - 1 do
begin
sl.Strings := '<span style=''cursor: pointer'' onclick=calliw(''' + sl.Strings + ''')>' +
sl.Strings + '</span>';
end;
clbParticipants.Invalidate;
end;
This code results in items that call the javascript function calliw with the text of the item as parameter ...
2. Implement the Javascript function to do the callback to the Intraweb backend in the Javascript property of the form containing the checklistbox ...
function calliw(event){ executeAjaxEvent("&itemtext="+event, null,"OnItemClick",false, null, false); };
This code calls the OnItemClick in the Intraweb Backend. The thing not very easy to figure out is the way how you need to pass the additional parameters via "&itemtext="+event
3. In the Intraweb form implement the callback function
procedure TExampleIntrawebForm.OnItemClick(EventParams: TStringList);
begin
DoSomethingWithTheItemText(EventParams.Values['itemtext']);
end;
4. Further you need to register the callback OnItemClick with the Intraweb backend
procedure TExampleIntrawebForm.IWAppFormCreate(Sender: TObject);
begin
WebApplication.RegisterCallBack('OnItemClick', OnItemClick);
end;
Then we have clickable itemtext to and a clickhandler in the backend.
@Bart: Couldn't something like this be implemented in the standard components?