• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

can i use fabrik similar to a cash register?

hi

about this code, cant get it to work.

Code:
/*
  * Adds a 'fabrik.loaded' event, which fires when the main Fabrik object has finished initializing
  * on page load, and Fabrik is all loaded up and ready to go.  Within that, add a 'fabrik.form.autofill.update.end' event,
  * which will fire when an autofill is finished on the form.  Within that, fire a doSubmit() for the form.
  */
window.addEvent('fabrik.loaded', function () {
  Fabrik.addEvent('fabrik.form.autofill.update.end', function (form, json) {
      form.form.doSubmit(new Event.Mock(form.form._getButton('Submit')), form.form._getButton('Submit'));
  });
});

first of all there is no ./components/com_fabrik.php, what exists is fabrik.php. i tried to create an external js file using the code above and added this code to the php file.

Code:
<SCRIPT type="text/JavaScript" SRC="form_x.js"></SCRIPT>


i get a syntax error. the file located in the root.


im i doing it right?

thanks
 
Ooops, I mis-typed my instructions in that post. I've fixed that post. It should have said to put the file in the ./components/com_fabrik/js folder.

And remember to rename the file, where X is your numeric form ID (the number in the left most column of your main forms list on the backend). So form_3.js, or whatever, not form_X.js.

Once you get the name right, and it's in the js folder, it will automatically load for that form.

-- hugh
 
where do i place this code
Code:
<SCRIPT type="text/JavaScript" SRC="form_x.js"></SCRIPT>

what while trigger the js file?

thanks
 
You don't need that code. Like I said, once you have the file in the js folder with the right name, it will get automatically included by Fabrik.

-- hugh
 
Seems to be working now on the page you pointed me at in live chat. The form_4.js is loading, the event is getting attached on page load, and the form is automatically submitting when I make an autofill selection from the 'security code' menu.

-- hugh
 
hi hugh

i updated to the lates git,experiencing a few problems

1. Notice: Undefined property: FabrikFEModelList::$orderBy in /home/xxx/public_html/components/com_fabrik/models/list.php on line 2629

Warning: array_key_exists() expects parameter 2 to be array, null given in /home/xxx/public_html/components/com_fabrik/models/list.phpon line 2629

2. in the element with autofill on the form, i decided to change it to autocomplete. my problem is that the autofill is not working, after displaying the existing records it just stays there. is there a setting that i should change between dropdown and autofill?

3. is it possible to put the focus of a particular form in 1 element or field everytime it submits?


thanks
 
1 / odd as for me $orderBy is defined in line 406:

Code:
public $orderBy = array();
so it should be defined and an array - could you check if that line shows the same code?

2/ I think this one was fixed this morning (are you using Joomla 2.5 with fabrik 3.1?)

3/ Say you are in the code you first listed (so the variable form is available...)

Code:
form.getElement('tablename___elementname').focus();
would be your best bet, but its no implemented for all plugin types. but a simple field will work
 
1. this line is consistent, but still getting errors
Code:
public $orderBy = array();

2. im using joomla 3.2, i got this to work. my problem now is to modify the code so that js will fire when a matched has been found with out clicking on anything. What happens at the moment is that auto complete fires first while typing then you have to click on the suggested code or click on anything else then the js fires. can we make the js fire based on a match text or data?
i dont think on blur is what i need since user still needs to click on something to take the focus out of the element or field.

3. im using a database join element plugin, is this ok? where do i insert the code? is this correct?

Code:
/*
  * Adds a 'fabrik.loaded' event, which fires when the main Fabrik object has finished initializing
  * on page load, and Fabrik is all loaded up and ready to go.  Within that, add a 'fabrik.form.autofill.update.end' event,
  * which will fire when an autofill is finished on the form.  Within that, fire a doSubmit() for the form.
  */
window.addEvent('fabrik.loaded', function () {
  Fabrik.addEvent('fabrik.form.autofill.update.end', function (form, json) {
      form.form.doSubmit(new Event.Mock(form.form._getButton('Submit')), form.form._getButton('Submit'));
  });
});
 
form.getElement('tablename___elementname').focus();
 
1. this line is consistent, but still getting errors
I think it might be a PHP version difference, which means that I'm not seeing that error. I did see it on another site yesterday and have fixed it with this commit :
https://github.com/Fabrik/fabrik/commit/4f1490cbe9613e36704c78d4f398e7a715a8355f

What happens at the moment is that auto complete fires first while typing then you have to click on the suggested code or click on anything else then the js fires. can we make the js fire based on a match text or data?
I think the issue here is that nothing is matched until you click on a selection, kind of a chicken and egg situation? I've read through the thread but I'm not sure what url we are referring to - could you let me know as its hard to comment on the best solution at the moment.
 
that site url isnt working for me, normally we're on the chat on the sites homepage - but i've not been on there today (had to get my UK tax declaration done booo!)
 
OK, I had a chance to chat with Ron on Sunday evening.

What he's trying to do doesn't quite "fit" in to the current design of the autofill plugin. He wants to use a bar code scanner to enter the text (a product code) into the trigger field, and just have it fire the autofill, without having a menu come up. The assumption being that as the code has been entered by scanning something, it will exist in the table, and doesn't need "human intervention" to select from a list of matching records.

I don't really see any way of achieving this without adding a new option to the plugin, which bypasses the normal JS handling (firing an AJAX request as each character is types, building a menu from the response, etc), but instead just waits for an 'enter' on the field, then fires the AJAX, and on the return from the AJAX, checks that it just got one matching FK/label pair, and automatically fires the actual autofill rather than building an options menu.

rob - can you think of any shortcut to doing this, without those fairly extensive mods to the plugin.

-- hugh
 
What he's trying to do doesn't quite "fit" in to the current design of the autofill plugin. He wants to use a bar code scanner to enter the text (a product code) into the trigger field, and just have it fire the autofill, without having a menu come up. The assumption being that as the code has been entered by scanning something, it will exist in the table, and doesn't need "human intervention" to select from a list of matching records


better if, once match is found a comment or popup will appear "match found processing..." is none just plain no "no records found"

I don't really see any way of achieving this without adding a new option to the plugin, which bypasses the normal JS handling (firing an AJAX request as each character is types, building a menu from the response, etc), but instead just waits for an 'enter' on the field, then fires the AJAX, and on the return from the AJAX, checks that it just got one matching FK/label pair, and automatically fires the actual autofill rather than building an options menu.

no need for user input or enter please, once match is found, autofill completes the form and js fires.

also after submission how do we make the focus return to the triger field or any field?

thanks
 
well doesn't the barcode reader send an enter as the last key (the last time i looked at one of those (10+years ago!) thats what they did, so I think Hugh was proposing that that automatic enter would fire the lookup.
We talked about it and we said that if you could state after how many characters the autocomplete look up started then you could get it to do only one search (providing that the bar codes are all the same length) And even if you fired a couple of requests its not really a biggy - a new request simply cancels the previous.

So probably to my mind not that much of a alteration to the existing code. I believe Hugh was going to look at it further today.
 
we are looking at 12 to 16 characters, its will be ok to start with 16, just teach me which part of the code i can edit so i can change it to what is better, if possible

BTW, after submission or on load, how do we make the focus return to the triger field or any field?

form.getElement('tablename___elementname').focus();

where do i place this code? tried before and after the js but still no success...

thanks
 
This should now all be working - it's working on my test site with the latest github. The main autofill JS has a new option in it, 'autoLoadSingleResult', which defaults to true. So Ron's setup should now work. The autofill should autoselect when his scanner inputs the ID, a single result should be returned, and the little event handler I specified in an earlier post should then automatically submit the form.

Ron -let me know if this isn't happening.

-- hugh
 
Ah, I just spotted a little bug that still needs fixing to get this to work with 'single option auto select'.

FYI, re the email I saw this morning, the changes aren't in 'autofill', they are in autocomplete.js and autocomplete-bootstrap.js.

-- hugh
 
Just FYI, I'm still working on this. The "little bug" has turned out to be quite elusive.

I've gotten it all working happily so the join element's autofill will auto-select if there is only one option returned. It skips putting up the options menu, and just triggers the selection, as if you had selected that item. That then fires the event that *should* then trigger the form autofill plugin to it's thing ... but for reasons as yet unclear to me, that's only working about half the time. Some kind of weird Javascript event timing issue.

I'm really hoping to get it resolved today, just had an idea for a slightly different approach I can use which might avoid that issue entirely.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top