Getting to a Web App next page using a script

Avatar

Avatar

sagil23995776

Avatar

sagil23995776

sagil23995776

19-07-2017

Hi,

I have an Adobe Campaign Web app with 2 pages.

I'm trying to enable a transition between the first and the second page via a link and a script since I need to use variables in the second page.

This is the HTML that calls the function:

<a href="#" title="Edit" onClick="updateContent('inbox','<%= promotion.@workflow_internal_name %>')">Edit</a>

and this is the 'updateContent' function in the web app Header that triggers the transition to the next page:

  function updateContent(channelEdit, templateEdit) {

      document.controller.setValue('/ctx/vars/varChannelEdit', channelEdit);

      document.controller.setValue('/ctx/vars/varTemplateEdit', templateEdit);

      document.controller.submit('next','_self','next');

  }

When I'm doing preview on the web app everything works fine,

But after publishing the web app it only works through the web client.

If I'm in the rich client clicking on the link the first page is being reloaded again and I'm not being moved to the next page.

Does anyone knows what can cause this?

Thanks,

Sagi

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

david_garcia1

MVP

Avatar

david_garcia1

MVP

david_garcia1
MVP

26-07-2017

Add an onclick function to the link and in the function enable the transition ie.

p.s - submit would be the name of the transition you want to activate.

Answers (4)

Answers (4)

Avatar

Avatar

sagil23995776

Avatar

sagil23995776

sagil23995776

27-07-2017

I Understand now after trying David solution that

apparently the onClick event doesn't work from an <a> tag but on  <img> or <p> etc it does work.

I've modified my code a little and it works now.

Thanks

Avatar

Avatar

david_garcia1

MVP

Avatar

david_garcia1

MVP

david_garcia1
MVP

27-07-2017

Good 1 that you've resolved the issue.

Avatar

Avatar

sagil23995776

Avatar

sagil23995776

sagil23995776

27-07-2017

Hi,
I mean that on the preview when editing the web application it works fine before and after publishing.
But after I publish if I'm testing it live by clicking on the link through the published page the transition works only on the web client and not on the rich client.

My code is same as suggested by david_garcia (just without the verification)

version 6.1.1 build 8687

server: version 6.1.1 build 8754

Thanks

Avatar

Avatar

florentlb

Total Posts

1.1K

Likes

234

Correct Answer

239

Avatar

florentlb

Total Posts

1.1K

Likes

234

Correct Answer

239
florentlb

26-07-2017

Hi Sagi,

Do you mean that the preview isn't working anymore from the rich client once the web app is published?

Did you test it live after the publication to see if you encounter a problem?

Can you share wich build you are using? (for both console and server).

Thanks you,

Florent