cancel
Showing results for 
Search instead for 
Did you mean: 

How to display clock?

Former Member
0 Kudos

Hi all,

Plz tell me how to diaplay clock in web dynpro application?

Regards,

SSS

Accepted Solutions (0)

Answers (4)

Answers (4)

gill367
Active Contributor
0 Kudos

not able to paste the code right now

will do it as soon as possible

Edited by: sarbjeet singh on Jun 16, 2009 3:37 PM

gill367
Active Contributor
0 Kudos
public void wdDoInit()
  {
    //@@begin wdDoInit()
    String str = "<<write the HTML code for displaying clock in the web page here >>>";

  try{



IWDCachedWebResource resource =
 WDWebResource.getPublicCachedWebResource(		
str.getBytes("UTF-8"),
	   WDWebResourceType.HTML, 
	   WDScopeType.CLIENTSESSION_SCOPE,
	   wdComponentAPI.getDeployableObjectPart(),
	"clock.html");

resource.setResourceName("clock.html");
resource.setReadOnce(false);
wdContext.currentContextElement().setSource(
resource.getAbsoluteURL());						
    }
    catch(Exception e)
    {
    	
    }
}

hope it will solve your problem

regards

Sarbjeet singh

Edited by: sarbjeet singh on Jun 16, 2009 3:46 PM

gill367
Active Contributor
0 Kudos

Hello SSS,

To display a cloack in web dynpro java view you have to do a work around. You need to use iframe.

For creating an iframe insert child in the layout and place this iframe where you want to display the clock.

Now change its width and height to 150px and 70px respectively

now create a value attribute named source of data type string.

then in the wddodinit method write the following code:-

Former Member
0 Kudos

I think that sarbjeet was trying to tell you to make the clock on an html page, and then put the html page inside an iframe. You can make the html clock with some javascript or java applet ..or flash I think

But do you really want to show a clock on the webdynpro? or maybe you want to show a "time help value" ..like the one on the Date type?

If you need the time you can make a work around and just show the current time

siddharth_jain
Active Contributor
0 Kudos

Hi First check whether NW WAS version support Clock ui element ,if Clocjk Ui element is available in WD try to use it and see if it works and fulfill your requirement,

if not then a dirty workaround will be to use deprecated IFrame ui element and in it refer your Custom developed clock deployed on server and developed in JSP/D/htmt.

Siddharth

former_member192434
Active Contributor
0 Kudos

Hi

where u want to display clock, if you want to display it on portal log on page then you can use jsp, javascript using desgin a digital clock and display it on portal.

Thanks

AB