Skip to content

Commit 95e70d8

Browse files
committed
[Ui] fix button-submit-confirm inside table action slot
Add key parameter if you need to use it in another vue loop context
1 parent b1e7ee6 commit 95e70d8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

vertigo-ui/src/main/resources/io/vertigo/ui/components/quasar/buttons/button-submit.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@
77
<vu:content><span class="sr-only" th:if="${label==null}" vu:text="${title?:''}"></span></vu:content>
88
</q-btn>
99
</th:block>
10-
<th:block th:fragment="button-submit-confirm(actions_slot, label, icon, color, text-color, action, title, loading, formId, confirmMessage, labelOk, labelCancel, other_attrs)"
10+
<th:block th:fragment="button-submit-confirm(actions_slot, key, label, icon, color, text-color, action, title, loading, formId, confirmMessage, labelOk, labelCancel, other_attrs)"
1111
th:assert="(${label} != null or (${icon} != null and ${title} != null)) and ${action} != null and ${formId} != null"
12-
th:with="myComponentId='button'+${action},myLabelOk=${labelOk?:'Oui'},myLabelCancel=${labelCancel?:'Non'}, myLoading=${loading}?:true"
13-
th:attr="objectKey=${model.vContext['componentStates'].addComponentState(myComponentId).addPrimitive('confirm',false)}">
12+
th:with="myComponentId=${model.util.generateComponentUID('button', action, null, null)},
13+
myKey=${key?:'(props?.rowIndex || ``)'},
14+
myLabelOk=${labelOk?:'Oui'},
15+
myLabelCancel=${labelCancel?:'Non'},
16+
myLoading=${loading}?:true">
1417
<q-btn th:icon="${icon?:''}" th:label="${label?:''}" th:title="${title?:''}"
15-
th:@click="|componentStates.${myComponentId}.confirm = true|"
18+
th:@click="|$refs['${myComponentId}'+ ${myKey}].show()|"
1619
th::round="${label==null?'true':''}" th:color="${color?:'primary'}" th:text-color="${textColor?:''}" th:attr="__${other_attrs}__">
1720
<span class="sr-only" th:if="${label==null}" vu:text="${title?:''}"></span>
18-
<q-dialog th:v-model="|componentStates.${myComponentId}.confirm|" persistent>
21+
<q-dialog th::ref="|'${myComponentId}' + ${myKey}|" persistent>
1922
<q-card>
2023
<q-card-section class="row items-center">
2124
<vu:content>
22-
<span class="q-ml-sm" vu:text="${confirmMessage}"></span>
25+
<span class="q-ml-sm" vu:text="${confirmMessage}"></span>
2326
</vu:content>
2427
</q-card-section>
2528
<q-card-actions align="right" vu:slot="actions_slot">

0 commit comments

Comments
 (0)