Skip to content

Commit de9991c

Browse files
authored
Merge pull request magritte-metamodel#379 from seandenigris/enh_gt-form-reset-on-action
[Enh]: In GT Views, Reload Forms after Button Actions
2 parents 4faa64f + 7c78456 commit de9991c

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

source/Magritte-GToolkit/MAElementBuilder.class.st

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Class {
1616
'buttonSelectors',
1717
'objectDescription',
1818
'completionControllerClass',
19-
'completionStrategy'
19+
'completionStrategy',
20+
'toolbar'
2021
],
2122
#category : #'Magritte-GToolkit'
2223
}
@@ -268,7 +269,9 @@ MAElementBuilder >> textUsing: aDescription [
268269

269270
{ #category : #accessing }
270271
MAElementBuilder >> toolbar [
271-
| toolbar |
272+
273+
toolbar ifNotNil: [ ^ toolbar ].
274+
272275
toolbar := BrToolbar new
273276
aptitude: BrToolbarAptitude new;
274277
layout:

source/Magritte-GToolkit/Object.extension.st

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,17 @@ Object >> maGtFormFor: aView [
5959
^ aView explicit
6060
title: 'Magritte';
6161
priority: 50;
62-
stencil: [ ((description elementBuilderFor: self) addButtons; element) asScrollableElement ];
62+
stencil: [
63+
| builder |
64+
builder := description elementBuilderFor: self.
65+
builder addButtons.
66+
builder toolbar children do: [ :button |
67+
| currentAction |
68+
currentAction := button action.
69+
button action: [
70+
currentAction value.
71+
button phlow firstParentWithViewContent phlow update ] ].
72+
builder element asScrollableElement. ];
6373
actionButtonIcon: BrGlamorousVectorIcons inspect
6474
label: 'Memento'
6575
tooltip: 'Inspect Memento'

0 commit comments

Comments
 (0)