How to Collect dijit/form/combobox Selected Values in Repeat Control
An XPage is used to display the number of points a person has collected, and the number of points remaining (see below).
I have a repeat control which gets a collection of documents meeting a specific criteria. The last column in the control contains 5 digit/form/comboboxes, which are displayed or hidden, according to the number of fields on each document that contain data.
The layout contains gift cards worth a certain amount of points, and the person can select how many of each gift card they want. eg.
Company Available in Values of Points Required Quantity Requested
The Quantity Requested column contains the digit/form/comboboxes. As the person selects values in the checkbox, I want the number of points remaining to be recalculated.
The onChange event of the digit/form/comboboxes calls a function in an Output Script which calls an RPC, which in turn calls an SSJS function. The SSJS function cycles through the documents displayed in the repeat control, gathering the points required information. I then wanted it to also grab the Quantity Requested. I understand from a previous posting that because of the way the digit/form/combox is rendered, I can only get the value using CSJS with dijit.byId and perhaps putting the value in a hidden field and retrieving it from there.
I can't seem to wrap my head around how I will do this when the repeat control will make it possible for there to be many combobox1 and combobox2, etc.
The XPage is not bound to a form, because all the items are just calculated on the fly and then discarded.
What is the best way to do this?
dojo xpages xpages-ssjs
add a comment |
An XPage is used to display the number of points a person has collected, and the number of points remaining (see below).
I have a repeat control which gets a collection of documents meeting a specific criteria. The last column in the control contains 5 digit/form/comboboxes, which are displayed or hidden, according to the number of fields on each document that contain data.
The layout contains gift cards worth a certain amount of points, and the person can select how many of each gift card they want. eg.
Company Available in Values of Points Required Quantity Requested
The Quantity Requested column contains the digit/form/comboboxes. As the person selects values in the checkbox, I want the number of points remaining to be recalculated.
The onChange event of the digit/form/comboboxes calls a function in an Output Script which calls an RPC, which in turn calls an SSJS function. The SSJS function cycles through the documents displayed in the repeat control, gathering the points required information. I then wanted it to also grab the Quantity Requested. I understand from a previous posting that because of the way the digit/form/combox is rendered, I can only get the value using CSJS with dijit.byId and perhaps putting the value in a hidden field and retrieving it from there.
I can't seem to wrap my head around how I will do this when the repeat control will make it possible for there to be many combobox1 and combobox2, etc.
The XPage is not bound to a form, because all the items are just calculated on the fly and then discarded.
What is the best way to do this?
dojo xpages xpages-ssjs
add a comment |
An XPage is used to display the number of points a person has collected, and the number of points remaining (see below).
I have a repeat control which gets a collection of documents meeting a specific criteria. The last column in the control contains 5 digit/form/comboboxes, which are displayed or hidden, according to the number of fields on each document that contain data.
The layout contains gift cards worth a certain amount of points, and the person can select how many of each gift card they want. eg.
Company Available in Values of Points Required Quantity Requested
The Quantity Requested column contains the digit/form/comboboxes. As the person selects values in the checkbox, I want the number of points remaining to be recalculated.
The onChange event of the digit/form/comboboxes calls a function in an Output Script which calls an RPC, which in turn calls an SSJS function. The SSJS function cycles through the documents displayed in the repeat control, gathering the points required information. I then wanted it to also grab the Quantity Requested. I understand from a previous posting that because of the way the digit/form/combox is rendered, I can only get the value using CSJS with dijit.byId and perhaps putting the value in a hidden field and retrieving it from there.
I can't seem to wrap my head around how I will do this when the repeat control will make it possible for there to be many combobox1 and combobox2, etc.
The XPage is not bound to a form, because all the items are just calculated on the fly and then discarded.
What is the best way to do this?
dojo xpages xpages-ssjs
An XPage is used to display the number of points a person has collected, and the number of points remaining (see below).
I have a repeat control which gets a collection of documents meeting a specific criteria. The last column in the control contains 5 digit/form/comboboxes, which are displayed or hidden, according to the number of fields on each document that contain data.
The layout contains gift cards worth a certain amount of points, and the person can select how many of each gift card they want. eg.
Company Available in Values of Points Required Quantity Requested
The Quantity Requested column contains the digit/form/comboboxes. As the person selects values in the checkbox, I want the number of points remaining to be recalculated.
The onChange event of the digit/form/comboboxes calls a function in an Output Script which calls an RPC, which in turn calls an SSJS function. The SSJS function cycles through the documents displayed in the repeat control, gathering the points required information. I then wanted it to also grab the Quantity Requested. I understand from a previous posting that because of the way the digit/form/combox is rendered, I can only get the value using CSJS with dijit.byId and perhaps putting the value in a hidden field and retrieving it from there.
I can't seem to wrap my head around how I will do this when the repeat control will make it possible for there to be many combobox1 and combobox2, etc.
The XPage is not bound to a form, because all the items are just calculated on the fly and then discarded.
What is the best way to do this?
dojo xpages xpages-ssjs
dojo xpages xpages-ssjs
asked Nov 20 '18 at 19:36
Lenni SauveLenni Sauve
175
175
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
The JSON RPC service can't interact with any changes made in the browser, see https://www.intec.co.uk/json-rpc-service-component-tree-manipulation-openlog/. This could be the cause of your problems.
You may be able to get around it by triggering a partial refresh (POST) before calling the JSON RPC. In theory that might work, because the component tree (server-side map of the XPage) would get updated by the partialRefreshPost and the updates picked up by the JSON RPC. It's possible though that the Restore View picks up a version of the XPage other than the one for the browser, I don't know. I've never investigated that.
I didn't understand previously that the JSON RPC service can't interact with changes made in the browser. I tried the partialRefreshPost, but that doesn't allow me to get at the value. Is there any other way to do this?
– Lenni Sauve
Nov 20 '18 at 20:43
1
Before the partilRefreshPost try setting a submitted value XSP.submittedValue, its a key value pair, then from server side access the submitted value.. since it is a string, you can send more than one value if you stored it as json, then do a fromJson server side to get more key value pairs.
– xpagesbeast
Nov 22 '18 at 18:13
I'm trying to do that type of thing, but from what I'm understanding because it's inside of a repeat control and I'm trying to get the values from outside the repeat control, I can't do it.
– Lenni Sauve
Nov 26 '18 at 14:24
add a comment |
It's been a while since I've worked with server java script, I have been doing it the managed bean way with ActionListeners. If you have the data in the UI, then can you avoid server side processing and do it client side?
You can also use the DOM XSP Object like XSP.setSubmittedValue to have a key value pair sent with your post request to the server side, you can only have one... it can be JSON or any other value you set it to from the client side javascript.
add a comment |
I figured out how to do this. If anyone wants the code, let me know and I'll provide it.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53400326%2fhow-to-collect-dijit-form-combobox-selected-values-in-repeat-control%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
The JSON RPC service can't interact with any changes made in the browser, see https://www.intec.co.uk/json-rpc-service-component-tree-manipulation-openlog/. This could be the cause of your problems.
You may be able to get around it by triggering a partial refresh (POST) before calling the JSON RPC. In theory that might work, because the component tree (server-side map of the XPage) would get updated by the partialRefreshPost and the updates picked up by the JSON RPC. It's possible though that the Restore View picks up a version of the XPage other than the one for the browser, I don't know. I've never investigated that.
I didn't understand previously that the JSON RPC service can't interact with changes made in the browser. I tried the partialRefreshPost, but that doesn't allow me to get at the value. Is there any other way to do this?
– Lenni Sauve
Nov 20 '18 at 20:43
1
Before the partilRefreshPost try setting a submitted value XSP.submittedValue, its a key value pair, then from server side access the submitted value.. since it is a string, you can send more than one value if you stored it as json, then do a fromJson server side to get more key value pairs.
– xpagesbeast
Nov 22 '18 at 18:13
I'm trying to do that type of thing, but from what I'm understanding because it's inside of a repeat control and I'm trying to get the values from outside the repeat control, I can't do it.
– Lenni Sauve
Nov 26 '18 at 14:24
add a comment |
The JSON RPC service can't interact with any changes made in the browser, see https://www.intec.co.uk/json-rpc-service-component-tree-manipulation-openlog/. This could be the cause of your problems.
You may be able to get around it by triggering a partial refresh (POST) before calling the JSON RPC. In theory that might work, because the component tree (server-side map of the XPage) would get updated by the partialRefreshPost and the updates picked up by the JSON RPC. It's possible though that the Restore View picks up a version of the XPage other than the one for the browser, I don't know. I've never investigated that.
I didn't understand previously that the JSON RPC service can't interact with changes made in the browser. I tried the partialRefreshPost, but that doesn't allow me to get at the value. Is there any other way to do this?
– Lenni Sauve
Nov 20 '18 at 20:43
1
Before the partilRefreshPost try setting a submitted value XSP.submittedValue, its a key value pair, then from server side access the submitted value.. since it is a string, you can send more than one value if you stored it as json, then do a fromJson server side to get more key value pairs.
– xpagesbeast
Nov 22 '18 at 18:13
I'm trying to do that type of thing, but from what I'm understanding because it's inside of a repeat control and I'm trying to get the values from outside the repeat control, I can't do it.
– Lenni Sauve
Nov 26 '18 at 14:24
add a comment |
The JSON RPC service can't interact with any changes made in the browser, see https://www.intec.co.uk/json-rpc-service-component-tree-manipulation-openlog/. This could be the cause of your problems.
You may be able to get around it by triggering a partial refresh (POST) before calling the JSON RPC. In theory that might work, because the component tree (server-side map of the XPage) would get updated by the partialRefreshPost and the updates picked up by the JSON RPC. It's possible though that the Restore View picks up a version of the XPage other than the one for the browser, I don't know. I've never investigated that.
The JSON RPC service can't interact with any changes made in the browser, see https://www.intec.co.uk/json-rpc-service-component-tree-manipulation-openlog/. This could be the cause of your problems.
You may be able to get around it by triggering a partial refresh (POST) before calling the JSON RPC. In theory that might work, because the component tree (server-side map of the XPage) would get updated by the partialRefreshPost and the updates picked up by the JSON RPC. It's possible though that the Restore View picks up a version of the XPage other than the one for the browser, I don't know. I've never investigated that.
answered Nov 20 '18 at 19:55
Paul Stephen WithersPaul Stephen Withers
14.4k11130
14.4k11130
I didn't understand previously that the JSON RPC service can't interact with changes made in the browser. I tried the partialRefreshPost, but that doesn't allow me to get at the value. Is there any other way to do this?
– Lenni Sauve
Nov 20 '18 at 20:43
1
Before the partilRefreshPost try setting a submitted value XSP.submittedValue, its a key value pair, then from server side access the submitted value.. since it is a string, you can send more than one value if you stored it as json, then do a fromJson server side to get more key value pairs.
– xpagesbeast
Nov 22 '18 at 18:13
I'm trying to do that type of thing, but from what I'm understanding because it's inside of a repeat control and I'm trying to get the values from outside the repeat control, I can't do it.
– Lenni Sauve
Nov 26 '18 at 14:24
add a comment |
I didn't understand previously that the JSON RPC service can't interact with changes made in the browser. I tried the partialRefreshPost, but that doesn't allow me to get at the value. Is there any other way to do this?
– Lenni Sauve
Nov 20 '18 at 20:43
1
Before the partilRefreshPost try setting a submitted value XSP.submittedValue, its a key value pair, then from server side access the submitted value.. since it is a string, you can send more than one value if you stored it as json, then do a fromJson server side to get more key value pairs.
– xpagesbeast
Nov 22 '18 at 18:13
I'm trying to do that type of thing, but from what I'm understanding because it's inside of a repeat control and I'm trying to get the values from outside the repeat control, I can't do it.
– Lenni Sauve
Nov 26 '18 at 14:24
I didn't understand previously that the JSON RPC service can't interact with changes made in the browser. I tried the partialRefreshPost, but that doesn't allow me to get at the value. Is there any other way to do this?
– Lenni Sauve
Nov 20 '18 at 20:43
I didn't understand previously that the JSON RPC service can't interact with changes made in the browser. I tried the partialRefreshPost, but that doesn't allow me to get at the value. Is there any other way to do this?
– Lenni Sauve
Nov 20 '18 at 20:43
1
1
Before the partilRefreshPost try setting a submitted value XSP.submittedValue, its a key value pair, then from server side access the submitted value.. since it is a string, you can send more than one value if you stored it as json, then do a fromJson server side to get more key value pairs.
– xpagesbeast
Nov 22 '18 at 18:13
Before the partilRefreshPost try setting a submitted value XSP.submittedValue, its a key value pair, then from server side access the submitted value.. since it is a string, you can send more than one value if you stored it as json, then do a fromJson server side to get more key value pairs.
– xpagesbeast
Nov 22 '18 at 18:13
I'm trying to do that type of thing, but from what I'm understanding because it's inside of a repeat control and I'm trying to get the values from outside the repeat control, I can't do it.
– Lenni Sauve
Nov 26 '18 at 14:24
I'm trying to do that type of thing, but from what I'm understanding because it's inside of a repeat control and I'm trying to get the values from outside the repeat control, I can't do it.
– Lenni Sauve
Nov 26 '18 at 14:24
add a comment |
It's been a while since I've worked with server java script, I have been doing it the managed bean way with ActionListeners. If you have the data in the UI, then can you avoid server side processing and do it client side?
You can also use the DOM XSP Object like XSP.setSubmittedValue to have a key value pair sent with your post request to the server side, you can only have one... it can be JSON or any other value you set it to from the client side javascript.
add a comment |
It's been a while since I've worked with server java script, I have been doing it the managed bean way with ActionListeners. If you have the data in the UI, then can you avoid server side processing and do it client side?
You can also use the DOM XSP Object like XSP.setSubmittedValue to have a key value pair sent with your post request to the server side, you can only have one... it can be JSON or any other value you set it to from the client side javascript.
add a comment |
It's been a while since I've worked with server java script, I have been doing it the managed bean way with ActionListeners. If you have the data in the UI, then can you avoid server side processing and do it client side?
You can also use the DOM XSP Object like XSP.setSubmittedValue to have a key value pair sent with your post request to the server side, you can only have one... it can be JSON or any other value you set it to from the client side javascript.
It's been a while since I've worked with server java script, I have been doing it the managed bean way with ActionListeners. If you have the data in the UI, then can you avoid server side processing and do it client side?
You can also use the DOM XSP Object like XSP.setSubmittedValue to have a key value pair sent with your post request to the server side, you can only have one... it can be JSON or any other value you set it to from the client side javascript.
edited Nov 22 '18 at 18:15
answered Nov 22 '18 at 17:39
xpagesbeastxpagesbeast
434415
434415
add a comment |
add a comment |
I figured out how to do this. If anyone wants the code, let me know and I'll provide it.
add a comment |
I figured out how to do this. If anyone wants the code, let me know and I'll provide it.
add a comment |
I figured out how to do this. If anyone wants the code, let me know and I'll provide it.
I figured out how to do this. If anyone wants the code, let me know and I'll provide it.
answered Dec 7 '18 at 15:44
Lenni SauveLenni Sauve
175
175
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53400326%2fhow-to-collect-dijit-form-combobox-selected-values-in-repeat-control%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown