BilgeAdam Commons
Overview
This module provides various java and javascript actions that are usable for every project.
Documentation
JA_ConvertListToJson
Purpose : Converts a List to json string as output.
JA_ConvertListToString
Purpose : Converts List to plain string by using row and field seperators.
JA_UniqueList
Purpose : Removes duplicate objects from list.
JA_EnumConvertList
Purpose: Converts an Enumeration data type into a list type within a Mendix application.
Typical Usage Scenario: When you need to display Enumeration values in a dropdown or a list view, use this action to convert the Enumeration into a list that can be easily iterated over in the UI.
JA_GetLastItemOfList
Purpose: Retrieves the last element of a given list.
Typical Usage Scenario: Use this action when you need to display or process the last item of a list, such as showing the most recent order in a list of orders.
JA_GetRandomElementsFromList
Purpose: Retrieves a random element from a list.
Typical Usage Scenario: Ideal for scenarios where you need to display a random item from a list, such as a "Featured Product" on a shopping site.
JA_RandomizeList
Purpose: Randomizes the order of elements in a list.
Typical Usage Scenario: Useful in quiz applications or scenarios where you want to present items in a random order to the user.
JA_RemoveByIndex
Purpose: Removes an item from a list based on its index.
Typical Usage Scenario: Use this action when you need to remove an item from a list dynamically, such as deleting a selected item from a shopping cart.
JA_RemoveByIndexes
Purpose: Removes multiple items from a list based on their indexes.
Typical Usage Scenario: Ideal for batch deleting items, like emails or notifications, from a list based on user selection.
JA_RetrieveObjectsWithDynamicXpathByAttribute
Purpose: Retrieves objects that match certain properties using a dynamically created XPath query.
Typical Usage Scenario: Use this action when you need to filter data dynamically based on user input, such as filtering products by attributes like color or size.
JA_ReverseList
Purpose: Reverses the order of items in a list.
Typical Usage Scenario: Useful in scenarios where you need to display items in reverse chronological order, such as showing the latest comments first.
JA_SwapElements
Purpose: Swaps two items in a list based on their indexes.
Typical Usage Scenario: Can be used in user interfaces that allow manual sorting or reordering of items, such as prioritizing tasks in a to-do list.
JavaScript Actions Documentation
JS_CumulativeTotal
Purpose: Calculates the cumulative sum of elements in a list based on a provided attribute.
Typical Usage Scenario: Useful in financial applications for calculating running totals, such as a balance over a series of transactions.
JS_GetLastItemOfList
Purpose: Retrieves the last item of the list.
Typical Usage Scenario: Similar to its Java counterpart, use this for client-side operations where the last item of a list needs to be used or displayed.
JS_GetRandomElementFromList
Purpose: Generates a list of randomly selected elements from the original list.
Typical Usage Scenario: Ideal for creating a "shuffle" feature in applications, like a music app's shuffle playlist function.
JS_RandomizeList
Purpose: Randomizes the list.
Typical Usage Scenario: Similar to JA_RandomizeList but used for client-side list manipulations where the order needs to be randomized without affecting the database.
JS_RemoveByIndex
Purpose: Deletes an item from a Mendix list based on its index without committing to the database.
Typical Usage Scenario: Use this for client-side deletions where the removal should not be immediately permanent, such as editing a list of items before final submission.
JS_RemoveByIndexes
Purpose: Deletes multiple entries from a list based on entered indices.
Typical Usage Scenario: Similar to JS_RemoveByIndex but for multiple items, useful in user interfaces that allow selecting multiple items for deletion.
JS_ReverseList
Purpose: Reverses the selected list.
Typical Usage Scenario: Client-side manipulation of lists where the order needs to be reversed, such as displaying messages in reverse order.
JS_SwapElements
Purpose: Swaps two items in a list based on their indexes.
Typical Usage Scenario: Similar to JA_SwapElements but for client-side manipulations, like adjusting the order of elements before saving them to the database.
Features and limitations
- Versatile List Manipulation: The module offers a wide range of actions for manipulating lists, including sorting, reversing, randomizing, and retrieving specific elements. This allows developers to efficiently handle data collections in their applications.
- Dynamic Data Retrieval: With actions designed to retrieve objects based on dynamic XPath queries, the module facilitates flexible and powerful data fetching capabilities, enabling developers to build complex data-driven functionalities with ease.
- Client-side Enhancements: JavaScript actions included in the module enable client-side list manipulations, such as element swapping and index-based deletions, enhancing the user experience without the need for server-side processing.
- Enhanced UI Interactions: The module supports the creation of more interactive and dynamic user interfaces by allowing real-time list modifications based on user input or actions.
- Easy Integration: Designed to be easily integrated into any Mendix project, the module provides straightforward actions that can be utilized without extensive coding, making it accessible to developers of varying skill levels.