Robert F Harwood commented on Jan 13, 2012

Re: Tutorial: Introduction to XPages - Exercise 17

checked

Kenneth Eschrich commented on Oct 20, 2011

Re: Tutorial: Introduction to XPages - Exercise 17

Scratch the last comment to @All

Exercise 19 shows the proper code to make the remove button work as expected:

friend.getDocument().removePermanently(true);

Kenneth Eschrich commented on Oct 20, 2011

Re: Tutorial: Introduction to XPages - Exercise 17

@Rob- Make sure that you have the FriendID column in the friends view sorted. See http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=/com.ibm.designer.domino.api.doc/r_domino_View_getAllDocumentsByKey.html. Note in "Usage": "For this method to work, you must have at least one column *sorted* for each key." (Emphasis added).

@All- I attacked the problem removing a friend slightly differently, replacing the FriendID in the document with a keyword, "delete", which can later be search for by an agent or otherwise and all documents with FriendID delete removed at that point:

friend.replaceItemValue("FriendID", "delete");

friend.save;

Rob Foster commented on Oct 19, 2011

Re: Tutorial: Introduction to XPages - Exercise 17

The javascript code for the repeat control doesn't work in either step 17 and/or 19.

Can anybody help? Thanks.

Viet D1 Nguyen commented on Oct 19, 2010

Tutorial: Introduction to XPages - Exercise 17

I used R8.5.2 and gets the same problem. Tried a work around by calling an agent, passing the agent the NoteID of the friend. In the agent, get the document and delete it. (See more details on the lesson 20 in this series).

The code for Remove button: noteid = friend.getNoteID();

ag = database.getAgent("RemoveDoc");

ag.run(noteid);

RemoveDoc is a simple LS agent, where the curent document is obtained by:

set ag=s.CurrentAgent

noteid = ag.ParameterDocID

set doc = db.GetDocumentById(noteid)

Ilkka Horto commented on Apr 13, 2010

Tutorial: Introduction to XPages - Exercise 17

Task 20.

Remove) link doesn't work. I try to remove a friend.

Any help? Thanks.

1. First I will get the following popup message:

"A site area of transmission does not succeed.

_10f.push is not a function. Do you want send the entire page".

Then...

2. Error message:

Unexpected runtime error

The runtime has encountered an unexpected error.

Error source

Page Name:/profile.xspControl Id: link1 Property: onclick

Exception

Error while executing JavaScript action expression

Script interpreter error, line=1, col=8: Error calling method 'getDocument()' on an object of type 'lotus.domino.local.Document'

Javascript code

1: friend.getDocument().removePermanently(true)