Re: retrieving a list of file name in popup button

"Jerry W. Walker" <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Hi, Yamuna,

I don't see any obvious problems with the code you shared, but  
information is missing.

It would help to know:

   * which line in the code you showed us was line 122 (that is,  
which line threw the exception).

   * how you've defined downloadDir and enFile

   * whether, and to what, you've bound your popup button's item binding

Clearly, some variable that you're expecting to have a value is  
instead set to null, but it would be hard to figure that out with  
what you've shown us.

On Aug 13, 2006, at 8:46 AM, Yamuna Vallipuram wrote:

> Hi...
>
> I am quite new to WebObject so I have a question retrieving file  
> names from a path and displaying them in a popup button,
>
> my popup button list binding is getAllfiles
> and stringDispaly is getFilename
>
> When I try run the project I get en error message  at  
> PersonImport1.getAllefiler(PersonImport1.java:122)-  
> NullPointerException. My codes returns the correct directory path,  
> but I am unable to retrieve the files. What am I doing wrong here...
>
>
> public NSMutableArray getAllfiles() {
>     	if (downloadDir.exists() == false) {
>     		downloadFeilmelding= "directory not found!";
>     	} else {
>          File files[] = downloadDir.listFiles();
>          for (int i = 0; i < files.length; i++) {
>         		fileArray =new NSMutableArray(files[i]);
>          }
>     	}
>     return fileArray;
>     }
>
>     public String getFilename() {
>     	String tmp;
>     	tmp = enFil.getName();
>     	return tmp;
>     }
>
> Any help will be appreciated
> regards Yamuna
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev


--
__ Jerry W. Walker,
    WebObjects Developer/Instructor for High Performance Industrial  
Strength Internet Enabled Systems

     [email protected]
     203 278-4085        office
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.