In classic I used dynamic combo boxes all the time in my dashboards. We often start with a user-provided value like part number from a text box. This is used to populate and filter the subsequent combo boxes. For example, when the user types in a part number and leaves that field I trigger an event to look at the value they typed in and if it isn’t blank, use that as the parameter for a BAQ that populates the part revision combo box. In classic I would use this:
private void MyPartNum_Leave(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
if (MyPartNum.Text!="")
{
getRevs();
cmbRevs.ForceRefreshList();
}
}
private void getRevs()
{
cmbRevs = (Ice.Lib.Framework.EpiUltraCombo)csm.GetNativeControlReference("a03dd350-74a0-4382-b1cb-251c5e41ed9a");
DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
dqa.BOConnect();
QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("getPartRev");
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("part", MyPartNum.Text, "nvarchar", false, Guid.NewGuid(), "A");
dqa.ExecuteByID("getPartRev", qeds);
if (dqa.QueryResults.Tables["Results"].Rows.Count > 0)
{
cmbRevs.DataSource = dqa.QueryResults.Tables["Results"];
cmbRevs.DisplayMember = "PartRev_RevShortDesc";
cmbRevs.ValueMember = "PartRev_RevShortDesc";
cmbRevs.DropDownStyle = Infragistics.Win.UltraWinGrid.UltraComboStyle.DropDownList;
oTrans.NotifyAll();
}
else
{
cmbRevs.DataSource = "";
cmbRevs.DisplayMember = "";
cmbRevs.ValueMember = "";
oTrans.NotifyAll();
MessageBox.Show("Part Not Found in Any Open Jobs!");
}
}
How do I set the value BAQ source, display field, and value field for the unbound combo box?
The version I did used dataviews to populate the combos.
You can use a ColumnChanged event from the first combo epBinding to trigger a dataview-filter-set on the next dataview bound to the combo.
My BAQ that populates one of my combo boxes is a simple parameter driven BAQ:
select
[PartRev].[RevisionNum] as [PartRev_RevisionNum],
[PartRev].[RevShortDesc] as [PartRev_RevShortDesc]
from Erp.PartRev as PartRev
where (PartRev.PartNum = @part)
In classic I would define the parameter with this line: qeds.ExecutionParameter.AddExecutionParameterRow(“part”, MyPartNum.Text, “nvarchar”, false, Guid.NewGuid(), “A”);
How do I do this in Kinetic? I have created a dataview to popluate the ParRev combo box. dvPartRevs. I used the built in wizard and it created the DV and a get event for that DV. Neat!
But I still can’t figure out how to apply my value from a txt box as the parameter feeding the next combo box. I created an event myPartNum_onBlur. The first thing it checks is if you put a value in the text box. If you did, then it should use that value to filter the PartRev BAQ.
I created that dv for the revision combo box. called dvPartRevs. I created the event myPartNum_onBlur. I added the dataview-filter-set to this event (only fires if PartNum is not empty). I set the dv to dvPartRevs and the filter to PartRev_PartNum=‘{TransView.myPartNum}’. I can see that my part number is going into the filter correctly, but my combo box never populates. I can see the headers, but no values.
How do the EpBinding and the dataview relate to each other in regards to this combo box? I have set the EpBinding for the combo box to TransView.myRev.
My thinking is that TransView temporarily holds whatever the user inputs/selects from combo boxes. Once TransView has all the data needed for a new record, the user can click the add record button and a UBAQ BPM would pull the data from the transview and populate the UD table. I haven’t gotten to this part yet, I just need to get the combo boxes to populate correctly.
As of 2025.1, the only way you can specify parameters to send to a BAQ is with the ```kinetic-baq`` event widget (or whatever the name du jour is).
Presumably, you set your epBinding on ComboBox1 (let’s call it TransView.C1).
You would have a ColumnChanged event on TransView.C1.
Within that event, you can call your BAQ with the kinetic-baq widget and specify the value for the parameter here:
So I have found it cleaner and simpler to just use a text box, and then click Enable Search under advanced options. You can then configure a baq search in your on search click behavior, and preload the search filter with your parameter. Yeah I know, its not a combo.
I suppose there’s no hope for a combo that filters as you type - ideally server-side so it doesn’t take forever to load options I don’t need. pretty common pattern in web frameworks (including kendoUI).
Yeah I was reading that last night and thinking about trying to set .rowFilter property in an event, but I think the problem is which event triggers upon typing in the combo? AFAIK, the only one is onColumnChanging for a dataView, maybe?
Well if it makes you feel better, that demo was specifically for adding a dynamic combo to a BPM form, because they are not customizable in Kinetic. That method was never intended to be used for regular combo boxes.
Hannah’s example with the events is the way to go.