VMware {code} Community
AS2E
Contributor
Contributor

Link to Workflows using buttons

Hello everyone,

I'm creating a custom web view and I'd like to link to my workflows using buttons instead of the default hyperlinks. I already tired to realise that using the html button-tag, but it didn't work. I may did somethig wrong. Could anyone tell my how to do that?

Thanks a lot.

Reply
0 Kudos
7 Replies
Jinnie
VMware Employee
VMware Employee

Just a few minutes ago, I tried modifying one of my existing webviews to use a button instead of a link, and it successfully started the presentation.
Can you provide a sample of what you are trying and how exactly it fails?

Reply
0 Kudos
AS2E
Contributor
Contributor

Well, I don't really know where to put the whole "span" tag I'm using for the link. I tried something like this and a few other things but nothing happens when I click on the button.

<form action="button.htm">
   <div>
    <button name="btn_vm" type="button" style="margin-left: 16px" value="newVM" onclick="
jwcid='@vco:WorkflowLink' workflow='RequestVM' isdialog='false' issync='false' webformpage='/vmo/Self_Service_Portal/form.html' returnUrl='/vmo/Self_Service_Portal/submitted.html' cancelUrl='/vmo/Self_Service_Portal/default.html'">VM beantragen
    </button>
   </div>
  </form>

Reply
0 Kudos
Jinnie
VMware Employee
VMware Employee

Some of the element attributes are inside the onclick handler. It won't work that way.

And when you label the component as jwcid="@vco:WorkflowLink" then the Tapestry engine automatically substitutes your component for an <a> element.

If you want to use a button, you should try something in this direction:

    <button name="btn_vm" type="button" style="margin-left: 16px" value="newVM" jwcid='@Any' onclick="ognl:'javascript:vmo.workflow.start(\'RequestVM\', \'presNode\', {});'">VM beantragen 2
    </button>

Where "presNode" is the id of the element in which you would like your presentation to be rendered.

could be an empty <div id="presNode"/>, or the document body, if you wish...

If this is not what you really wanted - maybe you should use the @vco:WorkflowLink approach and style the link element with a few css lines, to have a more button-like look and feel.

Good luck!

AS2E
Contributor
Contributor

Great, I almost works. Where can I put the other adjustments like returnUrl, cancelUrl etc.?

Now also the border won't disappear when I start a workflow, which is actually great but I have some display issues. For example the "Fields marked with a * are required" text is on the right side or there are some strange blue lines in front of the description fields (see pictures attached).

Do you possibly now why the web view shows VM, datastore and network numbers (localhost Vm 41, Localhost Datastore 10, etc.) instead of the real names? I already had this problem before, but I couldn't find a solution.

Reply
0 Kudos
tschoergez
Leadership
Leadership

Hi!

I don't have a solution, but maybe some tip: Go to the input presentation of your workflow, and check if there are any "select value as" or other properties set. Maybe a change of them will change the display even in the webview.

Regards,

Joerg

Reply
0 Kudos
AS2E
Contributor
Contributor

I tried to change a few things but the display's still the same. I didn't try to change every property because some of these are mandatory for me. But that's not very important for me, the display isn't that fatal.

It's more important for me to know where I can set the link settings like returnUrl, cancelUrl, etc. Smiley Wink

Regards

Reply
0 Kudos
AS2E
Contributor
Contributor

Because nobody seems to know how to configure set these settings using a button I'll probably reformat my links.

Does anyone know why I can't see the default border when I use links? It works with the button code posted here.

This is the code I'm using for the links in default.html:

<p style="margin-left: 16px;" mce_style="margin-left: 16px">
  <span jwcid="@vco:WorkflowLink" workflow="RequestVM" isdialog="false" issync="false" webformpage="/vmo/Service_Portal/form.html" returnUrl="/vmo/Service_Portal/submitted.html" cancelUrl="/vmo/Service_Portal/default.html">VM beantragen</span>
  </p>

My form.html:

<vco jwcid="@layout/MyBorder" section="literal: home" title="VM beantragen">
<vco jwcid="@vco:WebformContainer">
</vco>
</vco>

Reply
0 Kudos