Control the URL redirection after the create of a document

Hello,

I want to control the URL redirection after a specific document is created. The redirection is to move to the parent folder.

Should it's possible to do that easily or i have to create a custom User Action with UI Document creation, get parent and navigate ?

Thanks.

0 votes

1 answers

2231 views

ANSWER



I extended the DocumentActionsBean and used the SaveDocument method to achieve this, add in validations, auto-calculate some field values, etc. Modified the line navigationContext.navigateToDocument(newDocument, “after-create”) to use parentDoc instead of newDocument. Worked in 5.5 and 5.6 but haven't tried in 5.7/8.

1 votes



Thanks a lot, very helpfull … I have a last question … How i extend the current DocumentActionsBean and SaveDocument action ? Everytime i'm trying i have an error because i'm using the same component name (documentActions) I think i have something wrong in my XML or with my annotation ..
11/06/2013

Did you add an @Install just after @Scope to make sure your extended component with the same name has higher precedence?

@Name("documentActions") @Scope(ScopeType.EVENT) @Install(precedence = DEPLOYMENT+10)

11/06/2013

Also, not sure if it's still necessary, I also extended the DocumentActions interface and then had my custom DocumentActionsBean implement that (I recall getting another error otherwise)

public interface CustomDocumentActions extends DocumentActions {

}

and then

public class CustomDocumentActionsBean extends DocumentActionsBean implements CustomDocumentActions, Serializable {

11/06/2013

I added the missing @Install and it's work, thanks !
11/06/2013