Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
87cd323a
Commit
87cd323a
authored
10 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1480: fix an issue if reset of the columns apply to a table with multi-select enable
parent
53968682
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/olat/core/gui/components/table/Table.java
+14
-2
14 additions, 2 deletions
src/main/java/org/olat/core/gui/components/table/Table.java
src/main/java/org/olat/core/gui/components/table/TableController.java
+1
-1
1 addition, 1 deletion
...a/org/olat/core/gui/components/table/TableController.java
with
15 additions
and
3 deletions
src/main/java/org/olat/core/gui/components/table/Table.java
+
14
−
2
View file @
87cd323a
...
@@ -651,11 +651,23 @@ public class Table extends AbstractComponent {
...
@@ -651,11 +651,23 @@ public class Table extends AbstractComponent {
return
new
ChoiceTableDataModel
(
isMultiSelect
(),
allCDs
,
columnOrder
,
getTranslator
());
return
new
ChoiceTableDataModel
(
isMultiSelect
(),
allCDs
,
columnOrder
,
getTranslator
());
}
}
protected
List
<
Integer
>
getDefaultVisibleColumns
()
{
/**
* Only use this for reset as it reorder the columns, remove the multi-select column
* and so on...
*
* @return The list of index (without multi select) and reorder to begin with 0
*/
protected
List
<
Integer
>
getDefaultVisibleColumnsToResetColumnsChoice
()
{
List
<
Integer
>
indexList
=
new
ArrayList
<>();
List
<
Integer
>
indexList
=
new
ArrayList
<>();
for
(
ColumnDescriptor
defaultVisibleCD:
defaultVisibleCDs
)
{
for
(
ColumnDescriptor
defaultVisibleCD:
defaultVisibleCDs
)
{
if
(
defaultVisibleCD
instanceof
MultiSelectColumnDescriptor
)
continue
;
int
index
=
allCDs
.
indexOf
(
defaultVisibleCD
);
int
index
=
allCDs
.
indexOf
(
defaultVisibleCD
);
if
(
index
>=
0
)
{
if
(
isMultiSelect
())
{
if
(
index
>
0
)
{
indexList
.
add
(
index
-
1
);
}
}
else
{
indexList
.
add
(
index
);
indexList
.
add
(
index
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/olat/core/gui/components/table/TableController.java
+
1
−
1
View file @
87cd323a
...
@@ -338,7 +338,7 @@ public class TableController extends BasicController {
...
@@ -338,7 +338,7 @@ public class TableController extends BasicController {
applyAndcheckChangedColumnsChoice
(
ureq
,
colsChoice
.
getSelectedRows
());
applyAndcheckChangedColumnsChoice
(
ureq
,
colsChoice
.
getSelectedRows
());
}
else
if
(
event
==
Choice
.
EVNT_FORM_RESETED
)
{
}
else
if
(
event
==
Choice
.
EVNT_FORM_RESETED
)
{
//sideeffect on table and prefs
//sideeffect on table and prefs
List
<
Integer
>
visibleCols
=
table
.
getDefaultVisibleColumns
();
List
<
Integer
>
visibleCols
=
table
.
getDefaultVisibleColumns
ToResetColumnsChoice
();
applyAndcheckChangedColumnsChoice
(
ureq
,
visibleCols
);
applyAndcheckChangedColumnsChoice
(
ureq
,
visibleCols
);
}
else
{
// cancelled
}
else
{
// cancelled
cmc
.
deactivate
();
cmc
.
deactivate
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment