csjs | : sparkles : Modular , scoped CSS with ES6 | Frontend Framework library
kandi X-RAY | csjs Summary
kandi X-RAY | csjs Summary
CSJS allows you to write modular, scoped CSS with valid JavaScript.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of csjs
csjs Key Features
csjs Examples and Code Snippets
Community Discussions
Trending Discussions on csjs
QUESTION
I would like to inititiate a csjs function every time a partial refresh is triggered/completed in XPages.
How can I do this?
...ANSWER
Answered 2021-Apr-14 at 09:07Assuming your partially refreshed element is a container, just place a script block inside this container and call your CSJS script.
QUESTION
I just started using The Dojo charting feature in Xpages. After following this tutorial by Andrew Champion. I Found that the simple csjs script to create a pie chart does not work. It breaks on the creation of the Pie Chart in CSJS. Using most basic code for better readability.
...ANSWER
Answered 2020-Jul-02 at 14:20I don't think you can include server generated code in js files. If you open the scriptsChartDojoCSJS.js file in your browser, you will see that #{id:panel1}
has not been altered.
Instead you can add the makeCharts function to your xp:scriptBlock.
QUESTION
I wanted to find out if its possible to send an array of json objects to csjs from ssjs in a sessionScope variable. When I try to use sesionScope.get in my script block. It doesn't run?
SSJS scriptsChartDojo.jss:
...ANSWER
Answered 2020-Jul-03 at 08:49In the xp:scriptBlock you are combining client side JS with server side JS. The server side JS code must be in #{javascript:
}
in order to be parsed. So do this:
QUESTION
I use a full page overlay to display a Loading mask for my XPages. This works fine for most xp controls, buttons, combo boxes, checkboxes etc by adding CSJS to call the overlay on the onStart() and onComplete() events of the event handler. However this does not work with the xp:Pager control. The onStart and onComplete events are available for each part of the pager but they do not seem to activate. I have some big repeat controls whereby the pager refresh can take several seconds so having the overlay is essential to let the user know the pager is working.
I have added my code to the onStart and onComplete of the xp:Pager elements but they simply do not run. The loader works for all other xp elements. I have tried partial refresh and Full Update but neither cause the onStart and onComplete events to trigger?
...ANSWER
Answered 2019-May-07 at 10:31Most developers I know use Fredrik Norling's Standby Dialog Custom control from OpenNTF. You might be able to work out what's different by cross-referencing, or it might be easier to just use this instead.
If you're using a bootstrap theme, use this one. If you're using OneUI or non-standard theme, use this one.
QUESTION
I have an XPage which only uses 2 js imports - one of them is JQuery and another one dependent on JQuery and it is used for smart companies search of Russian Federation. The problem I have encountered is that when I try to import the second library, the entire page becomes unresponsive (e.g. inability to click any buttons).
Here's what I mean:
...ANSWER
Answered 2019-Apr-05 at 06:10The jquery.suggestions.js library uses AMD loader which conflicts with Dojo in XPages. See this answer to a similar issue.
QUESTION
What I am trying to do is detect, using onChange, if a dojo horizontal slider is being dragged right to left. This happens to be in IBM XPages, but the area of CSJS code below should be universal. How do I use the _isReversed property to get true/false?
...ANSWER
Answered 2019-Mar-06 at 20:31When the onChange
event happens the widget already changed its internal values making it almost impossible to detect any change here. But I wrote a small workaround to detect if the slider was moved from right tot left.
You should place this code inside your onChange
handler. What it does is saving the current value in a data attribute on the widget itself. When another change occurs it will be checked against the new value and updated with the new value. This way you can compare the previous value (could also be the starting value) against the new value.
Hope this works for you!
QUESTION
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?
...ANSWER
Answered 2018-Dec-07 at 15:44I figured out how to do this. If anyone wants the code, let me know and I'll provide it.
QUESTION
I very seldom use CSJS, but in this case I'm trying to get it to update a computed field. While the field has the value updated so that I can get to it with an alert, I can't get it to display on the XPage. I've tried using an editable field with Read Only checked, but the data doesn't appear on the XPage with it either.
I'm invoking a CSJS script block and I know you need to refresh to get the change to display, but I've put a panel around the field and tried it with that and a div. Neither produces an error message, but nor does the value display.
I'm using XSP.partialRefreshGet("#{id:remaining}"); right after I set the value. I've tried it with .partialRefreshPost, which doesn't do anything, but then I read in Stephan Wissel's post "Meet the XSP object" that "...For POST the refreshId must point to a form..." and this XPage is not attached to a form. I have also tried using the parameter immediate:true.
I've read Teresa Monahan's article "Client Side JavaScript Libraries in XPages", Serdar Basegmez's "10 Mistakes You and Every XPages Developer Make", anything I can find on the web, as well as the "Mastering XPages" book. I know this shouldn't be that difficult, so I believe I'm just missing something (probably stupid).
Per the above, neither the XPage, nor the particular field is bound to any form. This is on the first tab of a tabbed table, and is just displaying a calculated value. The value does not need to be saved anywhere.
I am invoking the function in my agent by using onChange="Testing()" in dijit/form/ComboBox selections because I want the tiny boxes and again, I don't need the field values after the selections have been made.
Here is the simple text in the script block:
...ANSWER
Answered 2018-Nov-15 at 20:53I think xp:text
is rendered as a tag, in which case you need to set
.innerHtml()
instead of .value()
. See How do I change the text of a span element in JavaScript. You won't need to refresh to see the change.
QUESTION
ANSWER
Answered 2018-Oct-26 at 06:25You use the xe:bootstrapResponsiveConfiguration as configuration for your ApplicationLayout. That does not combine well with the OneUI theme. Theme and ApplicationLayout must be of the same family.
So either use a bootstrap theme or use the oneuiApplication layout (but the latter does not have a collapsible left column)
QUESTION
I have a file uploader on some of my XPages. It works so well, but there's one profound disadvantage of using it. In some cases, it creates 2 or 3 or 4 or n of duplicates of the same field inside the document. And it only happens if I try to upload a single file (or a set of files) and do the same right after it. Sometimes this happens after I delete one file and upload more. The document's fields look like this after saving. I have no idea about the reason why this happens.
Initially I thought that it could be because I've forgotten to put doc_source.save();
statement in the delete button. But it didn't turned out to be the reason.
The code of the CC is below
...ANSWER
Answered 2018-Oct-19 at 11:28This is indeed the way Lotus Domino stores rich text items or file attachments. Multiple fields of the same name appear in the Properties box of a Notes document.
If your app works without other problems, there is no need to worry.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install csjs
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page