User tests: Successful: Unsuccessful:
This patch will fix showon
feature, when it used on the field with multiple
attribute
how to test
add two field in template, module or menu item configuration:
<field name="test1" type="list" label="Test 1">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field name="test2" type="list" multiple="true" showon="test1:1" label="Test 2">
<option value="1">Val 1</option>
<option value="2">Val 2</option>
<option value="3">Val 3</option>
<option value="4">Val 4</option>
</field>
And try change the value in "text 1" field
expected result
Field "Test 2" must be visible only when in "Test 1" selected "Yes",
actual result
Field "Test 2" always visible
Apply patch and make sure that it work as expected.
Labels |
Added:
?
|
Easy | No | ⇒ | Yes |
Category | ⇒ | Libraries |
yes, for me it works good without this patch. Mebay someone else can test this PR to?
ok, answer is simple, there the fields rendered in different way
please do test in other places: template, module or menu item configuration,
I updated the description
@test successful, now it works as expected :-) Tested in mod_custom
@test successful
p.s.
maybe could be out of scope of this pr
i was wondering about this scenario
<select name="mys">
<option value="" disabled="disabled" selected="selected">Please select an option</option>
<option value="1">One</option>
<option value="2">Two</option>
....
....
<option value="n">n-option</option>
</select>
in this situation could be usefull to trigger the showon feature when any of a "real" options is selected
the .xml syntax could be something like this:
showon="mys:*"
cause this syntax
showon="mys:1,2,...n"
could not be suitable if the parent select option values are dynamic (ie loaded from a query)
what do you think ?
using RegExp became too complex imho even if more powerfull,
i like power of simplicity
Status | Pending | ⇒ | Ready to Commit |
RTC Thanks for tests and coding here!
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-04-04 12:58:10 |
Labels |
Removed:
?
|
@test without applying this patch, field "Test 2" is only visible when field "Test 1" is selected "Yes".
Tested on Joomla! 3.4.2-dev staging in the global configuration form.