Failure

User tests: Successful: Unsuccessful:

avatar cheesegrits
cheesegrits
30 Apr 2013

"repeat" form elements. Should have zero impact on anyone else. This
will allow Fabrik to stop overriding these two classes.

Tracker request:

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=30781

avatar cheesegrits cheesegrits - open - 30 Apr 2013
avatar nonumber
nonumber - comment - 1 May 2013

Can you give testing instructions and explain how this would work in real live?
What do you want to repeat? How do you use this in the xml/php?

avatar cheesegrits
cheesegrits - comment - 1 May 2013

I just followed up on the tracker. Basically, the test is just "nothing should happen", as all it does it add a very small change to allow Fabrik to create "repeatable elements", and should have zero impact on anything else. For an example of how we do this, see Rob's response on the JSOC thread:

https://groups.google.com/forum/#!topic/joomla-gsoc-2013/B-RShcBsQI8

So yeah, at the moment all it does is allow Fabrik to do what it does. But repeatable jField elements are intrinsically useful, and this adds the basic building block for other components to roll their own repeatable element types.

I'll take some screenshots of how we use this, and post them.

avatar cheesegrits
cheesegrits - comment - 1 May 2013

I just followed up on the tracker. Basically, the test is just "nothing should happen", as all it does it add a very small change to allow Fabrik to create "repeatable elements", and should have zero impact on anything else. For an example of how we do this, see Rob's response on the JSOC thread:

https://groups.google.com/forum/#!topic/joomla-gsoc-2013/B-RShcBsQI8

So yeah, at the moment all it does is allow Fabrik to do what it does. But repeatable jField elements are intrinsically useful, and this adds the basic building block for other components to roll their own repeatable element types.

I'll take some screenshots of how we use this, and post them.

avatar cheesegrits
cheesegrits - comment - 1 May 2013

OK, I don't know how much you know about Fabrik, but one of the things we do is display "lists", based on database tables. When adding a J! menu item for a Fabrik list, two of the options you have are a) pick the fields you want displayed in the list, and b) to define any number of "pre filters". Internally, we then use those params to build the field selection and WHERE clause for the table select.

So here's our options for the List menu item. Which as you can see has "Select" buttons for "Show in list" and "Pre filters". Which, when clicked, pop up the 'modal repeat' jField type Rob described in the JSOC thread referenced in my previous post.

In this case, I'm displaying a list which includes city and state names, and I'm using the "Sow in list" to select just three fields from the table, and the "Pre filters" to only show rows from Birmingham and Huntsville, Alabama.

prefilter_button

elements_modal

prefilter_modal

We also use the 'repeat' feature in simpler, non modal element types, but this is a good visual example of how useful this is for building more complex jField element types.

And really, all the code we added to jField does, is handle appending the 'repeat count' to the repeated form input names and ID's.

-- hugh

avatar nonumber
nonumber - comment - 2 May 2013

Correct me if I am wrong, but to me this seems like something that needs a lot of custom code work to be able to use.
At this moment it looks like this fix is only to cater for Fabrik, and I don't see how others can benefit from it.
Unless there are ready-to-use elements/fields to use this, and the examples to show how, I don't really see why this should have to go into core.

avatar pollen8
pollen8 - comment - 2 May 2013

well currently what we experience, is every time a new version of Joomla is released we have to re-override a script.
If other components are doing the same thing this can cause cross compatibility issues. So yes, currently its primarily to help Fabrik but it also helps any Joomla user who is installing a certain combination of components. We're overriding an entire class for a very small change which just feels wrong and is a source of frustration.

I'm also hoping that the gsoc fields project will incorporate our work on repeating groups into the core, so we will be providing ready to use elements which will go into the core (if approved)

As there are no negative effects and this is an initial step towards those ready to use elements, I can't see the harm in adding it?

avatar cheesegrits
cheesegrits - comment - 2 May 2013

Seems like you could shoot any new feature capability in J! down on the basis that it doesn't immediately benefit anyone but the person contributing it.

We'd be more than happy to provide examples of how to use it, in whatever format and location is deemed most appropriate, and if this request is accepted, we would then submit the element types we built to use it in another pull request, like the modal repeat shown in my previous post. It just didn't seem worth while for me to re-code our hacked jField element types into the core for submitting with this request, if y'all weren't going to accept the basic concept.

If we were asking for major changes to J! for something which nobody else could possibly take advantage of, I'd agree with you. But we're not. This is a very small change which has zero negative impact, that provides a very useful feature for other extensions. And as mentioned above, if accepted, we will immediately submit the existing element types we have that use this as another pull request.

avatar elkuku
elkuku - comment - 2 May 2013

I can immediately imagine several use cases for this new feature for different extensions. I am surprised that @nonumber can't, being a developer of several great extension.

JForm hasn't received much updates since it was invented and is known to have several shortcomings, so if an extension dev steps up to improve it, this should be heartily welcome. I'm sure apart of contributing the code they might also write a short article on the wiki...

Nice work guys ;)

avatar cheesegrits
cheesegrits - comment - 2 May 2013

@elkuku - thanks. As mentioned in my last msg (I think we crossed in the post), we'd be more than happy to write a wiki article, and submit our element types (like the modal repeat pictured in a previous post) as a separate pull request, if the basic concept in this request is accepted.

avatar elinw
elinw - comment - 5 May 2013

I think making it easier to add repeated elements is an important improvement for JForm. It should be easier than it is, right now I think people have an number of ways of doing this but this is the first time that I've see proposed code to actually make a solution built in. I'm not sure if this is the ideal solution but it's great to see the initiative.

One of the ways open source works is that if you make an improvement that helps you locally then you share it. That helps you and it helps everyone else.

avatar cheesegrits
cheesegrits - comment - 5 May 2013

@elinw - thanks for the positive feedback.

I'm not sure about "ideal", but as far as I can tell, this is the only realistic solution. No matter how you implement a repeating element within your extension, if it's truly a 'repeating' element, then you need to have the repeat count appended to the ID attribute, myparam-X, and to the name attribute, myparam[X]. That's just HTML forms 101, if you want more than one of something. And the only way to implement this using jForm/jField is to have that happen within the jField class.

So that's what this code change does, in a way that has zero impact on existing code, making it very easy for extension devs to create their own repeating elements by just setting repeat="true" in the field attributes, and maintaining the repeat count in the jField object. And as mentioned above, if accepted, the next step would be to add a wiki article on how to do it, and adding at least one ready-rolled type to the J! core element types, in the form of the 'modal repeat' element pictured above.

avatar wilsonge
wilsonge - comment - 25 Jul 2013

Can we update the comments on this where those two comments are so this is mergeable please :) thankyou!!!

avatar elinw
elinw - comment - 26 Jul 2013

Also please update the docblocks on new methods that have been added. They should say @since 3.1.5 at this point.

For testing purposes please do one of two things.
1. At joomlacode attac a plugin that uses the code.
OR
2. Write instrucitonslike "To use this in the profile plugin make the following changes .... you should see ....."

avatar wilsonge wilsonge - reference | - 3 Aug 13
avatar wilsonge wilsonge - reference | - 20 Aug 13
avatar wilsonge
wilsonge - comment - 21 Aug 2013

This PR has been superseeded by #1644 - same feature tracker item.

avatar wilsonge wilsonge - reference | - 1 Sep 13
avatar brianteeman
brianteeman - comment - 23 Jul 2014

closed as per comment by @wilsonge

avatar brianteeman brianteeman - close - 23 Jul 2014
avatar cheesegrits
cheesegrits - comment - 24 Jul 2014

Just FYI, something got hosed up in the commit that superceded this one, so
we're still having to override JForm to do the repeat params. I'll submit
another PR / issue when I get some time.
On Jul 23, 2014 5:01 AM, "Brian Teeman" notifications@github.com wrote:

Closed #1081 #1081.


Reply to this email directly or view it on GitHub
#1081 (comment).

Add a Comment

Login with GitHub to post a comment