xpages-ssjs

FTSearch involving date fields is confusing me

痴心易碎 提交于 2019-12-05 19:52:24
I have Custom Control with a search screen that lets the users select any of up to six different fields to search on. I had no trouble getting all the other fields working with the exception of the two date fields. They can fill in both begin and end dates or just one or the other. Pretty standard stuff but I cannot figure out how to write the code to make the query work and have it do the search when it involves dates. var tmpArray = new Array(""); var cTerms = 0; if(requestScope.cmbSendTo != null & requestScope.cmbSendTo != "") { a = @Right(requestScope.cmbSendTo, "("); b = @Left(a,3);

call partialRefreshGet from SSJS using view.PostScript

▼魔方 西西 提交于 2019-12-04 18:34:36
I have a SSJS running in the BeforePageKoad event. As the last step of the SSJS I want to do a partial refresh. In my script I have this line of code: view.postScript("partialRefreshGet('#{id:panelAll}')") When it executes I get an error that says partialRefreshGet is undeffined. I'm guessing I'm missing something in the format of the call, but as I understand it this should work. Anyone done something like this before. If I leave this code out then do a manual refresh of panelAll from a button everything works correctly. You can't use before view.postScript in the beforePageLoad. Try moving

xPages Custom Control with Custom Property Group that allows Multiple Instances

半世苍凉 提交于 2019-12-04 06:27:55
问题 I've create a custom control that has a Property Definition Group. The Group has checked to "Allow multiple instances". When I drop the control on an xPage I can through the UI manually add 2 items to the property and set the sub-properties of the group(s) but I need to figure out how to programmatically populate the group by looping through an array and doing some calculations. 回答1: I tend to define a Custom Control Property named "configuration", and set that to be an "object" (you'll have

Which is the most efficient way to access the value of a control?

痞子三分冷 提交于 2019-12-03 14:26:52
Of the two choices I have to access the value of a control which is the most efficient? getComponent("ControlName").getValue(); or dataSource.getItemValue("FieldName"); I find that on occasion the getComponent does not seem to return the current value, but accessing the dataSource seems to be more reliable. So does it make much difference from a performance perspective which one is used? The dataSource.getValue seems to work everywhere that I have tried it. However, when working with rowData I still seem to need to do a rowData.getColumnValue("Something"). rowData.getValue("Something") fails.

Xpages add values into Combo Box

我只是一个虾纸丫 提交于 2019-12-02 10:37:15
问题 I have a Combo Box and I would like to have the possibility to add new values in the Combo Box using a button and an Input Field. I tried with: var value = getComponent("input").getValue(); getComponent("combobox").setValue(value); but it is not working. Thank you, Florin 回答1: Use a viewScope e.g. viewScope.selectItems variable. Use this viewScope as the selectItems list. Add the initial values to it. Later, add a additional new item to this viewScope and then it will appear in combobox's

xPages Custom Control with Custom Property Group that allows Multiple Instances

☆樱花仙子☆ 提交于 2019-12-02 09:56:50
I've create a custom control that has a Property Definition Group. The Group has checked to "Allow multiple instances". When I drop the control on an xPage I can through the UI manually add 2 items to the property and set the sub-properties of the group(s) but I need to figure out how to programmatically populate the group by looping through an array and doing some calculations. I tend to define a Custom Control Property named "configuration", and set that to be an "object" (you'll have to type that in vs. select it from the dropdown): Now, you can pass an object as your property: return {

XPages - save date only in Date field

不羁岁月 提交于 2019-12-02 00:47:18
问题 I'm using an Edit Box control to display a date field. When the XPage is saved, I would like to save the date only (now both date and time are being saved). Is there any way of doing this? Here is my code: <xp:inputText id="dateReparatur" value="#{document1.dateReparatur}"> <xp:this.converter> <xp:convertDateTime type="date" dateStyle="long"> </xp:convertDateTime> </xp:this.converter> <xp:dateTimeHelper></xp:dateTimeHelper> </xp:inputText></xp:td> UPDATE: I have now implemented the following

XPages - save date only in Date field

跟風遠走 提交于 2019-12-01 21:32:06
I'm using an Edit Box control to display a date field. When the XPage is saved, I would like to save the date only (now both date and time are being saved). Is there any way of doing this? Here is my code: <xp:inputText id="dateReparatur" value="#{document1.dateReparatur}"> <xp:this.converter> <xp:convertDateTime type="date" dateStyle="long"> </xp:convertDateTime> </xp:this.converter> <xp:dateTimeHelper></xp:dateTimeHelper> </xp:inputText></xp:td> UPDATE: I have now implemented the following code: var dt = currentDocument.getItemValueDateTime("dateReparatur"); var dateonly = dt.getDateOnly();

XPages save data source and new doc changes previous doc

微笑、不失礼 提交于 2019-12-01 12:17:50
问题 I have a document data source (create document with no parent id) bound to a panel. Within the panel I have 2 other panels. On completing the fields in panel 1 I click a link to reveal the 2nd panel and that has a save button on it. Once saved the document appears in the db correctly. The save buttons does a dds save and then clears all fields and does a partial update on the outer panel and a partial execute on that panel too as I have other dds on the XPage outside of my main panel. If I

Xpage, createForm=false disables SSJS events on links?

对着背影说爱祢 提交于 2019-11-30 20:26:18
问题 I ask this just to be clear here: I accidently set the createForm property to false. I then expected a link event that should open another page only not to function any more. Is this the intended behavior of SSJS events e.g. in links when you disable form creation? 回答1: As Per mentions, all events require a form: if they are full refresh, then the page needs a form to post to in order to trigger the redirect; if they are partial refresh, the form determines the contents of the AJAX POST. The