You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by joinow <jo...@yahoo.com.cn> on 2010/08/23 16:11:53 UTC

Re: Error Message from ResourceLink within a portlet

sorry, two pieces of code are:

		final WebResource csvsrc = new WebResource() {

			/**
			 * 
			 */
			private static final long serialVersionUID = 1L;

			@Override
			public IResourceStream getResourceStream() {
				// TODO Auto-generated method stub
				IStringResourceStream srs = null;
				if (true) {
					CharSequence cs = getCsvData();
					srs = new StringResourceStream(cs,
							"text/csv");
					srs.setCharset(Charset.forName("UTF-8"));
				} else {
					
				}
				return srs;
			}	
			
		};
		
		ResourceLink rlink = new ResourceLink("myresource", csvsrc) {
			@Override
			public void onClick() {
			
			}
		};
		this.add(rlink);

and:

	/**
	 * @see org.apache.wicket.IResourceListener#onResourceRequested()
	 */
	public final void onResourceRequested()
	{
	
		Random random = new Random();
		if (random.nextBoolean()) {

			this.error("blablabla");
			
		} else {
			resource.onResourceRequested();
		}
		onClick();
	}
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-Message-from-ResourceLink-within-a-portlet-tp2335133p2335177.html
Sent from the Wicket - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org