• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Tabbed Options

Tabbed Options

DragonByte Tech

Well-known member
#1

[xFv]

Previously Cylent1
#2
Thank You for posting this here!

I am stuck at the making a event code listener part.
I named the php file to MacroRender.php.
This is my namespace: xFv\Test\Listener.
and this is what I have in the code event listener and the php file: xFv\Test\Listener\MacroRenderas namespaces.

Also stuck at the admin template part it throws a red box error
saying it cant find my template while the admin template is made already with what you listed.
What is the Value formatting parameter you use for the template?
 
Last edited:

DragonByte Tech

Well-known member
#3
That's not the correct namespace, feel free to have a look at all other XenForo 2 files for the correct way of using name spaces and class names.


Fillip
 

[xFv]

Previously Cylent1
#4
That's not the correct namespace, feel free to have a look at all other XenForo 2 files for the correct way of using name spaces and class names.


Fillip
The "Listener" is not in my namespace, its just the folder the php file sits in.
this is my file structure leading to the php file, src\addons\xFv\Test\Listener\MacroRender.
where MacroRender is the php filename right?
How is this not right?
 

[xFv]

Previously Cylent1
#6
I am confused with this...
Do I make multiple option groups and use those for the tabs?
Or do I create multiple options in 1 group for the tabs?
 

Jaxel

Well-known member
#8
There is an issue with this... If you click "save" on the form, and one of your options fails a validation check for whatever reason (for instance, if you have max=50 and the user inputs 51).

Normally, XF will return an easy helper notice:
Please enter a valid value. The nearest valid value is 50.
However, with the tabbed options, if said failed validation check is not on the currently focused tab, there will be a javascript error, no save will execute, and there is no notification to the user.
An invalid form control with name='options[MyNS_MyOption]' is not focusable.
 

DragonByte Tech

Well-known member
#9
There is an issue with this... If you click "save" on the form, and one of your options fails a validation check for whatever reason (for instance, if you have max=50 and the user inputs 51).

Normally, XF will return an easy helper notice:


However, with the tabbed options, if said failed validation check is not on the currently focused tab, there will be a javascript error, no save will execute, and there is no notification to the user.
Not really much I can do about that I don’t think, sorry.


Fillip