You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by konbs <ko...@gmx.de> on 2008/01/23 09:41:33 UTC

Re: Tomahawk 1.1.3 inputFileUpload solution

Hey Doug,
thanks for the great tutorial. I'm using the upload function to provide text
import capability - so don't need the actual text file after extracting the
content. I'm setting the upFile reference to null after proceeding. Is that
sufficient, to make sure that any files will be left? I appreciate any help
in advance.

Kon

That's my code:

  private UploadedFile upFile;
...
public String getContentFromTextFile() {
		try {
			if (upFile.getName().endsWith(".txt")) {
 
				InputStream inputStream = upFile.getInputStream();
				InputStreamReader infile = new InputStreamReader(inputStream);
				BufferedReader inbuf = new BufferedReader(infile);
				StringBuilder stringBuilder = new StringBuilder();
 
				String line;
				while ((line = inbuf.readLine()) != null) {
					stringBuilder.append(line);
					stringBuilder.append('\n');
				}
				
				this.currentQuestion.setText(stringBuilder.toString());
 
				return "forward";
			} else {
				FacesContext
						.getCurrentInstance()
						.addMessage(
								null,
								new FacesMessage(
										"Make sure that the file is a text file with the extension
.txt"));
				return "error";
			}
 
		} catch (IOException ioe) {
			FacesContext
					.getCurrentInstance()
					.addMessage(
							null,
							new FacesMessage(
									"Make sure that the file is a text file with the extension .txt"));
			return "error";
		} finally {
			this.upFile = null;
		}
	}

-- 
View this message in context: http://www.nabble.com/Tomahawk-1.1.3-inputFileUpload-solution-tp6449010p15037032.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Trinidad Chart OnClick

Posted by Philipp Michel <ph...@macio.de>.
Hi list,

i want trinidad charts without an onClick event. When I click on the
chart then there open a popup with some values like x-axis value, etc. .
How can i stopping this?

Regards

Philipp Michel