Get jspx at SourceForge.net. Fast, secure and Free Open Source software downloads home | download | demo project | contact us
jspx

Rate this article:

email
comment
Average Rate= 0.0

Button Loading

Buttons invoking events in ajax mode should show some indication that the server is working on the user request. This can be done with the data-loading-text="working..." Attribute

Demo



			<page contoller="org.bay.jspx.demo.live.ButtonLoadingController" >
				<html>
					<body>
						<form>
							<ajaxPanel>
								<input type="button" onServerClick="doSomthing" value="hit me!" data-loading-text="working..."/>
							</ajaxPanel>
						</form>
					</body>
				</html>
			</page>
			

package org.bay.jspx.demo.live;

import eg.java.net.web.jspx.ui.controls.WebControl;
import eg.java.net.web.jspx.ui.pages.ContentPage;

/**
 * @author Amr.ElAdawy
 * Apr 3, 2014 12:01:19 PM
 */
public class ButtonLoadingController extends ContentPage
{

	public void doSomthing(WebControl sender, String args)
	{
		try
		{
			Thread.sleep(2000);
		}
		catch (InterruptedException e)
		{
			e.printStackTrace();
		}
		messages.add(new JspxMessage("You'r done!", "Done", JspxMessage.SUCCESS));
	}
}