XPages in Pictures - 08 - Return to Company
Category XPages
This is the 8th Post in the “XPages in Pictures” series.
Ok. Now it’s time to tell the xContact page to return to the parent company when you save a contact.
Open up the xContact Page. Click on the save button and remove the Simple Action “Save Data Sources”. This action allows us to save all the datasources that are bound to the page and gives us a parameter on which page to open next. We’re going to instead use 2 simple actions. The first to simple save the data and another one to open our return page.
Add a new action that uses the category of “Document”. The Action is “Save Document”.
This is a simple save action. There is no return page built in. Click ok to add this to your list of Actions. It will be indented under “Simple Actions Root”.
Now add another simple action. Go back to the “Basic” category and choose “Open Page” for the Action. The name of the page is “xCompany”. The Target document is “Edit Document” and the document ID is where you’re going to reference your sessionScoped variable.
The Document ID box is expecting a specific document id. You can’t type your code directly in the box. You need to compute the ID. Click on the diamond next to the Document ID box and choose “Compute Value”
When in the script edit enter the following code:
sessionScope.get("companyCode")
Click Ok. The Action box should look like this:
Click ok to add the Action, and you now have an Actions Group.
This is the equivalent to having a “Save and Close” action in the Notes client. The document will be saved, and the browser will open the xCompany page, in Edit mode, finding the company document that matched the UNID variable that’s stored in the scoped variable.
Save your page. Go into a company, create a contact and save it. You should now be returning to the correct company after the save!
This is the 8th Post in the “XPages in Pictures” series.
Ok. Now it’s time to tell the xContact page to return to the parent company when you save a contact.
Open up the xContact Page. Click on the save button and remove the Simple Action “Save Data Sources”. This action allows us to save all the datasources that are bound to the page and gives us a parameter on which page to open next. We’re going to instead use 2 simple actions. The first to simple save the data and another one to open our return page.
Add a new action that uses the category of “Document”. The Action is “Save Document”.
This is a simple save action. There is no return page built in. Click ok to add this to your list of Actions. It will be indented under “Simple Actions Root”.
Now add another simple action. Go back to the “Basic” category and choose “Open Page” for the Action. The name of the page is “xCompany”. The Target document is “Edit Document” and the document ID is where you’re going to reference your sessionScoped variable.
The Document ID box is expecting a specific document id. You can’t type your code directly in the box. You need to compute the ID. Click on the diamond next to the Document ID box and choose “Compute Value”
When in the script edit enter the following code:
sessionScope.get("companyCode")
Click Ok. The Action box should look like this:
Click ok to add the Action, and you now have an Actions Group.
This is the equivalent to having a “Save and Close” action in the Notes client. The document will be saved, and the browser will open the xCompany page, in Edit mode, finding the company document that matched the UNID variable that’s stored in the scoped variable.
Save your page. Go into a company, create a contact and save it. You should now be returning to the correct company after the save!
- 


Comments
Posted by Bill Whittakers At 08:50:14 PM On 07/10/2009 | - Website - |
Posted by dilan hotrey At 03:37:12 AM On 11/05/2009 | - Website - |
Posted by Edwin At 05:49:39 AM On 11/30/2009 | - Website - |
Posted by Nova At 03:34:35 AM On 01/26/2010 | - Website - |
Posted by Venomancer At 01:37:07 AM On 02/19/2010 | - Website - |
Posted by Blogger At 01:59:54 PM On 03/17/2010 | - Website - |
Posted by Unlimited At 09:39:36 PM On 04/22/2010 | - Website - |
Posted by Rimki At 07:33:00 AM On 05/24/2010 | - Website - |
Posted by megaupload At 07:12:06 AM On 05/26/2010 | - Website - |
Posted by placement argent At 04:05:33 AM On 06/24/2010 | - Website - |