I have an extension pages dialog box on the same page as a viewpanel that has check boxes enabled. If I check some check boxes then show the dialog box, the selections in the view panel become unselected. Is anyone else seeing this?
I have the same issue and it looks like we're trying to do the same thing. I plan to add the selected IDs to a sessionScope, update their values, then remove the sessionScope.
I found this one, so I'll update here to see if it works: get the unid of selected documents and save to scoped variable
UPDATE:
I got it to work by setting a sessionScope variable for the selected IDs, as in the above example:
sessionScope.put("SelectedIds", getComponent("viewPanel1").getSelectedIds());
In the SSJS script, I changed the code to read the sessionScope array instead of the viewPanel's selections.
Fortunately, the IDs are very small (3 characters), so if there are a lot of documents, it should be ok.
Good luck!
Related
After saving a specific field in a form, it will store on a view. This view is used by a combo box with a #DBColumn for the choices on another form. This combo box fails to show the recently made field as an option for choices. Even refreshing doesn't do the trick.
The combo box is editable and has "Refresh fields on keyword change" and "Refresh choices on document refresh" checked.
Thank you in advance for your help.
Use the "NoCache" parameter in #DbColumn.
"NoCache" gets the results of the lookup from the database; no cache
is used. If you want to ensure that Domino retrieves the latest
information for every lookup, specify this option.
how can I establish a partial refresh after I select the OK button in the xe:namePicker control ?
I only have the for property which does copy the selected value in the assigned field.
The onchange event for that field does not always seem to recognize the value change.
Instead of an Edit Box, I would recommend using Dojo Name Text Box, as covered here. It avoids the need for validation - with an Edit Box even though you provide a Name Picker, users can still enter values manually and can edit them after selecting from the name Picker. The Dojo Name Text Box and Dojo List Text Box are the only controls I use with pickers and almost always use onChange with them, without issue.
One caveat is that the Events tab defaults to onClick. On more than one occasion I've coded onClick instead of onChange, but it's easily identifiable and rectifiable.
I am trying to make a 2nd djFilteringSelect using a #Dbcolumn depending on the value selected in the 1st djFilteringSelect control. That's a common task, using a partial refresh. However, each of the controls is within a dialog control from the extension library. One dialog pops up, the user selects a value, and automatically the 1st dialog closes and the 2nd opens. YOU CAN'T SEEM TO REFRESH THE FIELD (I'm guessing b/c it's not in the DOM). I've tried writing the first value to to an computed field and/or a text box on the main Xpage using CSJS and then looking for that value for the second lookup. Also, tried with SSJS, etc. I tried do updates and writing to fields on either the onChange or on the click of button. How do I go about using the selected value of the first to do the lookup in the 2nd?
You can use a single dialog control where you hide and show the relevant controls. I am using this approach in several apps.
I have a button that calls a Dialog that has a combo box bound to a sessionScope variable. The combo box contains a list of form names that I use to then call an XPage to create a new document. The first value in the forms list is "" so the user needs to select a value. I have a button with the onClick event of:
var c = getComponent("CreateDocDialog");
sessionScope.put("ssSelectedForm","")
c.show();
I have the button and dialog on a customControl with a repeatControl and when the button to open the dialog is clicked the ssSelectedForm is null and the current value of the combo is blank, which is exactly what I want it to be. However, if I add the same button and dialog to a customControl with a dataView control the dialog displays but ssSelectedForm is not null so the combo box displays the last value of ssSelected. I have placed the button outside the dataView, in several of the facets on the dataview, but all with the same results.
Very confusing.
Bill,
I am going to answer the same as my comment since I am pretty confident about what I said.
Go ahead and change the scope from sessionScope to viewScope. I had a similar issue once, and I 'fixed' it by clearing out the sessionScope variable after I used it. This worked, but I realized that it was not necessary, and that by changing to viewScope the lifecycle will be shorter and there was no need to clear out the value when I was done with it.
I don't know why this fails when added to the data view, but if this fixes it that would be all that matters.
In SSJS I'm looping through document in a view and I want to add a new option to a hidden combo for each document and once finished then show that hidden combo.
I've tried building an array with value|string and adding that to the getComponent("apm").setValue(myArray), but no luck and how do I grab the combo and make it visible because dojo.byId("#{id:apm}").setRendered(true); gives error about dojo not found, so do I need to include something?
Any ideas?
Add your array to a viewScope var.
In your combo, add a formula value and point it to the viewScope.
After your array is built make sure the combo is refreshed. You can set the rendered property based on whether or not your viewScope var exists.