Present - automatic rotation of slides

Keith Wheldon shared this idea 3 years ago
Idea Logged

Use case - We are looking to use Present to display our data on a rotation basis (e.g. wall board).

Description - Automatically moves to next slide after [x time amount] - once it reaches the end it then starts again.

Replies (9)

photo
1

Hi Keith,

I like this idea! I've gone ahead and submitted an enhancement request for this. Any potential updates regarding this will be posted here.

Regards,

Mike

photo
1

Hi Keith,

This is currently possible via Code Mode.

If you add the following to your Present's JS section in Code Mode, it will cycle through the Slides in the report every 10 seconds, and goes back to first slide when reaching the last slide:

setInterval(() => { this.apis.dashboard.nextSubTab()}, 10000);
/9b9b9607e48b57a8d36bdab049ade0a4Please give this a try and let me know how goes.

Regards,

Mike

photo
1

Mike,


This worked a treat ... for the first cycle... then it did reset to the front page... but then when it tried to cycle again, it started to miss the visuals (i.e. kept on sowing blank slides (where there are none) and then when it moves to the next slide, you briefly see the correct slide then it goes to a non-existing blank slide again.

photo
1

Mike,


We now also have an additional issue... it wont let me edit the presentation now...


/d4cd9497d8e9d906981913abe309fb73


This may be an issue, as the presentation was nearly complete....

photo
1

Error: java.lang.NullPointerException

At:

com.hof.mi.web.action.MIBrowseAction.execute(MIBrowseAction.java:286)

com.hof.mi.web.framework.spring.controller.FormBindingSpringController.handleDefault(FormBindingSpringController.java:125)

com.hof.mi.web.framework.spring.controller.MIFormBindingController.handle(MIFormBindingController.java:57)

sun.reflect.GeneratedMethodAccessor1000.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

java.lang.reflect.Method.invoke(Unknown Source)

org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)

org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)

org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)

org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)

org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)

org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)

javax.servlet.http.HttpServlet.service(HttpServlet.java:635)

org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)

javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

com.hof.servlet.SessionTimeoutFilter.doFilter(SessionTimeoutFilter.java:68)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

com.hof.servlet.CORSHeaderFilter.doFilter(CORSHeaderFilter.java:43)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

com.hof.servlet.BrowserHeaderFilter.doFilter(BrowserHeaderFilter.java:43)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)

org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)

org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)

org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)

org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)

org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)


java.lang.Thread.run(Unknown Source)

photo
1

Hi Keith,

Hmm, this worked for me in my testing exactly as described/desired. Did you add the code to the JS section of the Present itself? Or for one (or more) of the pieces of Content on the Present? If the latter, it should just be in JS section of Present.

As for the 'Oh no!...' error, let's see if we can try and narrow it down to whether this relates to the newly added script. You should be able to locate, then subsequently delete, or perhaps more safe, alter, the 'setInterval((' etc. entry from the TextData table. It should be one of the newest entries there.

As you can see in my environment, it's contained in entry TextId 2046 out of 2047:

/ed288155e407d793fad93d76b807e019

I'd recommend either deleting this line, or if other information is there like there is in mine, copy + paste, remove the 'setInterval...' portion, then update the entry so it doesn't include this portion any more. Please let me know how goes.

Regards,

Mike

photo
1

Hi Keith,

One other thing, one of our Consultants came up with what may be a more elegant solution for this as well:

Paste this in for each slide except the last.

let dashboard = this.apis.dashboard;

var myVar = null;

var i = 0;

function loopReportRun() {

myVar = setTimeout(function() {

dashboard.nextSubTab();

i++;

endLoop();

},5000);

}

function endLoop(){

clearTimeout(myVar);

console.log('Loop destroyed');

}

this.onRender = function () {

loopReportRun();

};

this.onRemove = function () {

endLoop();

};

Paste this into the last slide to restart the loop


let dashboard = this.apis.dashboard;

var myVar = null;

var i = 0;

function loopReportRun() {

myVar = setTimeout(function() {

dashboard.moveToTabAtPosition(0);

i++;

endLoop();

},5000);

}

function endLoop(){

clearTimeout(myVar);

console.log('Loop destroyed');

}

this.onRender = function () {

loopReportRun();

};

this.onRemove = function () {

endLoop();

};

So after deleting the bad entry and you're able to edit again, let's try it this way and let me know how goes.

Regards,

Mike

photo
1

Mike,


i could not gain access to delete that line of data.. so i just deleted the presentation.. i have tested the new JS and it works perfectly..

Many thanks for such a quick resolution.

photo
1

Hi Keith,

Great to hear we found a solution that works for you! I'll keep this set to Idea Logged to track a UI solution for this and any potential feedback regarding that will be posted here.

Regards,

Mike

Leave a Comment
 
Attach a file