Skip to main content
Improved English
Source Link
mickmackusa
  • 4.8k
  • 4
  • 18
  • 48

Since there isare no additional comments or answers for more than 24hrs, I will assume my approach was a valid one soand I will just post it here as an answer.

After further digging I found out that FormBehaviorTrait dispatches event onPrepareForm whichwhich is perfect for loading the field prefix.

The downside, or rathererather the inconvinieceinconvenience, of this apporachapproach is the requirement to create a getFormVactorygetFormFactory method. NotThis is not a big deal, but also not really something I'm willing to spend my 5s of time on.

What I did was to just copycopied the dispatch part from preprocessForm method of the trait into my componentscomponent's model and addingadded the prepareForm event method in the plugin.

It works this This way worked for me.

Since there is no additional comments or answers for more than 24hrs I will assume my approach was a valid one so I will just post it here as an answer.

After further digging I found out that FormBehaviorTrait dispatches event onPrepareForm which is perfect for loading field prefix.

The downside, or rathere the inconviniece, of this apporach is requirement to create a getFormVactory method. Not a big deal but also not really something I'm willing to spend my 5s of time on.

What I did was to just copy the dispatch part from preprocessForm method of the trait into my components model and adding prepareForm event method in the plugin.

It works this way

Since there are no additional comments or answers, I will assume my approach was valid and I will post it here as an answer.

After further digging I found out that FormBehaviorTrait dispatches event onPrepareForm which is perfect for loading the field prefix.

The downside, or rather the inconvenience, of this approach is the requirement to create a getFormFactory method. This is not a big deal, but also not really something I'm willing to spend my time on.

I copied the dispatch part from preprocessForm method of the trait into my component's model and added the prepareForm event method in the plugin. This way worked for me.

Source Link
S-C
  • 1
  • 2

Since there is no additional comments or answers for more than 24hrs I will assume my approach was a valid one so I will just post it here as an answer.

After further digging I found out that FormBehaviorTrait dispatches event onPrepareForm which is perfect for loading field prefix.

The downside, or rathere the inconviniece, of this apporach is requirement to create a getFormVactory method. Not a big deal but also not really something I'm willing to spend my 5s of time on.

What I did was to just copy the dispatch part from preprocessForm method of the trait into my components model and adding prepareForm event method in the plugin.

It works this way