Subcategory with two AutoComplete

Is there a way to use two AutoComplete widgets to select subcategories? I will use a simple model: I want to create a new object in "Campaign". After selecting a company in the form in the first AutoComplete widget (company selection), I would like to be able (in the second widget) to select only the brands that are assigned to that company. Ultimately, in "Campaign" in "ForCompany" I would like to have IdCompany and in "ForBrand" IdBrand. Unfortunately, I am not able (or do not know how) to use XPATH. Do you have any ideas on how to combine this?
2 answers

Yes, this can be done.  The XPath in the Brand selection widget would be something like:

[Brand_Company/Company/Campaign_Company = [%CurrentObject%]]



I built a small example.  I think your domain model should look like this

I changed the highlighted associations from what you posted.

Next I created this page to enter information

And finally, I created this page to enter Campaigns

The brand autocomplete is configured like this

And here is a video of this solution working


Hope that helps.



It’s looks like I cannot use  [%CurrentObject%] this widget (zabawa = module name ofc)  or I’m doing something wrong :/