I have a specific requirement of showing categories of selected menu language only. So in my component, I have the field declared as below.
<field name="catid" type="categoryedit" label="JCATEGORY" description="JFIELD_CATEGORY_DESC" class="inputbox input-block-level" required="true"></field>
And in my Model, I am setting the field attribute dynamically based on the menu language.
public function getForm ($data = array(), $loadData = true)
{
....
$language = JFactory::getLanguage()->getTag();
$form->setFieldAttribute('catid', 'language', $language);
....
}
It works perfectly fine. However the only problem is it shows only the list which are meant for the selected language only, for example en-GB will show only list of values which are assigned to the language en-GB.
I need to display all the field values which are assigned to the selected language as well as "All" (or "*", i.e. no language selected).
I cannot set two values to the same field attribute, setting it two time overwrite fist.
$form->setFieldAttribute('catid', 'language', '*');
This doesn't work at all
$form->setFieldAttribute('catid', 'language', $language.', *');
Anyone has any idea how can I do this?