JavaScipt: edit text value in html textArea elements

Here is how to edit text in a web page textArea component programatically by JavaScript function. Put it in page <head>: <script language="javascript" type="text/javascript"> function addtext() { var newtext = "Text to display"; document.myform.outputtext.value = newtext; } </script> Then call this method after button click: onclick="addtext() " as this function is quite simple, it is … Continue reading JavaScipt: edit text value in html textArea elements

JavaScript: page refresh after timeout

If webpage business logic requires to refresh it after some timeout, the JavaScript function can help. If you use JSF, take a look here to see how to refresh page from Java code. Put this code in page <head>: <script type="text/javascript"> function refresh (timeoutPeriod){ refresh = setTimeout(function(){window.location.reload(true);},timeoutPeriod); } </script> and call it, for example in … Continue reading JavaScript: page refresh after timeout

CMS comparison – how to choose the best CMS, that suits you?

When choosing CMS (Content Management System), one have a lot to choose from. Before you will decide to give a try to one of the most popular, like Joomla!, Liferay or Drupal, it is worth to compare them with other solutions. Very detailed compare site is: CMS-Matrix. Huge amount of CMS are there and all … Continue reading CMS comparison – how to choose the best CMS, that suits you?

Refresh JSF page programmatically from JavaBean

When business logic in JavaBean decides that forced jsf page refresh is needed, it can be done from logic's level. Add this code to your logic (prefereably put it in some refresh() method): FacesContext context = FacesContext.getCurrentInstance(); String viewId = context.getViewRoot().getViewId(); ViewHandler handler = context.getApplication().getViewHandler(); UIViewRoot root = handler.createView(context, viewId); root.setViewId(viewId); context.setViewRoot(root); Browsers may have … Continue reading Refresh JSF page programmatically from JavaBean