jsf.js_next_gen 4.0.0-RC.20 → 4.0.0-RC.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/window/faces-development.js +49 -16
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +49 -16
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +1 -1
- package/src/main/typescript/impl/core/Const.ts +4 -1
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +15 -0
- package/src/main/typescript/impl/xhrCore/Response.ts +15 -2
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +12 -10
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +4 -2
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +11 -4
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +27 -27
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +6 -6
- package/target/impl/core/Const.js +6 -4
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/util/HiddenInputBuilder.js +15 -2
- package/target/impl/util/HiddenInputBuilder.js.map +1 -1
- package/target/impl/xhrCore/Response.js +13 -1
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +11 -7
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +4 -2
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +6 -3
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +27 -27
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +6 -6
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
package/package.json
CHANGED
|
@@ -18,10 +18,13 @@
|
|
|
18
18
|
* [export const] constants
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
export const XML_ATTR_NAMED_VIEWROOT = "namedViewRoot";
|
|
22
|
+
export const NAMED_VIEWROOT = "namedViewRoot";
|
|
21
23
|
|
|
22
24
|
export const P_PARTIAL_SOURCE = "jakarta.faces.source";
|
|
23
25
|
export const PARTIAL_ID = "partialId";
|
|
24
|
-
|
|
26
|
+
|
|
27
|
+
export const VIEW_ID = "myfaces.viewId";
|
|
25
28
|
export const P_VIEWSTATE = "jakarta.faces.ViewState";
|
|
26
29
|
export const P_CLIENT_WINDOW = "jakarta.faces.ClientWindow";
|
|
27
30
|
export const P_VIEWROOT = "jakarta.faces.ViewRoot";
|
|
@@ -28,6 +28,7 @@ import {$faces, $nsp, HTML_CLIENT_WINDOW, HTML_VIEWSTATE, P_CLIENT_WINDOW, P_VIE
|
|
|
28
28
|
export class HiddenInputBuilder {
|
|
29
29
|
private namingContainerId?: string;
|
|
30
30
|
private parent?: DomQuery;
|
|
31
|
+
private namedViewRoot: boolean = false;
|
|
31
32
|
private readonly name: string;
|
|
32
33
|
private readonly template: string;
|
|
33
34
|
|
|
@@ -47,6 +48,11 @@ export class HiddenInputBuilder {
|
|
|
47
48
|
return this;
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
withNamedViewRoot(namedViewRoot: boolean): HiddenInputBuilder {
|
|
52
|
+
this.namedViewRoot = namedViewRoot;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
|
|
50
56
|
|
|
51
57
|
build(): DomQuery {
|
|
52
58
|
const SEP = $faces().separatorchar;
|
|
@@ -68,6 +74,15 @@ export class HiddenInputBuilder {
|
|
|
68
74
|
[this.namingContainerId, $nsp(this.name), cnt]:
|
|
69
75
|
[$nsp(this.name), cnt]).join(SEP);
|
|
70
76
|
|
|
77
|
+
//name must be prefixed with the naming container id as well according to the jsdocs
|
|
78
|
+
if(this.namedViewRoot) {
|
|
79
|
+
newElement.name.value = (this.namingContainerId?.length) ?
|
|
80
|
+
[this.namingContainerId, $nsp(this.name)].join(SEP): $nsp(this.name);
|
|
81
|
+
} else {
|
|
82
|
+
newElement.name.value = $nsp(this.name);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
71
86
|
this?.parent?.append(newElement);
|
|
72
87
|
return newElement;
|
|
73
88
|
}
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
XML_TAG_PARTIAL_RESP,
|
|
37
37
|
RESPONSE_XML,
|
|
38
38
|
XML_TAG_AFTER,
|
|
39
|
-
XML_TAG_BEFORE
|
|
39
|
+
XML_TAG_BEFORE, NAMED_VIEWROOT, XML_ATTR_NAMED_VIEWROOT
|
|
40
40
|
} from "../core/Const";
|
|
41
41
|
import {resolveContexts, resolveResponseXML} from "./ResonseDataResolver";
|
|
42
42
|
import {ExtConfig} from "../util/ExtDomQuery";
|
|
@@ -88,7 +88,20 @@ export module Response {
|
|
|
88
88
|
*/
|
|
89
89
|
function processPartialTag(node: XMLQuery, responseProcessor: IResponseProcessor, internalContext) {
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
let namedAttr = node.attr(XML_ATTR_NAMED_VIEWROOT);
|
|
92
|
+
// MyFaces.
|
|
93
|
+
// there are two differences here on how we determine the naming container scenario
|
|
94
|
+
// mojarra only partial reponse identifier, and if there is none we do not have any naming container
|
|
95
|
+
// myfaces either uses the reponse identifier
|
|
96
|
+
let namedViewRoot = namedAttr.isPresent() ? namedAttr.value === "true" : false;
|
|
97
|
+
if(!namedAttr.isPresent() && node.id) { // defauts fallback if namedViewRoot is not set, if node id is set
|
|
98
|
+
// it defaults to a naming container
|
|
99
|
+
namedViewRoot = !(document?.head?.id);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
internalContext.assignIf(node?.id ?? document?.head.id, PARTIAL_ID).value = node?.id ?? document?.head.id; // second case mojarra
|
|
103
|
+
internalContext.assign(NAMED_VIEWROOT).value = namedViewRoot;
|
|
104
|
+
|
|
92
105
|
const SEL_SUB_TAGS = [XML_TAG_ERROR, XML_TAG_REDIRECT, XML_TAG_CHANGES].join(",");
|
|
93
106
|
|
|
94
107
|
// now we can process the main operations
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
HTML_TAG_HEAD,
|
|
42
42
|
HTML_TAG_LINK,
|
|
43
43
|
HTML_TAG_SCRIPT,
|
|
44
|
-
HTML_TAG_STYLE, IDENT_ALL, IDENT_NONE,
|
|
44
|
+
HTML_TAG_STYLE, IDENT_ALL, IDENT_NONE, NAMED_VIEWROOT,
|
|
45
45
|
ON_ERROR,
|
|
46
46
|
ON_EVENT,
|
|
47
47
|
P_CLIENT_WINDOW,
|
|
@@ -139,7 +139,6 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
const shadowInnerHTML: string = <string>shadowBody.innerHTML;
|
|
142
|
-
|
|
143
142
|
const resultingBody = <DQ>ExtDomQuery.querySelectorAll(HTML_TAG_BODY);
|
|
144
143
|
const updateForms = resultingBody.querySelectorAll(HTML_TAG_FORM);
|
|
145
144
|
|
|
@@ -261,7 +260,6 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
261
260
|
|
|
262
261
|
const before = node.attr(XML_TAG_BEFORE);
|
|
263
262
|
const after = node.attr(XML_TAG_AFTER);
|
|
264
|
-
|
|
265
263
|
const insertNodes = DQ.fromMarkup(<any>node.cDATAAsString);
|
|
266
264
|
|
|
267
265
|
if (before.isPresent()) {
|
|
@@ -351,10 +349,11 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
351
349
|
Stream.ofAssoc<StateHolder>(this.internalContext.getIf(APPLIED_VST).orElse({}).value)
|
|
352
350
|
.each(([, value]) => {
|
|
353
351
|
const namingContainerId = this.internalContext.getIf(PARTIAL_ID);
|
|
352
|
+
const namedViewRoot = !!this.internalContext.getIf(PARTIAL_ID).value
|
|
354
353
|
const affectedForms = this.getContainerForms(namingContainerId)
|
|
355
354
|
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
356
355
|
|
|
357
|
-
this.appendViewStateToForms(affectedForms, value.value, namingContainerId.orElse("").value);
|
|
356
|
+
this.appendViewStateToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
358
357
|
});
|
|
359
358
|
}
|
|
360
359
|
|
|
@@ -368,10 +367,11 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
368
367
|
Stream.ofAssoc<StateHolder>(this.internalContext.getIf(APPLIED_CLIENT_WINDOW).orElse({}).value)
|
|
369
368
|
.each(([, value]) => {
|
|
370
369
|
const namingContainerId = this.internalContext.getIf(PARTIAL_ID);
|
|
370
|
+
const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value;
|
|
371
371
|
const affectedForms = this.getContainerForms(namingContainerId)
|
|
372
372
|
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
373
373
|
|
|
374
|
-
this.appendClientWindowToForms(affectedForms, value.value, namingContainerId.orElse("").value);
|
|
374
|
+
this.appendClientWindowToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
377
|
|
|
@@ -393,8 +393,8 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
393
393
|
* @param viewState the final viewState
|
|
394
394
|
* @param namingContainerId
|
|
395
395
|
*/
|
|
396
|
-
private appendViewStateToForms(forms: DQ, viewState: string, namingContainerId = "") {
|
|
397
|
-
this.assignState(forms, $nsp(SEL_VIEWSTATE_ELEM), viewState, namingContainerId);
|
|
396
|
+
private appendViewStateToForms(forms: DQ, namedViewRoot: boolean, viewState: string, namingContainerId = "") {
|
|
397
|
+
this.assignState(forms, $nsp(SEL_VIEWSTATE_ELEM), namedViewRoot, viewState, namingContainerId);
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
|
|
@@ -405,8 +405,8 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
405
405
|
* @param clientWindow the final viewState
|
|
406
406
|
* @param namingContainerId
|
|
407
407
|
*/
|
|
408
|
-
private appendClientWindowToForms(forms: DQ, clientWindow: string, namingContainerId = "") {
|
|
409
|
-
this.assignState(forms, $nsp(SEL_CLIENT_WINDOW_ELEM), clientWindow, namingContainerId);
|
|
408
|
+
private appendClientWindowToForms(forms: DQ, namedViewRoot: boolean, clientWindow: string, namingContainerId = "") {
|
|
409
|
+
this.assignState(forms, $nsp(SEL_CLIENT_WINDOW_ELEM), namedViewRoot, clientWindow, namingContainerId);
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
/**
|
|
@@ -414,12 +414,13 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
414
414
|
*
|
|
415
415
|
* @param forms the forms to append or change to
|
|
416
416
|
* @param selector the selector for the state
|
|
417
|
+
* @param namedViewRoot if set to true, the name is also prefixed
|
|
417
418
|
* @param state the state itself which needs to be assigned
|
|
418
419
|
*
|
|
419
420
|
* @param namingContainerId
|
|
420
421
|
* @private
|
|
421
422
|
*/
|
|
422
|
-
private assignState(forms: DQ,
|
|
423
|
+
private assignState(forms: DQ, selector: string, namedViewRoot: boolean, state: string, namingContainerId: string) {
|
|
423
424
|
/**
|
|
424
425
|
* creates the viewState or client window id element
|
|
425
426
|
* @param form
|
|
@@ -428,6 +429,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
428
429
|
return new HiddenInputBuilder(selector)
|
|
429
430
|
.withNamingContainerId(namingContainerId)
|
|
430
431
|
.withParent(form)
|
|
432
|
+
.withNamedViewRoot(namedViewRoot)
|
|
431
433
|
.build();
|
|
432
434
|
};
|
|
433
435
|
|
|
@@ -109,8 +109,10 @@ export class XhrFormData extends Config {
|
|
|
109
109
|
* @param form the form holding the view state value
|
|
110
110
|
*/
|
|
111
111
|
private applyViewState(form: DQ) {
|
|
112
|
-
let
|
|
113
|
-
|
|
112
|
+
let viewStateElement = form.querySelectorAllDeep(`[name*='${P_VIEWSTATE}'`);
|
|
113
|
+
let viewState = viewStateElement.inputValue;
|
|
114
|
+
// this.appendIf(viewState.isPresent(), P_VIEWSTATE).value = viewState.value;
|
|
115
|
+
this.appendIf(viewState.isPresent(), viewStateElement.name.value).value = viewState.value;
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
/**
|
|
@@ -18,7 +18,7 @@ import {describe, it} from "mocha";
|
|
|
18
18
|
import * as sinon from "sinon";
|
|
19
19
|
import {expect} from "chai";
|
|
20
20
|
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
21
|
-
import {DomQuery, DQ
|
|
21
|
+
import {DomQuery, DQ$, Stream} from "mona-dish";
|
|
22
22
|
import {
|
|
23
23
|
$nsp,
|
|
24
24
|
COMPLETE,
|
|
@@ -181,9 +181,16 @@ describe('Namespacing tests', function () {
|
|
|
181
181
|
expect(resultsMap["pass2"]).to.eq("pass2");
|
|
182
182
|
expect(!!resultsMap["render"]).to.be.false;
|
|
183
183
|
expect(!!resultsMap["execute"]).to.be.false;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
|
|
185
|
+
let hasWindowdId = Stream.ofAssoc(resultsMap).filter(data => data[0].indexOf(P_WINDOW_ID) != -1).first().isPresent();
|
|
186
|
+
let hasViewState = Stream.ofAssoc(resultsMap).filter(data => data[0].indexOf(P_VIEWSTATE) != -1).first().isPresent();
|
|
187
|
+
|
|
188
|
+
expect(hasWindowdId).to.be.false;
|
|
189
|
+
expect(hasViewState).to.be.true;
|
|
190
|
+
|
|
191
|
+
let viewState = Stream.ofAssoc(resultsMap).filter(data => data[0].indexOf(P_VIEWSTATE) != -1).map(item => item[1]).first().value;
|
|
192
|
+
|
|
193
|
+
expect(viewState).to.eq("booga");
|
|
187
194
|
expect(resultsMap[P_PARTIAL_SOURCE]).to.eq(escape("jd_0:input_2"));
|
|
188
195
|
expect(resultsMap[P_AJAX]).to.eq("true");
|
|
189
196
|
expect(resultsMap[P_RENDER]).to.eq(escape("jd_0:blarg jd_0:input_2"));
|
|
@@ -253,9 +253,9 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
253
253
|
</partial-response>`);
|
|
254
254
|
|
|
255
255
|
|
|
256
|
-
expect(DQ$("[name
|
|
256
|
+
expect(DQ$("[name*='jakarta.faces.ViewState']").isPresent()).to.be.true;
|
|
257
257
|
|
|
258
|
-
expect(DQ$("[name
|
|
258
|
+
expect(DQ$("[name*='jakarta.faces.ViewState']").val == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
259
259
|
});
|
|
260
260
|
|
|
261
261
|
|
|
@@ -289,10 +289,10 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
289
289
|
</partial-response>`);
|
|
290
290
|
|
|
291
291
|
|
|
292
|
-
expect(DQ$("[name
|
|
292
|
+
expect(DQ$("[name*='jakarta.faces.ViewState']").isAbsent()).to.be.false;
|
|
293
293
|
|
|
294
|
-
expect((<HTMLInputElement>document.getElementsByName("jakarta.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
295
|
-
expect(DQ$("[name
|
|
294
|
+
// expect((<HTMLInputElement>document.getElementsByName("jakarta.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
295
|
+
expect(DQ$("[name*='jakarta.faces.ViewState']").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
296
296
|
});
|
|
297
297
|
|
|
298
298
|
|
|
@@ -523,12 +523,12 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
523
523
|
render: "viewroot_1:form1 submit_2"
|
|
524
524
|
});
|
|
525
525
|
this.respond(RESPONSE_1);
|
|
526
|
-
expect(DQ$("#viewroot_1\\:form2 [name
|
|
527
|
-
expect(DQ$("#viewroot_1\\:form1 [name
|
|
528
|
-
expect(DQ$("#viewroot_2\\:form1\\:form1 [name
|
|
526
|
+
expect(DQ$("#viewroot_1\\:form2 [name*='jakarta.faces.ViewState']").isPresent()).to.be.true;
|
|
527
|
+
expect(DQ$("#viewroot_1\\:form1 [name*='jakarta.faces.ViewState']").isPresent()).to.be.true;
|
|
528
|
+
expect(DQ$("#viewroot_2\\:form1\\:form1 [name*='jakarta.faces.ViewState']").isAbsent()).to.be.true;
|
|
529
529
|
|
|
530
|
-
expect(faces.getViewState(DQ$("#viewroot_1\\:form2").getAsElem(0).value)
|
|
531
|
-
expect(faces.getViewState("viewroot_1:form1")
|
|
530
|
+
expect(faces.getViewState(DQ$("#viewroot_1\\:form2").getAsElem(0).value).indexOf("jakarta.faces.ViewState=updatedVST") != -1).to.be.true;
|
|
531
|
+
expect(faces.getViewState("viewroot_1:form1").indexOf("jakarta.faces.ViewState=updatedVST") != -1).to.be.true;
|
|
532
532
|
|
|
533
533
|
done();
|
|
534
534
|
})
|
|
@@ -552,9 +552,9 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
552
552
|
render: "viewroot_1:form1"
|
|
553
553
|
});
|
|
554
554
|
this.respond(RESPONSE_1);
|
|
555
|
-
expect(DQ$("#viewroot_1\\:form2 [name
|
|
556
|
-
expect(DQ$("#viewroot_1\\:form1 [name
|
|
557
|
-
expect(DQ$("#viewroot_1\\:form1 [name
|
|
555
|
+
expect(DQ$("#viewroot_1\\:form2 [name*='jakarta.faces.ClientWindow']").isAbsent()).to.be.true;
|
|
556
|
+
expect(DQ$("#viewroot_1\\:form1 [name*='jakarta.faces.ClientWindow']").isPresent()).to.be.true;
|
|
557
|
+
expect(DQ$("#viewroot_1\\:form1 [name*='jakarta.faces.ClientWindow']").val).to.be.eq("updatedViewId");
|
|
558
558
|
|
|
559
559
|
done();
|
|
560
560
|
})
|
|
@@ -575,11 +575,11 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
575
575
|
render: "viewroot_1:form1 :submit_2"
|
|
576
576
|
});
|
|
577
577
|
this.respond(RESPONSE_1);
|
|
578
|
-
expect(DQ$("#viewroot_1\\:form2 [name
|
|
579
|
-
expect(DQ$("#viewroot_1\\:form1 [name
|
|
580
|
-
expect(DQ$("#viewroot_2\\:form1\\:form1 [name
|
|
581
|
-
expect(DQ$("#viewroot_1\\:form2 [name
|
|
582
|
-
expect(DQ$("#viewroot_1\\:form1 [name
|
|
578
|
+
expect(DQ$("#viewroot_1\\:form2 [name*='jakarta.faces.ClientWindow']").isPresent()).to.be.true;
|
|
579
|
+
expect(DQ$("#viewroot_1\\:form1 [name*='jakarta.faces.ClientWindow']").isPresent()).to.be.true;
|
|
580
|
+
expect(DQ$("#viewroot_2\\:form1\\:form1 [name*='jakarta.faces.ClientWindow']").isAbsent()).to.be.true;
|
|
581
|
+
expect(DQ$("#viewroot_1\\:form2 [name*='jakarta.faces.ClientWindow']").val).to.be.eq("updatedViewId");
|
|
582
|
+
expect(DQ$("#viewroot_1\\:form1 [name*='jakarta.faces.ClientWindow']").val).to.be.eq("updatedViewId");
|
|
583
583
|
|
|
584
584
|
done();
|
|
585
585
|
})
|
|
@@ -657,9 +657,9 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
657
657
|
|
|
658
658
|
this.respond(RESPONSE_1);
|
|
659
659
|
// all forms in execute and render must receive the latest viewstate
|
|
660
|
-
expect(DQ$("#form1 [name
|
|
661
|
-
expect(DQ$("#form2 [name
|
|
662
|
-
expect(DQ$("#form2 [name
|
|
660
|
+
expect(DQ$("#form1 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
661
|
+
expect(DQ$("#form2 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
662
|
+
expect(DQ$("#form2 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
663
663
|
done();
|
|
664
664
|
})
|
|
665
665
|
|
|
@@ -712,13 +712,13 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
712
712
|
</changes>
|
|
713
713
|
</partial-response>
|
|
714
714
|
`)
|
|
715
|
-
expect(DQ$("#form1 [name
|
|
716
|
-
expect(DQ$("#form2 [name
|
|
717
|
-
expect(DQ$("#form3 [name
|
|
715
|
+
expect(DQ$("#form1 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
716
|
+
expect(DQ$("#form2 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
717
|
+
expect(DQ$("#form3 [name*='jakarta.faces.ViewState']").val).to.eq("booga_after_update");
|
|
718
718
|
|
|
719
|
-
expect(DQ$("#form1 [name
|
|
720
|
-
expect(DQ$("#form2 [name
|
|
721
|
-
expect(DQ$("#form3 [name
|
|
719
|
+
expect(DQ$("#form1 [name*='jakarta.faces.ViewState']").id.value.indexOf("viewroot_1:jakarta.faces.ViewState:0") === 0).to.be.true;
|
|
720
|
+
expect(DQ$("#form2 [name*='jakarta.faces.ViewState']").id.value.indexOf("viewroot_1:jakarta.faces.ViewState:1") === 0).to.be.true;
|
|
721
|
+
expect(DQ$("#form3 [name*='jakarta.faces.ViewState']").id.value.indexOf("viewroot_1:jakarta.faces.ViewState:2") === 0).to.be.true;
|
|
722
722
|
|
|
723
723
|
done();
|
|
724
724
|
});
|
|
@@ -256,10 +256,10 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
256
256
|
</partial-response>`);
|
|
257
257
|
|
|
258
258
|
|
|
259
|
-
expect(DQ$("[name
|
|
259
|
+
expect(DQ$("[name*='javax.faces.ViewState']").isAbsent()).to.be.false;
|
|
260
260
|
|
|
261
|
-
expect((<HTMLInputElement>document.getElementsByName("javax.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
262
|
-
expect(DQ$("[name
|
|
261
|
+
//expect((<HTMLInputElement>document.getElementsByName("javax.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
262
|
+
expect(DQ$("[name*='javax.faces.ViewState']").val == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
263
263
|
});
|
|
264
264
|
|
|
265
265
|
|
|
@@ -293,10 +293,10 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
293
293
|
</partial-response>`);
|
|
294
294
|
|
|
295
295
|
|
|
296
|
-
expect(DQ$("[name
|
|
296
|
+
expect(DQ$("[name*='javax.faces.ViewState']").isAbsent()).to.be.false;
|
|
297
297
|
|
|
298
|
-
expect((<HTMLInputElement>document.getElementsByName("javax.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
299
|
-
expect(DQ$("[name
|
|
298
|
+
//expect((<HTMLInputElement>document.getElementsByName("javax.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
299
|
+
expect(DQ$("[name*='javax.faces.ViewState']").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
300
300
|
});
|
|
301
301
|
|
|
302
302
|
|
|
@@ -15,15 +15,17 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.$nsp = exports.$faces = exports.UNKNOWN = exports.MAX_RECONNECT_ATTEMPTS = exports.RECONNECT_INTERVAL = exports.APPLIED_CLIENT_WINDOW = exports.APPLIED_VST = exports.REASON_EXPIRED = exports.MF_NONE = exports.MYFACES = exports.DEFERRED_HEAD_INSERTS = exports.UPDATE_ELEMS = void 0;
|
|
18
|
+
exports.CTX_OPTIONS_PARAMS = exports.TIMEOUT_EVENT = exports.CLIENT_ERROR = exports.SERVER_ERROR = exports.MALFORMEDXML = exports.EMPTY_RESPONSE = exports.HTTPERROR = exports.RESPONSE_XML = exports.RESPONSE_TEXT = exports.ERROR_MESSAGE = exports.ERROR_NAME = exports.STATUS = exports.SOURCE = exports.SUCCESS = exports.COMPLETE = exports.BEGIN = exports.ON_EVENT = exports.ON_ERROR = exports.EVENT = exports.ERROR = exports.WINDOW_ID = exports.CTX_PARAM_RENDER = exports.P_BEHAVIOR_EVENT = exports.P_WINDOW_ID = exports.P_RESET_VALUES = exports.P_EVT = exports.P_RENDER_OVERRIDE = exports.P_RENDER = exports.P_EXECUTE = exports.P_AJAX = exports.IDENT_FORM = exports.IDENT_THIS = exports.IDENT_NONE = exports.IDENT_ALL = exports.HTML_CLIENT_WINDOW = exports.HTML_VIEWSTATE = exports.EMPTY_MAP = exports.EMPTY_STR = exports.EMPTY_FUNC = exports.P_RESOURCE = exports.P_VIEWBODY = exports.P_VIEWHEAD = exports.P_VIEWROOT = exports.P_CLIENT_WINDOW = exports.P_VIEWSTATE = exports.VIEW_ID = exports.PARTIAL_ID = exports.P_PARTIAL_SOURCE = exports.NAMED_VIEWROOT = exports.XML_ATTR_NAMED_VIEWROOT = void 0;
|
|
19
|
+
exports.XML_TAG_AFTER = exports.XML_TAG_BEFORE = exports.XML_TAG_REDIRECT = exports.XML_TAG_EXTENSION = exports.XML_TAG_ATTRIBUTES = exports.XML_TAG_ERROR = exports.XML_TAG_EVAL = exports.XML_TAG_INSERT = exports.XML_TAG_DELETE = exports.XML_TAG_UPDATE = exports.XML_TAG_CHANGES = exports.XML_TAG_PARTIAL_RESP = exports.ATTR_ID = exports.ATTR_VALUE = exports.ATTR_NAME = exports.ATTR_URL = exports.ERR_NO_PARTIAL_RESPONSE = exports.PHASE_PROCESS_RESPONSE = exports.SEL_RESPONSE_XML = exports.SEL_CLIENT_WINDOW_ELEM = exports.SEL_VIEWSTATE_ELEM = exports.HTML_TAG_STYLE = exports.HTML_TAG_SCRIPT = exports.HTML_TAG_LINK = exports.HTML_TAG_BODY = exports.HTML_TAG_FORM = exports.HTML_TAG_HEAD = exports.STD_ACCEPT = exports.NO_TIMEOUT = exports.MULTIPART = exports.URL_ENCODED = exports.STATE_EVT_COMPLETE = exports.STATE_EVT_TIMEOUT = exports.STATE_EVT_BEGIN = exports.REQ_TYPE_POST = exports.REQ_TYPE_GET = exports.ENCODED_URL = exports.VAL_AJAX = exports.REQ_ACCEPT = exports.HEAD_FACES_REQ = exports.CONTENT_TYPE = exports.CTX_PARAM_REQ_PASS_THR = exports.CTX_PARAM_SRC_CTL_ID = exports.CTX_PARAM_SRC_FRM_ID = exports.CTX_PARAM_MF_INTERNAL = exports.CTX_OPTIONS_EXECUTE = exports.CTX_OPTIONS_RESET = exports.CTX_OPTIONS_TIMEOUT = exports.DELAY_NONE = exports.CTX_OPTIONS_DELAY = void 0;
|
|
20
|
+
exports.$nsp = exports.$faces = exports.UNKNOWN = exports.MAX_RECONNECT_ATTEMPTS = exports.RECONNECT_INTERVAL = exports.APPLIED_CLIENT_WINDOW = exports.APPLIED_VST = exports.REASON_EXPIRED = exports.MF_NONE = exports.MYFACES = exports.DEFERRED_HEAD_INSERTS = exports.UPDATE_ELEMS = exports.UPDATE_FORMS = exports.XML_TAG_ATTR = void 0;
|
|
21
21
|
/*
|
|
22
22
|
* [export const] constants
|
|
23
23
|
*/
|
|
24
|
+
exports.XML_ATTR_NAMED_VIEWROOT = "namedViewRoot";
|
|
25
|
+
exports.NAMED_VIEWROOT = "namedViewRoot";
|
|
24
26
|
exports.P_PARTIAL_SOURCE = "jakarta.faces.source";
|
|
25
27
|
exports.PARTIAL_ID = "partialId";
|
|
26
|
-
exports.VIEW_ID = "
|
|
28
|
+
exports.VIEW_ID = "myfaces.viewId";
|
|
27
29
|
exports.P_VIEWSTATE = "jakarta.faces.ViewState";
|
|
28
30
|
exports.P_CLIENT_WINDOW = "jakarta.faces.ClientWindow";
|
|
29
31
|
exports.P_VIEWROOT = "jakarta.faces.ViewRoot";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Const.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/core/Const.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;AAEH;;GAEG;
|
|
1
|
+
{"version":3,"file":"Const.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/core/Const.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;AAEH;;GAEG;AAEU,QAAA,uBAAuB,GAAG,eAAe,CAAC;AAC1C,QAAA,cAAc,GAAG,eAAe,CAAC;AAEjC,QAAA,gBAAgB,GAAG,sBAAsB,CAAC;AAC1C,QAAA,UAAU,GAAG,WAAW,CAAC;AAEzB,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAC3B,QAAA,WAAW,GAAG,yBAAyB,CAAC;AACxC,QAAA,eAAe,GAAG,4BAA4B,CAAC;AAC/C,QAAA,UAAU,GAAG,wBAAwB,CAAC;AACtC,QAAA,UAAU,GAAG,wBAAwB,CAAC;AACtC,QAAA,UAAU,GAAG,wBAAwB,CAAC;AAEtC,QAAA,UAAU,GAAG,wBAAwB,CAAC;AAEnD,2BAA2B;AAEd,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;AAC7C,CAAC,CAAC,CAAC;AACU,QAAA,SAAS,GAAG,EAAE,CAAC;AACf,QAAA,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE9B,QAAA,cAAc,GAAG,CAAC,sBAAsB,EAAE,QAAQ,EAAE,mBAAW,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,iBAAS,CAAC,CAAC;AAClG,QAAA,kBAAkB,GAAG,CAAC,sBAAsB,EAAE,UAAU,EAAE,uBAAe,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,iBAAS,CAAC,CAAC;AAGzH,oCA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AG,0BAA0B,CAAC;AACzC,QAAA,qBAAqB,GAAG,6BAA6B,CAAC;AAEtD,QAAA,kBAAkB,GAAG,GAAG,CAAC;AACzB,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAE5B,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC;;;;;;GAMG;AAEH,SAAgB,MAAM;;IACjB,OAAO,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAa,CAAC;AACvD,CAAC;AAFD,wBAEC;AAED,SAAgB,IAAI,CAAC,cAAoB;IACpC,IAAG,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,OAAO,CAAA,EAAE;QAC7C,OAAO,cAAc,CAAC;KAC1B;IACD,OAAO,CAAC,CAAC,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAA,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,gBAAgB,EAAC,eAAe,CAAC,CAAA,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,kBAAkB,EAAE,aAAa,CAAC,CAAC;AACpJ,CAAC;AALD,oBAKC"}
|
|
@@ -29,6 +29,7 @@ const Const_1 = require("../core/Const");
|
|
|
29
29
|
class HiddenInputBuilder {
|
|
30
30
|
constructor(selector) {
|
|
31
31
|
this.selector = selector;
|
|
32
|
+
this.namedViewRoot = false;
|
|
32
33
|
const isViewState = selector.indexOf((0, Const_1.$nsp)(Const_1.P_VIEWSTATE)) != -1;
|
|
33
34
|
this.name = isViewState ? Const_1.P_VIEWSTATE : Const_1.P_CLIENT_WINDOW;
|
|
34
35
|
this.template = isViewState ? Const_1.HTML_VIEWSTATE : Const_1.HTML_CLIENT_WINDOW;
|
|
@@ -41,8 +42,12 @@ class HiddenInputBuilder {
|
|
|
41
42
|
this.parent = parent;
|
|
42
43
|
return this;
|
|
43
44
|
}
|
|
45
|
+
withNamedViewRoot(namedViewRoot) {
|
|
46
|
+
this.namedViewRoot = namedViewRoot;
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
44
49
|
build() {
|
|
45
|
-
var _a, _b;
|
|
50
|
+
var _a, _b, _c;
|
|
46
51
|
const SEP = (0, Const_1.$faces)().separatorchar;
|
|
47
52
|
let existingStates = (0, mona_dish_1.DQ$)(`[name*='${(0, Const_1.$nsp)(this.name)}']`);
|
|
48
53
|
let cnt = existingStates.stream.map(state => {
|
|
@@ -58,7 +63,15 @@ class HiddenInputBuilder {
|
|
|
58
63
|
newElement.id.value = (((_a = this.namingContainerId) === null || _a === void 0 ? void 0 : _a.length) ?
|
|
59
64
|
[this.namingContainerId, (0, Const_1.$nsp)(this.name), cnt] :
|
|
60
65
|
[(0, Const_1.$nsp)(this.name), cnt]).join(SEP);
|
|
61
|
-
|
|
66
|
+
//name must be prefixed with the naming container id as well according to the jsdocs
|
|
67
|
+
if (this.namedViewRoot) {
|
|
68
|
+
newElement.name.value = ((_b = this.namingContainerId) === null || _b === void 0 ? void 0 : _b.length) ?
|
|
69
|
+
[this.namingContainerId, (0, Const_1.$nsp)(this.name)].join(SEP) : (0, Const_1.$nsp)(this.name);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
newElement.name.value = (0, Const_1.$nsp)(this.name);
|
|
73
|
+
}
|
|
74
|
+
(_c = this === null || this === void 0 ? void 0 : this.parent) === null || _c === void 0 ? void 0 : _c.append(newElement);
|
|
62
75
|
return newElement;
|
|
63
76
|
}
|
|
64
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiddenInputBuilder.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/util/HiddenInputBuilder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,yCAA4C;AAC5C,yCAA6G;AAE7G;;;;;;GAMG;AACH,MAAa,kBAAkB;
|
|
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,IAAI,CAAC,CAAC;SAC7E;aAAM;YACH,UAAU,CAAC,IAAI,CAAC,KAAK,GAAG,IAAA,YAAI,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC3C;QAGD,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,0CAAE,MAAM,CAAC,UAAU,CAAC,CAAC;QACjC,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ;AA7DD,gDA6DC"}
|
|
@@ -59,7 +59,19 @@ var Response;
|
|
|
59
59
|
* highest node partial-response from there the main operations are triggered
|
|
60
60
|
*/
|
|
61
61
|
function processPartialTag(node, responseProcessor, internalContext) {
|
|
62
|
-
|
|
62
|
+
var _a, _b, _c;
|
|
63
|
+
let namedAttr = node.attr(Const_1.XML_ATTR_NAMED_VIEWROOT);
|
|
64
|
+
// MyFaces.
|
|
65
|
+
// there are two differences here on how we determine the naming container scenario
|
|
66
|
+
// mojarra only partial reponse identifier, and if there is none we do not have any naming container
|
|
67
|
+
// myfaces either uses the reponse identifier
|
|
68
|
+
let namedViewRoot = namedAttr.isPresent() ? namedAttr.value === "true" : false;
|
|
69
|
+
if (!namedAttr.isPresent() && node.id) { // defauts fallback if namedViewRoot is not set, if node id is set
|
|
70
|
+
// it defaults to a naming container
|
|
71
|
+
namedViewRoot = !((_a = document === null || document === void 0 ? void 0 : document.head) === null || _a === void 0 ? void 0 : _a.id);
|
|
72
|
+
}
|
|
73
|
+
internalContext.assignIf((_b = node === null || node === void 0 ? void 0 : node.id) !== null && _b !== void 0 ? _b : document === null || document === void 0 ? void 0 : document.head.id, Const_1.PARTIAL_ID).value = (_c = node === null || node === void 0 ? void 0 : node.id) !== null && _c !== void 0 ? _c : document === null || document === void 0 ? void 0 : document.head.id; // second case mojarra
|
|
74
|
+
internalContext.assign(Const_1.NAMED_VIEWROOT).value = namedViewRoot;
|
|
63
75
|
const SEL_SUB_TAGS = [Const_1.XML_TAG_ERROR, Const_1.XML_TAG_REDIRECT, Const_1.XML_TAG_CHANGES].join(",");
|
|
64
76
|
// now we can process the main operations
|
|
65
77
|
node.querySelectorAll(SEL_SUB_TAGS).each((node) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/xhrCore/Response.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,yCAAuC;AACvC,2DAAsD;AAGtD,yCAmBuB;AACvB,+DAA0E;AAC1E,qDAA8C;AAI9C,IAAc,QAAQ,
|
|
1
|
+
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../../src/main/typescript/impl/xhrCore/Response.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,yCAAuC;AACvC,2DAAsD;AAGtD,yCAmBuB;AACvB,+DAA0E;AAC1E,qDAA8C;AAI9C,IAAc,QAAQ,CAwLrB;AAxLD,WAAc,QAAQ;IAGlB;;;;;;;;;;OAUG;IACH,SAAgB,eAAe,CAAC,OAAuB,EAAE,OAAgB;QAErE,IAAI,GAAG,GAAG,uBAAS,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,EAAC,eAAe,EAAE,eAAe,EAAC,GAAG,IAAA,qCAAe,EAAC,OAAO,CAAC,CAAC;QAClE,IAAI,WAAW,GAAa,IAAA,wCAAkB,EAAC,GAAG,CAAC,CAAC;QACpD,IAAI,iBAAiB,GAAG,IAAI,qCAAiB,CAAC,GAAG,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;QAErF,eAAe,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC,KAAK,GAAG,WAAW,CAAC;QAEzD,mEAAmE;QACnE,WAAW,CAAC,gBAAgB,CAAC,4BAAoB,CAAC;aAC7C,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAW,IAAI,EAAE,iBAAiB,EAAE,eAAe,CAAC,CAAC,CAAC;QAEzF,8FAA8F;QAC9F,iDAAiD;QACjD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AC;gBACpG,MAAM;YAEV,KAAK,IAAA,YAAI,EAAC,kBAAU,CAAC;gBACjB,iBAAiB,CAAC,WAAW,CAAC,cAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;gBACzD,MAAM;YAEV,KAAK,IAAA,YAAI,EAAC,kBAAU,CAAC;gBACjB,iBAAiB,CAAC,WAAW,CAAC,cAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;gBACzD,MAAM;YAEV,KAAK,IAAA,YAAI,EAAC,kBAAU,CAAC;gBACjB,iBAAiB,CAAC,SAAS,CAAC,cAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAA;gBACtD,MAAM;YAEV,SAAQ,uBAAuB;gBAC3B,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAC3C,MAAM;SACb;IACL,CAAC;AACL,CAAC,EAxLa,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAwLrB"}
|
|
@@ -274,9 +274,10 @@ class ResponseProcessor {
|
|
|
274
274
|
mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_VST).orElse({}).value)
|
|
275
275
|
.each(([, value]) => {
|
|
276
276
|
const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
|
|
277
|
+
const namedViewRoot = !!this.internalContext.getIf(Const_1.PARTIAL_ID).value;
|
|
277
278
|
const affectedForms = this.getContainerForms(namingContainerId)
|
|
278
279
|
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
279
|
-
this.appendViewStateToForms(affectedForms, value.value, namingContainerId.orElse("").value);
|
|
280
|
+
this.appendViewStateToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
280
281
|
});
|
|
281
282
|
}
|
|
282
283
|
/**
|
|
@@ -287,9 +288,10 @@ class ResponseProcessor {
|
|
|
287
288
|
mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_CLIENT_WINDOW).orElse({}).value)
|
|
288
289
|
.each(([, value]) => {
|
|
289
290
|
const namingContainerId = this.internalContext.getIf(Const_1.PARTIAL_ID);
|
|
291
|
+
const namedViewRoot = !!this.internalContext.getIf(Const_1.NAMED_VIEWROOT).value;
|
|
290
292
|
const affectedForms = this.getContainerForms(namingContainerId)
|
|
291
293
|
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
292
|
-
this.appendClientWindowToForms(affectedForms, value.value, namingContainerId.orElse("").value);
|
|
294
|
+
this.appendClientWindowToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
293
295
|
});
|
|
294
296
|
}
|
|
295
297
|
/**
|
|
@@ -308,8 +310,8 @@ class ResponseProcessor {
|
|
|
308
310
|
* @param viewState the final viewState
|
|
309
311
|
* @param namingContainerId
|
|
310
312
|
*/
|
|
311
|
-
appendViewStateToForms(forms, viewState, namingContainerId = "") {
|
|
312
|
-
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), viewState, namingContainerId);
|
|
313
|
+
appendViewStateToForms(forms, namedViewRoot, viewState, namingContainerId = "") {
|
|
314
|
+
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_VIEWSTATE_ELEM), namedViewRoot, viewState, namingContainerId);
|
|
313
315
|
}
|
|
314
316
|
/**
|
|
315
317
|
* proper clientWindow -> form assignment
|
|
@@ -318,20 +320,21 @@ class ResponseProcessor {
|
|
|
318
320
|
* @param clientWindow the final viewState
|
|
319
321
|
* @param namingContainerId
|
|
320
322
|
*/
|
|
321
|
-
appendClientWindowToForms(forms, clientWindow, namingContainerId = "") {
|
|
322
|
-
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), clientWindow, namingContainerId);
|
|
323
|
+
appendClientWindowToForms(forms, namedViewRoot, clientWindow, namingContainerId = "") {
|
|
324
|
+
this.assignState(forms, (0, Const_1.$nsp)(Const_1.SEL_CLIENT_WINDOW_ELEM), namedViewRoot, clientWindow, namingContainerId);
|
|
323
325
|
}
|
|
324
326
|
/**
|
|
325
327
|
* generic append state which appends a certain state as hidden element to an existing set of forms
|
|
326
328
|
*
|
|
327
329
|
* @param forms the forms to append or change to
|
|
328
330
|
* @param selector the selector for the state
|
|
331
|
+
* @param namedViewRoot if set to true, the name is also prefixed
|
|
329
332
|
* @param state the state itself which needs to be assigned
|
|
330
333
|
*
|
|
331
334
|
* @param namingContainerId
|
|
332
335
|
* @private
|
|
333
336
|
*/
|
|
334
|
-
assignState(forms, selector, state, namingContainerId) {
|
|
337
|
+
assignState(forms, selector, namedViewRoot, state, namingContainerId) {
|
|
335
338
|
/**
|
|
336
339
|
* creates the viewState or client window id element
|
|
337
340
|
* @param form
|
|
@@ -340,6 +343,7 @@ class ResponseProcessor {
|
|
|
340
343
|
return new HiddenInputBuilder_1.HiddenInputBuilder(selector)
|
|
341
344
|
.withNamingContainerId(namingContainerId)
|
|
342
345
|
.withParent(form)
|
|
346
|
+
.withNamedViewRoot(namedViewRoot)
|
|
343
347
|
.build();
|
|
344
348
|
};
|
|
345
349
|
forms.each(form => {
|