Show more than 30 attachments in document? - xpages

I am using a "document library" (template: StdXLWebXDocLib).
I can record more than 30 files(attachment) in the same document, but I can only see 30.
Even if I change the Row value.
Is this a XPAGES bug ?
Anyone know the solution?
(with the Notes client, I see them all)
Thank you for your help.

Search in database for string "xp:fileDownload" in Designer. It will show you as result:
Replace in all three design elements rows="30" with rows="0". Then it will show always all attachments.

Afaik the default entries per page of the xpages repeat element (which might be used in this case) is 30. They might just not have added a pager to it.

I don't know that template but if you mean the File Download control you can set the value of the lines to display to 0 to not restrict them so that you can see all attachments available.
You can find that property in "All properties, data, rows".

Related

How to create a View with replication conflicts

I wish to create a view showing a number of fields from notes documents with replication or save conflicts. So far I have managed to create a basic view with a column for the document ID (Contract ID) then the next column states "Replication or Save Conflicts" but I don't seem to able to either get rid of the replocation or save conflcits column or add new columns to show additional fields from the document. Is there a way I can do this? I want to be able to show the view in XPages. Here is the View selection formula I am using;
SELECT #IsAvailable($Conflict)
Conflicts are not displayed good in views. here are a few alternative tips to deal with conflicts that might give you an idea or two :-)
Create a categorized column with the value of the field $ConflictItems in the view you have, then you will see which item is causing the conflict and can take action to prevent it.
When you open a conflict you can use the action menu "View Parent" to compare the parent and the conflict
Ytra ScanEZ is a great tool for finding and resolving conflicts. it is also possible to create a script that will compare the documents and present a diff list.
You can create an XPage to display your conflicts (and parents). The web is more dynamic as it allow you to layout your data in the way you want and is not restricted to the way view in Notes works. This kind of xpage can be displayed in Notes client or Web browser
Use XPages power. Get all documents from the view with your selection formula. But don't try to show any column value and get fields directly from back-end document you get from view entry entry.getDocument().
Sure, it has some performance impact, but for (hopefully) small amount of replication conflict it's nothing serious.

Create domino view dynamically in XPages

I want to know if I can click a button in my XPage and dynamically create a Domino View and then show it in a panel control on the same page. The reason I want to do this is because I have a categorized view and I don't want to lose category data by using full text search. So I am thinking of creating a new view dynamically and pass my search parameters, like end date or start date, into the view selection formula.
Is it possible? Any other alternative solution is also welcome.
yes you can, but you don't want to. A Domino view takes space in the database and quite some time for its first use. So you end up with a lot of views taking space and the need to adjust database space after removal. Your response times will suck big time.
Categories as shown in Notes views are no web interaction pattern, so you might want to solve a problem that actually shouldn't exist.
The preferred method for Domino application is navigation / drill down over search. But you could do a FTSearch where you add your category to the search parameters and render your results in a repeat control instead of a view control. There you have more control over the look and feel.
Whether or not it's the best solution, the answer to the immediate question about creating a view on the fly is yes: the Database class has a couple "createView" methods to allow you to create a new view, either entirely from scratch or based on a named other view. From there, you can use the "setSelectionFormula" and "createColumn" methods in the created View to build what you want. You can't do EVERYTHING with those methods, but it may be enough.
One problem you'd likely run into is ACL access: you'll need Designer rights to the database, which a normal user most likely wouldn't have. If you use the sessionAsSigner object to fetch a signer version of the DB (say, "var signerDB = sessionAsSigner.getDatabase(database.getServer(), database.getFilePath())"), you can work from there. Off the top of my head, I don't remember if you will also have to up the "Maximum Internet access" setting on the last tab of the ACL to Designer as well, but you may.
I am assuming that you are referring to the problem that exists when you choose the documents based on the category. This is something that I find highly annoying and I wish that it was possible to turn this on and off. It makes sense for embedded views, but not for much else.
What I did to solve this was to include the category value in the next column. In this way that text could still be seen, even if it was a flat view.
Alternatively, you could also look into using a repeater control and create your own way of presenting the information. This would be used instead of a (Dynamic)ViewPanel control. You could then present the information any way you wanted as long as it is returned in the viewrow set.
Happy Programming!

Expanding the search on Extension Library Layot Control Search?

We use the search feature in the Extension Library Layout control to search a view. It works as expected. But we wold like to expand that search.
The documents in the view each could have one to many "comment" docments. The documents are displayed on the issue xpage with an "embedded" view. The comment is associated to the issue via the parent's UNID. There is a parentUNID field on each comment but the comment document is not a traditional response document.
We would like to be able to search all issues and their comments without having to display the comment in the view. When the search is performed, we want only the issue document to display in the view.
Is it possible to expand the search (with out creating my own search box) to search the comments as well as the issues? If so how would I do that?
A repeat control may be the best way to do it. Then you can search a view containing both. For each row, if the document's Form is an issue, display that. If it's a comment, get the "parent" and display the values from that.
You might want to make each row contain a Panel, so you can attach a dominoDocument datasource for each row containing the documentId of the issue (remembering to set ignoreRequestParams of course!)

Lotus Notes: remove section from current form

I have a userform in Lotus Notes with three sections: section1, section2 and section3.
The form is used by three employees: emp1, emp2, emp3. Of course there is no real employees ID's but it doesn't matter right now.
And the issue is: before of after opening the form (or right before save it) by emp1 the section2 and section3 must be completely removed from the form (not hided but removed). In case of emp2, removed must by section1 and section3.
Please help me with the question: is it possible to definitely remove section, field or button from the current form by lotus script code.
Put the sections in subforms and place the subforms to form as computed subforms. This way only the section(s) that you want will be on form.
All this should be possible using DXL and LotusScript (in fact we have done this before). But it is not a simple and easy process and I dare to ask if it is really necessary to let people firstly add attachments to a document, only to programmatically remove them afterwards. Would'nt it be a better solution to store attachemnts into separate child documents, visible in the appropriate sections? That way you would keep the document small by still having all attachments. And it would allow you to add more control over what is readable for whom.

Binding computed xpage fields to a form field

There is a lot of questions about binding data to forms. This is very simple. I have a form that uses several computed fields that pull data using an #DbLookup to populate the fields based on a pulldown menu the user selects. The problem is; none of the computed fields save any of the values into the form that it is bound to. The only data that saves on the form is the data that is manually selected (in the case of the pulldown menu) or manually entered. When I use an edit box and don't make it "Read Only" the data saves fine. Why is this so difficult?
Mark -
Couple approaches here I think... but let's walk though something.
Read Only on the edit box is preventing the save. It makes sense. XPages should not try to save something marked "read only".
As Steve says, you're better off here with a computed field. Set the values however and if their bound to the document then I think they will save fine.
Another approach is is to work with scoped variables. When you get your data points... you can put that into scoped variables like:
viewScope.put("myField", myValue)
then you're computed field could be bound to the viewScope variable "myValue".
however this will of course not save back to the document as it's not bound to the document. So what you do if you want that approach is in the document save event... you then use SSJS to assign the values to the doc then. something like:
document1.replaceItemValue("myfield", viewScope.get("myField");
Since xpages basically has the same document events as notes client. This may seem familiar to you.
Hope this helps.
Dave -
NotesIn9.com
Disclamer: I'm answering this from a plane after a trip to Las Vegas. So please factor that into the quality of my answer. :)
You will want to put the data you receive from the #DbLookup in an edit box field(s). A computed field is like a "Computed for display" field in traditional Notes development. You can choose whether to allow the user to change the values or not by the read-only property.
Also see this question if you want the values read-only which it sounds like you do: ReadOnly field in Xpage not submitted
As usual, Dave steered me to something that worked. Being in the larval stages of JavaScript experience, I'm sure there is a better way to do this. I'm just happy it works. Her is the code I put into the QuerySave event of my Xpage.
var cost1 = getComponent('ItemCost1').getValue();
var uom1 = getComponent('UOM1').getValue();
var Num1 = getComponent('ItemNum1').getValue();
var tot1 = getComponent('Total1').getValue();
docuent1.replaceItemValue("ItemCost_1", cost1),
document1.replaceItemValue("ItemUOM_1", uom1),
document1.replaceItemValue("ItemNum_1", Num1),
document1.replaceItemValue("CostTotal_1", tot1)
I have 30 iterations of this so it probably works kind of clunky but the operative word is WORKS. If anyone has a better way to get the same results, please post it so I can learn something. Thanks for everyone's help.

Resources