|
64 | 64 | import com.vaadin.flow.data.value.ValueChangeMode;
|
65 | 65 | import com.vaadin.flow.router.BeforeEnterEvent;
|
66 | 66 | import com.vaadin.flow.router.BeforeEnterObserver;
|
| 67 | +import com.vaadin.flow.router.Location; |
67 | 68 | import com.vaadin.flow.router.QueryParameters;
|
68 | 69 |
|
69 | 70 | import software.xdev.vaadin.builder.CustomizableFilterBuilder;
|
@@ -1303,26 +1304,35 @@ private void addQueryParameter(final ChipBadgeExtension<FilterCondition<T, ?>> c
|
1303 | 1304 |
|
1304 | 1305 | this.ui.getPage().fetchCurrentURL(currentUrl ->
|
1305 | 1306 | {
|
1306 |
| - String separator = "?"; |
| 1307 | + final String questionMarkCharacter = "?"; |
| 1308 | + String querySeperator = ""; |
| 1309 | + String currentQuery = currentUrl.getQuery(); |
1307 | 1310 |
|
1308 |
| - if(currentUrl.getQuery() != null) |
| 1311 | + if(currentQuery != null) |
| 1312 | + { |
| 1313 | + querySeperator = "&"; |
| 1314 | + } |
| 1315 | + else |
1309 | 1316 | {
|
1310 |
| - separator = "&"; |
| 1317 | + currentQuery = ""; |
1311 | 1318 | }
|
1312 | 1319 |
|
1313 | 1320 | this.ui
|
1314 | 1321 | .getPage()
|
1315 | 1322 | .getHistory()
|
1316 | 1323 | .replaceState(
|
1317 | 1324 | null,
|
1318 |
| - currentUrl |
1319 |
| - + separator |
1320 |
| - + QueryParameterUtil.createQueryParameterString( |
1321 |
| - this.identifier, |
1322 |
| - filterCondition, |
1323 |
| - chipBadge.getBadgeId(), |
1324 |
| - chipBadge.isBtnDeleteEnabled(), |
1325 |
| - chipBadge.isBtnEditEnabled())); |
| 1325 | + new Location( |
| 1326 | + currentUrl.getPath() |
| 1327 | + + questionMarkCharacter |
| 1328 | + + currentQuery |
| 1329 | + + querySeperator |
| 1330 | + + QueryParameterUtil.createQueryParameterString( |
| 1331 | + this.identifier, |
| 1332 | + filterCondition, |
| 1333 | + chipBadge.getBadgeId(), |
| 1334 | + chipBadge.isBtnDeleteEnabled(), |
| 1335 | + chipBadge.isBtnEditEnabled()))); |
1326 | 1336 | });
|
1327 | 1337 | }
|
1328 | 1338 |
|
|
0 commit comments