How can i customize the Select2 Pattern Options?

Hi,
i have a Custom Form with a Multiselect List. In Plone5 it is rendered as a SelectFieldWidget from plone.app.widgets. I would like to modify the pattern-options for pat-select2. If i do this via the Resource-Registry Pattern-Option-Tab then it's global. That is not what i want.
I would like change the Pattern Option only in this Custom Form. What should i do? Can i set the Option in updateWidgets-Method? Or should i register a PatternSettingsAdapter like this:

# https://www.nathanvangheem.com/news/customizing-javascript-pattern-options-in-plone-5
import json
from Products.CMFPlone.interfaces import IPatternsSettings

class PatternSettingsAdapter(object):
    implements(IPatternsSettings)

    def __init__(self, context, request, field):
        self.request = request
        self.context = context
        self.field = field

    def __call__(self):
        return {'data-pat-select2': json.dumps({"placeholder": "Select a Category"})}
<adapter
    for="* * *"
    factory=".mymodule.PatternSettingsAdapter"
    provides="Products.CMFPlone.interfaces.IPatternsSettings"
    name="mymodule_settings" />

Here is another Question: what mean the zcml Attribute for="* * *". I only know "*" or "concrete.Interfaces" but what means the three asterisks?

Thats my Form:

# Schema Definition of Form
class ITestSelectWidgetForm(model.Schema):
    
    directives.widget(jobcategories='plone.app.z3cform.widget.SelectFieldWidget')
    jobcategories = schema.List(
        title=_(u'Categories'),
        description=_(u'Please select....'),
        value_type=schema.Choice(
            vocabulary="my.jobabo.jobcategories",
        )
    )

# The Form
class TestSelectWidgetForm(AutoExtensibleForm, form.Form):
    
    schema = ITestSelectWidgetForm    
    ignoreContext = True
    label = _(u"Criteria")
    description = _(u"")
    
    def __init__(self, context, request):        
        super(TestSelectWidgetForm, self).__init__(context, request)        
        self.context = context
        self.request = request
    
    def updateFields(self):
        logger.info("in updateFields")
        super(TestSelectWidgetForm, self).updateFields()
        
    def updateWidgets(self):
        logger.info("in updateWidgets")      
        super(TestSelectWidgetForm, self).updateWidgets()
    
    def updateActions(self):
        logger.info("in updateActions")
        super(TestSelectWidgetForm, self).updateActions()
        
    def update(self):
        logger.info("in update")
        super(TestSelectWidgetForm, self).update()
        
    @button.buttonAndHandler(u'Ok')
    def handleApply(self, action):
        logger.info("in handleApply")
        data, errors = self.extractData()
        if errors:
            # TODO Handle the Errors
            return
        
        self.status = "Thank you very much!"

    @button.buttonAndHandler(u"Cancel")
    def handleCancel(self, action):
        logger.info("in handleCancel")

# The View
TestSelectWidgetFormView = wrap_form(TestSelectWidgetForm)

I think something like directives.widget('jobcategories', SelectFieldWidget, pattern_options={'myoption': 'myvalue'})

Notice how directives.widget is setup a bit differently. Doing it this way allows you to provide params to the widget when initialized.

Thanks, that worked

i've tried to use the example of pattern options described here:
http://plone.github.io/mockup/dev/#pattern/pickadate

<input class="pat-pickadate" value="00:00" data-pat-pickadate="date:false"/>

Based on your reply i wrote down the following field definition on a schema

field = schema.Datetime( title=_(u"Field Title"), required=True, ) directives.widget('field',DatetimeFieldWidget,pattern_options={'date':'false'})
Nothing happens. What i am doing wrong?

See https://training.plone.org/5/mastering-plone/dexterity_3.html#directives for documentation with examples including pattern-options and custom forms

Thanks, but I have not been able to do it yet using directives and following the documentation you ponited me out
.
What i'm trying to do is to render only a time widget (without the date part). Maybe form directives is not the way to acomplish the task.

Based on the documentation of the pattern (https://github.com/Patternslib/pat-date-picker) for the 'date' property, "Date widget options described here. If false is selected date picker wont be shown"

directives.widget(
        'field',
         DatetimeFieldWidget,         
         pattern_options={
            'date': False, //this doesn't work also with 'date':'false'
            'time': {'interval': 60, 'min': [7, 0], 'max': [19, 0]}, //this works!!
         }

Thank you very much for your help