0
votes

Right now I am working on a Xpage which displays data from a domino document. Based on the form of the document different fields will be displayed. Now I want to create a "New" function. My idea here is to set the view I am previously using in edit mode. Additionally, I want to add a radio button which enables a user to choose the form of the document he wants to create. Based on this radio button the document form should change which should result in the elements displayed on the page changing too. Overall if I switch between the radio button options and hit save, a new document will be created with the right form. Yet my problem is that my elements in my view won't change dynamically. So if I switch my form there will still be elements/controls displayed for the default option but not the selected form. My idea was to create an onChange-event for my Radio Button Group. My questions here would be: How can I change my formValue for the Xpage (new document) and then reload it with the new set value?

1
Can you give a more concrete example of what you intend to accomplish? Why one New button and not New A, New B and New C? And what do you mean by "set the view ... in edit mode"?D.Bugger
Sorry, I am quite new to notes, so I am not used to terminology yet. By set the view in edit mode I meant to change the document mode to "edit".lucas
So far I am using one view that is capable of opening different forms. Depending on the document form elements will be hidden/shown. Viewing and editing these documents works fine. Now I am looking for a "new" page to create a new document. I want to recycle my view and use it for this purpose. Yet if you create a new document the document form is not defined. To solve this I added a radio group which is linked to document1.Form. Now I can create these different forms of documents. But changing the radio button value won't change page elements.lucas
Process right now would look like: new- choose form- save - open document - edit I want to skip the reopening of the document and instead being able to access all necessary fields in the process of creating a new document so that I do not have to save it first. So as soon as I change the value within my radio button group, I want my page elements to adjust.lucas
I could toggle visibility of elements with csjs depending on radio group value but I would rather like the page to reload because I set some attributes for my elements on ssjs.lucas

1 Answers

1
votes

Thanks for your explanation.

I understand you have one XPage suitable for multiple forms, I assume using a Switch control and custom controls per form. About the New button, you could try first to have 3 New buttons, each for a separate form, and you create a URL like yoursite.com/xpage.xsp?action=newdocument&form=someform

When the user clicks the button, your page can read the parameters (param.action and param.form) and act accordingly. Or do you intend to update the current page using partial refresh, as a single page approach?