Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderator: ArturoRobles

#829582
amosbatto wrote: Tue Aug 22, 2017 5:46 pm I just randomly flipped through parts of the book, and it looks pretty good. I hope that you have good sales of the book.

Would you like me to make this post a sticky announcement on the forum for the next week (so it stays at the top of the list of posts)? We are always happy to see others promoting the use of ProcessMaker.

I have two observations about the book. In the beginning when installing PM with Bitnami, you should mention that Bitnami installations are generally only used for testing and developing processes. A manual installation is recommended when using processes in production, because Bitnami installations cannot be upgraded to later versions and Bitnami installations are generally slower and use more resources than manual installations.

In your JavaScript code, I recommend only using jQuery selectors. For example, you use code like this that mixes standard JavaScript and jQuery:
Code: Select all
//Register comments handler to button events
document.getElementById("form\[comment_button\]").onclick = addComments;
$("form").submit( addComments );
First of all, you don't need to escape the [ and ] characters in standard Javascript, so this will work:
Code: Select all
document.getElementById("form[comment_button]").onclick = addComments;
However, the PM Developers don't recommend using document.getElementById() to obtain the elements of a form, because the developers say that it might not always work in the ProcessMaker Mobile App, although I haven't seen an example where it doesn't work. However, it is necessary to use the custom helper functions setValue(), getValue() and setOnchange() which only work with jQuery, instead of the value and onchange properties in standard JavaScript. To avoid problems and possible confusion, we recommend always using jQuery(), even though it may be more complicated in some instances.

Officially, we recommend that you use code like this:
Code: Select all
$("#comment_button").find("button").on("click", addComments);
I personally don't like using the find() function because you have to know what HTML element you are searching for ("button", "div", "input", "select", "textarea", etc.) with each type of control, so I directly select the element through its ID "form[id]" which requires escaping the square brackets [ and ] with \\:
Code: Select all
$("#form\\[comment_button\\]").on("click", addComments );
I also don't see much reason to use .on() instead of .click() which is a shorthand that does the same thing:
Code: Select all
$("#form\\[comment_button\\]").click( addComments );
Some people find escaping with jQuery selectors to be very confusing, so they use this code:
Code: Select all
$("[id='form[comment_button]']").click( addComments );
https://thebloggerspage.com/why-security-of-random-video-chat-becomes-the-biggest-headache/
No matter which method that you choose, I do recommend using jQuery() in all instances, so that people get used to using jQuery and won't try to use document.getElementById().value and document.getElementById().onchange which will cause problems.

If you want me to review your code in the entire book, you can email me a copy of your book at amos@processmaker.com and I will look at it when I have time.
Terrific! I have just purchased a copy (I couldn't resist at that price)!
Thanks

adidas continental 80 uomo bianche è senza […]

The nike blazer mid 77 women's black is another st[…]

air jordan 1 low wolf grey

Ved at slutte sig til sin "Ideas That Connect[…]

Learn about all of the exciting new features and f[…]