Ready for review

Row creation

Last modified by Pierre Jeanjean on 2026/07/10 16:30

All changes

Summary

Details

Page properties
Default language
... ... @@ -1,0 +1,1 @@
1 +en
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -207,6 +207,9 @@
207 207  
208 208  |=Name|=Description
209 209  |template|Use this in case you have a live table with results generated from a Velocity template. The value of this parameter should match the template specified in the ##url## live table configuration using the ##xpage## query string.
210 +|hasEditMode|{{version since="18.6.0RC1"}}If set to ##true##, enable the Live Data to enter [[Edit mode>>||anchor="HEditMode"]] (default value: ##false##).{{/version}}
211 +|newRowNamingStrategy|{{version since="18.6.0RC1"}}Strategy to use to generate page names when creating new rows. Right now, the only value supported is ##uuid## which uses a random UUID for each new page and create them in the location set by ##newRowLocation##.{{/version}}
212 +|newRowLocation|{{version since="18.6.0RC1"}}Location to store pages when creating new rows. Requires a compatible row naming strategy, //e.g.//, ##uuid##.{{/version}}
210 210  
211 211  The ##extraParams## live table parameter is not listed above because its main usage is filtering, and the live data has its own **generic** way to perform filtering. If you're migrating a live table that uses ##extraParams## to live data then you should:
212 212  
... ... @@ -394,6 +394,25 @@
394 394  
395 395  The current page URL is updated whenever the live data state changes through pagination, sorting, filtering, hiding or re-ordering properties, etc. which means the live data state is bookmarkable. The live data state is preserved if you reload the page or if you give the page URL to someone else.
396 396  
400 +== Edit Mode ==
401 +
402 +{{version since="18.6.0RC1"}}
403 +Edit mode is a mode that helps with bulk editing, that can be toggled on a Live Data that explicitly supports it (//e.g.//, with the live table source, by setting the ##hasEditMode## [[source parameter>>||anchor="HParameters-1"]] to ##true##).
404 +
405 +{{image reference="liveData-editMode-toggle.png"/}}
406 +
407 +In this mode, all hidden columns are forcefully displayed, and clicking any editable cell directly opens it in edit mode. It's also possible to navigate between cells with the keyboard through Tab/Shift+Tab, with every switch saving the previously focused cell and opening the editor on the newly focused one.
408 +
409 +For sources that also support row creation (//e.g.//, live table with a properly configured ##newRowNamingStrategy## [[source parameter>>||anchor="HParameters-1"]]), a **+ Add entry** button is also available at the bottom of the table for users that have enough rights to create new content.
410 +
411 +{{image reference="liveData-addEntry.png"/}}
412 +
413 +Clicking it will create a draft row, with cells that can be navigated either by mouse or keyboard. Once all the necessary data has been set, it can be saved either by clicking on the **✓** action button on the right, or with keyboard: Return to validate, or Ctrl+Return to validate and create a new draft row again. There is also a **✗** action button on the right to cancel and delete the draft row.
414 +
415 +{{image reference="liveData-rowDraft.png"/}}
416 +
417 +{{/version}}
418 +
397 397  = Macro Configuration guide =
398 398  
399 399  == Actions ==
... ... @@ -1028,6 +1028,44 @@
1028 1028  {{/code}}
1029 1029  {{/version}}
1030 1030  
1053 +== LiveTable New Row Naming Strategy ==
1054 +
1055 +{{version since="18.6.0RC1"}}
1056 +For the live table source, new row creation requires a page naming strategy. For that, there is a specific interface:
1057 +
1058 +{{code language="java"}}
1059 +/**
1060 + * Strategy to generate the document reference of a new livetable entry.
1061 + *
1062 + * @since 18.6.0RC1
1063 + */
1064 +@Role
1065 +@Unstable
1066 +public interface LiveTableNewRowNamingStrategy
1067 +{
1068 + /**
1069 + * Generates a document reference for a new livetable entry.
1070 + *
1071 + * @param parameters the livedata source parameters
1072 + * @return the generated document reference
1073 + * @throws LiveDataException if the reference cannot be generated
1074 + * @throws XWikiException if there is a wiki-level error
1075 + */
1076 + DocumentReference generate(Map<String, Object> parameters) throws LiveDataException, XWikiException;
1077 +
1078 + /**
1079 + * Checks if the current user is allowed to create a new entry based on the provided source parameters.
1080 + *
1081 + * @param parameters the live data source parameters
1082 + * @return whether the current user is allowed to create a new entry with this strategy
1083 + */
1084 + boolean isCreationAllowed(Map<String, Object> parameters);
1085 +}
1086 +{{/code}}
1087 +
1088 +New strategies can be added by creating new named components implementing this interface, and using their name in a Live Data's ##newRowNamingStrategy## [[source parameter>>||anchor="HParameters-1"]].
1089 +{{/version}}
1090 +
1031 1031  = Troubleshooting =
1032 1032  
1033 1033  == Live Table Source ==

Approvers

Approvers have not been explicitly defined for this Change Request. Approvers will be based entirely on approval rights.
This Change Request is ready for review.
No conflicts to show.
The change request cannot be published without valid approval or if at least one review request for changes.

Get Connected