Hi, On Tue, Jul 25, 2017 at 1:16 PM, ASHU_JAVA <ashu....@gmail.com> wrote:
> Hello Martin, > > I'm trying to use "Jquery Marquee" > <https://www.npmjs.com/package/jquery.marquee> to implement the > required > functionality. > > I've made an HTML sample <https://jsfiddle.net/ttj41sdb/> (JSfiddle), > which is working fine but I'm unable to replicate the same in Java Wickets. > > Here's my code:- > > HomePage.html > > <div wicket:id="newsDetails" class="col-md-5" style="padding-right: > 5px;padding-left: 5px;float:left;height=100%;"> > </div> > > HomePage.Java > > add(new MyPanel("newsDetails")); > > MyPanel.Html > > <?xml version="1.0" encoding="UTF-8"?> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns:wicket> > <head> > <title></title> > > > > > > > > </head> > <body> > > > <wicket:panel> > > <ul class='marquee'> > > <li wicket:id ="news"></li> > > </ul> > > </wicket:panel> > </body> > </html> > > MyPanel.Java > > public class MyPanel extends Panel { > > private static final long serialVersionUID = -7322692526459024428L; > @SpringBean(name = "manageMyApplication") > protected ManageMyApplication manageApp; > private List<MyBean> list; > > public MyPanel (String id) > { > super(id); > > RepeatingView repeatingView = new RepeatingView("news"); > List<MyBean> results = getAllItem(); //Getting List from > database > if(results!=null){ > MyBeanvalues = results.get(0); > > if(StringUtils.isNotEmpty(values.getList1())){ > repeatingView.add(new > Label(repeatingView.newChildId(),values.getList1())); > } > if(StringUtils.isNotEmpty(values.getList2())){ > repeatingView.add(new > Label(repeatingView.newChildId(),values.getList2())); > } > if(StringUtils.isNotEmpty(values.getList3())){ > repeatingView.add(new > Label(repeatingView.newChildId(),values.getList3())); > } > } > > add(repeatingView); > } > > > } > > MyResourceInitialize.java file contains javascript reference to load: > > @Override > public void renderHead(final IHeaderResponse response) { > response.renderJavaScriptReference(new > JavaScriptResourceReference(LocateResources.class, > "js/vendor/jquery.marquee.min.js")); > > response.renderJavaScriptReference(new > JavaScriptResourceReference(LocateResources.class, > "js/newMarquee.js")); > super.renderHead(response); > } > > The Javascript code has been added to "newMarquee.js" file as given below:- > > $(function () { > $('.marquee').marquee({ > > duration: 15000, > duplicate: false, > delayBeforeStart:2000, > > allowCss3Support: true, > gap: 600, > > }); > }); > > > But the issue is the Javascript file "newMarquee.js" and the css mentioned > in MyPanel.html fails to load. > Fails to load how ? Error 404 ? Another error ? What is the generated HTML ? Is 'js/newMarquee.js' next to LocateResources.class in target/classes/... ? > I've tried using AjaxEventBehavior to append Javascript in Wickets code but > that too didn't work. > > Can you please share some inputs on how to achieve this? > Thanks in advance. > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/Message-Scroll-Banner-in-Wickets-tp4678245p4678280.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >