cancel
Showing results for 
Search instead for 
Did you mean: 

News Ticker in SAP UI5

Former Member
0 Kudos

Hi Experts..

          can anyone tell me how to achieve News Ticker in Sap ui5??

Thanks in advance

Sushmita

Accepted Solutions (1)

Accepted Solutions (1)

former_member182862
Active Contributor
0 Kudos

HI

There are many kinds of news ticker. Can you show us what you wish to have?

Thanks

-D

Former Member
0 Kudos

Hi dennis,

Thank you for the reply,

something like this

regards

Sushmita

former_member182862
Active Contributor
0 Kudos

HI

You can create a custom control like this.

Sample

(we also show how you can customize the control)

-D

former_member197827
Participant
0 Kudos

Hi @Dennis

I am trying to extend sap.m.MessageStrip to give moving/marquee effect .

here is the code :

sap.m.MessageStrip.extend("MovingMessageStrip",{

  metadata: {

     properties: {

       text: {type: 'string', defaultValue: 'Example'},

       showIcon: {type: 'boolean' ,defaultValue:true},

       type:{type:'sap.ui.core.MessageType', defaultValue: 'Error'},

   

     }

   },

   renderer: function(oRm, oCtrl) {

     oRm.write('<div');

     oRm.writeControlData(oCtrl);

     oRm.write('>');

     oRm.write('<marquee >' + oCtrl.getText()+'</marquee>');

     oRm.write('</div>');

   }

});

var myStrip1=new MovingMessageStrip({

  text : "hi messagestrip", // string

  type : sap.ui.core.MessageType.Error, // sap.ui.core.MessageType

  showIcon : true, // boolean

  showCloseButton : true, // boolean

  });

myStrip1.placeAt('content');

Issue is text is moving but I am not able to see its type and Icon being reflected.i.e I am not seeing the text in red color with error icon

What is the wrong with the code..??

Thanks and Regards,

Sagar M Patil

former_member182862
Active Contributor
0 Kudos

can you kindly start a new discussion because this is not related to the original thread.

Thanks

-D

former_member197827
Participant
0 Kudos

Hi Dennis,

Thanks for quick reply.

Please find the link for new discussion

Thanks

Sagar M Patil

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sushmita,

I  am not sure if there is any standard SAP UI5 control for this, but you may try the below piece of code.

I did it for Java Script View.


var html = new sap.ui.core.HTML();

var msg=" news Ticker in SAP UI5"

  html.setContent("<marquee height=\"275\" behavior=\"scroll\" direction=\"up\"  onmouseover=\"this.setAttribute('scrollamount', 0, 0)\"

onmouseout=\"this.setAttribute('scrollamount', 3, 0)\" ><div id=scroll>"+msg+"<div></marquee>");

Hope this Helps !

Many Thanks

Pandu