using this tutorial ( altough, I did some minor changes ): http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPagesViewControlAddFullTextSearch.htm .
My search is OK, and also, the search results are displayed correctly for a plat view ( uncategorized ).
I would like to display my search results ( docs. ) inside a categorzied + sorted ( ascending ) viewPanel which lists some docs. having 2 formName = rowData.getDocument().getItemValueString("Form"); different values.
Indeed, the search is working fine, but when I display the results into my viewPanel, the first column ( which is categorized and sorted ascending ) is missing ... and so the link between the resulted docs ( these docs. are linked by a common field ) is gone.
How can I resolve this issue?
My guess is that there are some certain rows which don't represent a Document ( these docs. are represented by the 1st column categorized ) ... and because of it, the FTsearch don't display those specific rows.
Thanks for your time!
As in normal categorized views in the Notes client, search results won't be displayed with categories. As the view control uses the same data and collection as source the same behavior will be used in Xpages views.
Basically you have to roll your own and then use a repeat or data table. Do your full text search in code (Java or SSJS) and then loop through the results and build an array list of objects. Each object could hold what you want to display in the columns.
Howard
Related
In this minimal case situation I have table with filed referencing another table entries.
When I'm adding main_entries entry, I have dropdown with entries from referenced table. When there isn't entry in referenced table I need, how can I create this new entry from this view (i.e. not leaving main_entries form)?
have this situation:
Model:
db.define_table('main_entries',
Field('type', 'reference entry_type' )
)
db.define_table('entry_type',
Field('label')
)
Controller:
def entries_edit():
form = SQLFORM.grid(db.main_entries)
return dict(form=form)
View:
{{extend 'layout.html'}}
{{=form}}
You can manage this by using the left option of SQLFORM.grid
left is an optional left join expressions used to build ...select(left=...).
It makes sense to combine this with the field option to specify the fields of both tables which should be displayed.
fields is a list of fields to be fetched from the database. It is also used to determine which fields to be shown in the grid view. However, it doesn't control what is displayed in the separate form used to edit rows. For that, use the readable and writable attribute of the database fields.
And don't forget to reference the leading table by the field_id option
field_id must be the field of the table to be used as ID, for example db.mytable.id. This is useful when the grid query is a join of several tables. Any action button on the grid(add record, view, edit, delete) will work over db.mytable.
cf. SQLFORM.grid signature
You must specify relationship in query.
You can try something like this:
def entries_edit():
query = db(db.main_entries.type == db.entry_type.id)
form = SQLFORM.grid(query)
return dict(form=form)
Folks:
I have recently begun working with xPages. I have a view of documents that needs to present data from other related documents in six separated columns. What I am trying is to use a Computed column that does a lookup to a view with a concatenated string. My intention was to parse this into the 6 columns of data. It isn't working and it may be silly of me to try referring to a computed column in another computed column.
Another alternative was to have the underlying view present the UNID of the other document and then do a #GetDocField on the xPages view.
So I have two questions:
1) May I programmatically refer to a Computed column in a view from another Computed column?
2) For efficiency, what would be the best way to present data like a 'join' in a view?
I appreciate your attention and help.
Cheers,
John Collis
Can you try to “go native” ? You build one view that contains both documents arranged to be in that view after each other. So you have Type1,Type2,Type1,Type2 etc.
Then use a repeat control to render a table or list “joining” the two rows.
This would save you doing tons of lookups.
Eventually you use that view as Json Rest source to do the joining in Json
I would create a Java bean that returns a list of Java objects that contain your data.
I am trying to create 2 custom fields on a Sales Order; to show the total number of items that are unfulfilled, and the total combined $ amount of those items.
I have been searching for awhile and the only help I could find is that this should be possible with a saved search.
So, I have created a saved search;
And I have created a custom transaction field (see below) which I believe is referencing my saved search, but how do I select which value it refers to? The field underneath where I selected my saved search BACKORDERS SUMMARY, doesn't appear to be related at all.
The Field dropdown below the Search is not for selecting from the search results field. Summary Searches provide 1 summary value only. If you want 2 different values, you need 2 different searches.
The Field dropdown is used to select the field from the current record to use as the filter for the saved search. Assuming your custom fields are placed on the Sales Order, you'll want to set your Available Filters criteria to Internal ID and leave the Field dropdown on the custom summary search field blank. (ie: just select your search from the Search dropdown. NS will pass in the internal id when the record is loaded.)
Try splitting your Backorders Summary search into 2 different searches, each with a single summary result type, update the filters, and set the Search drop downs to the appropriate values. Should work just fine.
I'm trying to make a view that will display possible duplicate documents. So a selection formula that compares one field over all the documents and only diplays those that are similar.
I ahve been playing arond with #Like and #Matches, but can't seem to get it to work. Is this possible?
Thanks
You can't reference from a view selection formula to other documents. The selection formula works only for the current document and decides if this document shall be visible in view.
You can write an agent which compares all documents with all the other documents and sets a flag (=item/field) to a document if it has similar fields with the other documents. You can then select all those flagged documents in your view.
You can create a view where the first (sorted) column contains the field you want to check against. Then use #SetViewInfo to filter the view to only show documents matching a specific value.
We have designed Lotus Notes forms, where we are displaying the data from the external system in a tabular format. In the tabular display we have editable fields, where user enters amount in these editable fields. Now we need to add the data from these editable fields and display in the totals field at the bottom dynamically.
Could some one please help me in this regard with code.
The current code:
The current editable fields are with name:
PE_TOBEPOSTED, PE_TOBEPOSTED1, PE_TOBEPOSTED3 and the total field is TOT_AMT. So in the field value of TOT_AMT the following code is written
w_postd := #Left(PE_TOBEPOSTED;15);
w_postd := #ProperCase(#Name([CN];#Left(w_postd;15)));
w_postd1 := #Left(PE_TOBEPOSTED1;15); w_postd1 := #ProperCase(#Name([CN];#Left(w_postd1;15)));
TOT_AMT = w_postd + w_postd1 + w_postd2
PS: I am just two weeks old in Lotus Notes development
Thanks.
Regards,
Kishore
To sum values, there is an #SUM formula that works like this:
#SUM(PE_TOBEPOSTED : PE_TOBEPOSTED1 : PE_TOBEPOSTED3);
Here, the values listed within the parenthesis, and separated by colons, are the names of the fields you want to sum. So this assumes there is a number in the PE_TOBEPOSTED, PE_TOBEPOSTED1, and PE_TOBEPOSTED3 fields.
You can add a refresh button to cause the page to recalculate. The code for the button is:
#Command( [ViewRefreshFields] )
Ok as you are totally new at this, there is a number of things you need to take into account.
First if you want the changes to happen while the user is interacting with the document in the Notes Client then you should use the NotesUIDocument object in LotusScript.
If you want the changes to happen when no UI is being interacted with you would use the NotesDocument Object.
I strongly recommend reviewing the Infocenter for the related documentation. Every LS Object reference has matching sample code.
For example here is the one for the NotesUIDocument on how to get a field from the document.
http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.designer.domino.main.doc/H_EXAMPLES_FIELDGETTEXT_METHOD.html
You would get the text from the related fields, then use CINT method to change the strings to Integer numbers, add them and send them back to the document.