On what should I pay attention when I want to create a cancel or a park button in my Html Dialog?

asked 08.09 at 01:43

Alex%20Suter's gravatar image

Alex Suter ♦♦
735824
accept rate: 89%


If you want to create a cancel button or a park button in your Html Dialog, you can create commandButton in your view.

<p:commandButton actionListener="#{logic.park}" value="Park" update="form" />

This button calls an event in which you can implement an Ivy script step where you can park now the current task.

ivy.session.parkTask(ivy.task);

Now comes the tricky part. Instead of continuing the process normally, you send a redirection to the browser:

String redirectScript = "window.location.href='"+ivy.html.taskListRef()+"';";
RequestContext.getCurrentInstance().execute(redirectScript);

The event logic.parkTask should not lead to an User Dialog Exit End which would close the dialog and go on with the process. It should lead to a User Dialog Process End.

You can do the same for the cancel button, but you would call ivy.task.reset() instead of parking the task.

link

answered 08.09 at 01:58

Alex%20Suter's gravatar image

Alex Suter ♦♦
735824
accept rate: 89%

edited 08.09 at 01:59

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×59
×49
×9

Asked: 08.09 at 01:43

Seen: 33 times

Last updated: 08.09 at 01:59