Xpages link to open document view - view

I want to add an option to the row of the view: the possibility to open the document when clicking on the row. It is possible? How can I achieve this?

Add displayAs="link" to viewColumn. Then it is rendered as link and opens the document if you click on it. You can also choose to open it in edit or read mode.
Set the attributes in properties panel:
Update:
You can open the corresponding document clicking somewhere on a viewPanel's row (not just on a column's link) if you add a rowAttrs property.
Add the following code to your viewPanel:
<xp:viewPanel
rows="30"
id="viewPanel1"
var="row">
...
<xp:this.rowAttrs>
<xp:attr
value="window.open('#{javascript:row.getOpenPageURL(null, true)}', '_self')"
name="onclick"
rendered="#{javascript:!(row.isCategory() | row.isTotal()) }">
</xp:attr>
</xp:this.rowAttrs>
</xp:viewPanel>
Set viewPanel's row variable to var="row". The attribute attr gets rendered for all rows which are represent a document. It adds an individual onclick event to those rows and executes CSJS code defined in value. This CSJS code contains a SSJS part which inserts the URL of the document as window.open's parameter.
If you set getOpenPageURL's second parameter to false then document will be opened in edit mode.
Look here for a detailed description.

I think there is no easy way ;-) Maybe JQuery is your friend to add a on click event to the row with needed

Related

Oracle Forms Builder: Cannot Execute Query

I am using this code fragment:
BEGIN
GO_BLOCK('COMPANY_PRODUCTS');
EXECUTE_QUERY;
END;
in WHEN-NEW-FORM-INSTANCE of my form module.
I also changed the text items of my data block into display items.
The problem is that when I start running my form module, it displays an error stating:
FRM-40106: No navigable items in destination block.
It doesn't have "Enabled" and "Keyboard Navigable" property.
The reason I changed it to display items is because I don't want the user to click and edit the text on the item.
Is there any way can I get through this problem? or should I just stick with text items?
Screenshot: Form Module on Web Browser
make your destination block's all item Display Item, except leave one of them as Text Item ( preferably the first one in the physical sequence of items [topmost or leftmost]). And then, set that text item's Update Allowed and Insert Allowed property to No from Database section of Property Palette.

Export Dropdown Selection in Kendo Editor to Word Document

I've been trying to get a selected dropdown option to appear in a Word Document on export.
The current default behavior is that all option tags appear in the exported document with no indication of which was selected. (This makes sense that this behavior would occur since the export function is simply exporting all the html as plain text).
So far, these are the approaches I've tried (none of which work):
-Capture the export event before it is sent to the controller via the javascript execute event (thus being able to strip out any unwanted text). The issue is the execute event and exportas event are asynchronous, so I can't modify the file before the export event call is executed.
-Modify the text on the controller side before it is converted to a Word document and downloaded (the text is sent through without special characters, which makes it nearly impossible to parse)
-Attempt to replace the dropdown with a kendo autocomplete widget (this would also be an acceptable solution). The widget does not render properly inside the document. All of the datasource options are there and even filters corretly, but it does not style correctly or open.
Has anyone else been able to find a solution to this problem or have another approach I could use?
EDIT:
As per requested, here is a screenshot of the base code:
My initial idea on how you could accomplish this:
1. Pull that select list out of your editor.
2. Bind an event handler to the change event of your list to add the value of your list into the editor. Are you using JQuery in your project? It's a dependency for Kendo so this ought to work:
$("#selectListId").on("change", function () {
$("#editor").val( $("#selectListId").val());
});
In reality though I'm guessing this approach will be used to populate some template of text with values selected by the user? In that case, you may want to save the template first before applying the value selected.
Now that you've identified you need that dropdown menu to be usable on the exported word document, attempt the following:
Create a new word document.
In that word document, open the Developer tab. (If you don't know about it, google how to enable it)
Insert a new Dropdown Menu Content Control using the Developer tab.
Select this content control, then open Properties menu item on Developer tab.
Update the content control with your values:
Save this word document.
Use the Kendo Editor Import to import this document containing your template.
Attempt exporting what was just imported.
If that works and the editor has editable dropdowns from that content control, I will be very surprised... Good luck!

Jqgrid - How to create a custom add-button that you can supply of parameters

When you create a jqgrid there is a default button on the bottom of the grid that allows you to create new records.
However, when you open the modal, all input fields are empty.
In my situation I need this button, but I also need the exact same thing but with the possibilty of adding a few parameters so some of the fields are already filled in. The parameters would come from the selected row at that moment.
Like when I click a row where the date is set to 01/01/2099 i need the add-modal to open with the date already set to that date.
You can use beforeShowForm or afterShowForm to make any changes in the Add Form during opening. For example you can read the values from currently selected row and fill some fields of the form with new values. To be open Add form on click or double-click on the row you need just call editGridRow inside of onSelectRow/ondblClickRow callback.

Can I search for an object by its name within a form in VB6?

As declared in the title, for example, I want to search for a button whose name is button8, within a form where there are so many buttons that I do not want to check the name one by one.
Can I do this in VB6?
You should just be able to refer to the control via the controls collection, like so:
Me.Controls("Button8")
See this link.
Here's how to find a control in the form designer, if you know the name.
Go to the form designer, open the property window (press F4), and use the dropdown to choose the control. This shows the properties in the window (and you can edit them). It also selects the control onscreen.

XPages - Bind Document Data Source in a embedded Custom Control

I created a custom control that is binded to a a Domino Document data source. I embedded it in a page so that I can display it in a Dojo dialog. It has 2 properties: dialogId and docId. The document data source's Document ID property is set to compositeData.docId. In the page, I set the docId property to a viewScope variable, that will be set when an entry in a view is clicked. What I want to accomplish is that the dialog will display the document that the current view entry (that was clicked) represents. But it seems that the compositeData.docId is not set on partial or even full refresh. Is there a way to do this that the custom control will be binded to the document? I need to have this binding so that I can easily do a server-side validation when I submit the dialog. Or if there is another way, can you also put it here? Thanks a lot!
set the datasource as the document, and then edit mode, then you have a place to compute the doc id, i usually compute the doc id to a viewScope, that i set when i click the item in the repeat control
More details here.
I would prefer the DocId to be transfered via the custom control parameters rather than a Scope variable. Using the Scope breaks the custom control design principle of being self contained. You can use the yourCC.PropertyMap to actually update a value, so the hand over of the parameter will work - of course your control then needs to be refreshed so the data source is recomputed. Hope that helps.

Resources