I have a numeric field which has multivalue. I set values of numeric field in backend. I try to show values line by line in a Dojo Text Area. But my problem starts here. When open document in edit Mode. djTextBox adds "." and one decimal place (Zero "0") (added screenshot below). How can i make it to show only the original value of field without adding any dot(".") or Zero("0"). If it not possible I can change the way it did.
<xe:djTextarea id="CountHID" value="#{document1.CountH}" multipleSeparator="#{javascript:#NewLine();}">
<xe:this.converter>
When stored / edited by default in XPages numbers are Doubles. So because a Double includes decimal content, that's why the decimal is showing. You need to set the display type to Number and Integer Only (on Data tab of the Properties pretty panel).
Source pane XML markup for this is:
<xp:this.converter>
<xp:convertNumber type="number" integerOnly="true"></xp:convertNumber>
</xp:this.converter>
Related
I would like to increase width of lotus notes text field on web, I have tried
width="48"
On html tab of the field and put there in style tag but that is not working.
Basically I am having comment field which wherein I would like to increase width of the field so user can see enter long text instead of typing and getting moved.
P.s I know richtext field which can have cols and rows property but I dont need rich text field. I just need simple text field.
Use colon and not an equals sign and add px. So do this instead:
width:48px;
In TIBCO SPOTFIRE 7.5 I have a problem to set a document property with values selected in a checkbox: I have to use "OR" clause between 2 checkbox filter (it works always in "AND") so I want to set 2 document properties with checked values (2 checkbox) and use them in a limit expression.
Someone can help me?
Tnx
I will list two possible answers here, that differ in complexity. Which solution to use depends on how strong your requirements are on what UI control you can use.
Option 1 - Use Property Control
Add two property controls to a text area to set the document properties that will be used to limit data. Each property control will be set up to select values from a column in your data, for instance like this with the Film example data:
With two property controls as the one above, add a data limit expression to the visualization (Visualization properties -> Data -> Limit data using expression). Set expression like this:
[Actor] = "${Actor}" OR [Actress] = "${Actress}"
Here I've used the column [Actor] to match the value of the document property Actor or the column [Actress] to match the value of document property Actress.
Option 2 - Use JavaScript
If you really need the UI to be a checkbox, then there is no Spotfire Control to handle that. If the choices you need to allow the user to make is static, then this option is fairly straightforward. If you need the option to be based on the data, then it takes more work.
Let's start with the static case. In a textarea, add an input field and then modify the html to something similar to this:
<label><input type="checkbox" value="check1"> Checkbox1</label><br>
<label><input type="checkbox" value="check2"> Checkbox2</label><br>
<label><input type="checkbox" value="check3"> Checkbox3</label><br>
<div id='mySpotfireControl' style='display:none'>
<SpotfireControl id="344f7da2bc5d4baca88c7e76cb7d429b" />
</div>
Also add a javascript to the text area, similar to this:
$("input[type='checkbox']").change(function(){
var jsValue = $(this).val();
$('#mySpotfireControl input').val(jsValue).blur()
})
This will move the value from the checkbox into the Spotfire Document Property. From there, you can add a limiting expression same as when using solution 1 above.
If you need to generate the set of checkboxes that are available, then you need to generate the html for the text area dynamically. You can do this by writing an IronPython script that inspects the current data, and creates the html for the text area. This IronPython script would need to be invoced somehow, if you want it fully automatic you can trigger it from a data function that runs when the analysis is opened.
In our XPages view controls, we compute a search string (xp:dominoView - xp:this.search) based on dropdown fields on the page, which works great.
But we found that this search returns the results sorted by relevance, and we'd prefer them to be kept in the view's sort order (usually, the first column is sorted ascending).
So, in the Notes client's FT search bar, you can specify this by changing the "Sort results by" flag to "Keep current order (sortable)", and this is also available as URL parameter by adding "SearchOrder=4" - but what would be the correct addition/wording to apply this to a "SELECT" statement resp. the XPages search we use?
The view control has a couple of additional properties that you will need to set; sortOrder and sortColumn.
Also, I believe you need to make the sortColumn sortable on the actual view itself which is on the second tab of the Column properties, "Click on column header to sort".
<xp:dominoView
var="view1"
viewName="your view"
sortOrder="ascending"
sortColumn="your column name">
<xp:this.search><![CDATA[#{javascript:compositeData.searchFilter;}]]>/xp:this.search>
</xp:dominoView>
I would like to create a custom control which shows 3 columns,
column 1, value selected from checkbox (this is ok)
column 2, editable box , this is showing but not working 100%
column 3, a button to remove the row (still to be done)
So far:
After selecting the options, click "Create Rows" button and 1 row appears for each selected option.
Problem:
Only last value in editable box, is used, how can I get the value from each box ?
getComponent("inputText1").getValue() only shows the last value.
Example code is on this URL:
http://snipt.org/AAgd3
You bind the column values to array variables. Exercise 23 has a complete working example: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Tutorial-Introduction-to-XPages-Exercise-23
You just need to adjust it to the source/destination of your data. Let us know how it goes
If you want to bind them dynamically, you can also do this with expression language. It takes a bit of getting around in order to get the fields editable, but the way I've resolved it is to pass a calculated ID into a custom control, then using that for the binding.
For example: If I'm Working with a list of Unique Part Names, I may pass into my custom control a variable for a Comment. If I pass this in as fieldNameComment to my custom control, I can dynamically bind it to an inputText element through the following code.
I'm using a DominoDocument passed in as the dataSource.
Calling the Custom Control:
<xp:repeat var="CurrVal" value="#{DataSource}">
<xc:DynamicTableRow dataSource="#{EmissionsDocument}">
<xc:this.fieldNameComment><![CDATA[#{javascript:CurrVal+"Comment"}]]></xc:this.fieldNameComment>
</xc:DynamicTableRow>
</xp:repeat>
Inside the Custom Control:
<xp:inputText id="inputText5"
value="#{compositeData.dataSource[compositeData.fieldNameComment]}">
</xp:inputText>
As long as (for some reason) none of the string calculations are performed within the expression language syntax, this will yield an editable field. In my testing, if I tried to calculate a value by concatenating any strings, the field would be bound, but not appear as editable under any circumstances. If you want to bind directly to fields, this may be a good approach, but if you want to save your array and parse it through java, then Stephan's solution also works great Hope this helps!
Appended: Added repeat control to show iteration through the data source. Each iteration of the Data Source yeilds a value, CurrVal, to which the string "Comment" is appended. This creates a series of FieldNames based on the Values in the DataSource that are bound to inputs within the custom control called DynamicTableRow
I need to check if a field is of type "Rich Text" using #Forumla in a View. How can I achieve this?
Alternatively, check the byte size of a field also using #Forumla in a View.
You can turn Rich Text into plain text using the #Abstract formula, and then display that in the view. Unfortunately #Abstract does not work in views.
If views themselves won't get the job done, you can always use an agent to process the documents and set a document item value, which in turn can be shown in a view. It's an extra step but often can get the job done. Using LotusScript you could loop through all the document's items and check if they are a RICHTEXT type, and then stamp the document with an "IsRichText" item set to "Yes", for example.
Formula language will not show these values. The closes you can get is #Length. If it is possible in the design, calculate these values is a separate field using lotus script.