NetBeans ApplicationBean PageFragmentBox upload

Hi. I have a site created in NetBeans (it's a Visual Web Application). It's based on Sun tutorials for NetBeans like this one http://www.netbeans.org/kb/55/vwp-fileupload.html

Apart from the File Upload component I also have - as a header - Page Fragment Box where there are : one picture (image component) and 3 hyperlinks. I'd like to have a possibility to change the logo by uploading it through FileUpload component. I can upload pictures to the image component at the same page, but I would like to upload a pic to the image component in the Page Fragment Box. How can I do that/access the PFB using ApplicationBean?

Every hint appreciated.

[667 byte] By [Pawel34a] at [2007-11-27 9:21:33]
# 1

Ok, that was easy.

First I added a property to the ApplicationBean.

ApplicationBean - > Add Property (say..String) and gave it a name - say "path"

Then I bound the image in the PFB with the String - "path" in the AplicationBean

Then on the page where my FileUpload component was I added:

if ( uploadedFileName != null ) {

/*this sets the URL for the image component on the same page - so I

have two images at this page - one in Page Fragment Box and one in

Image component, and then on the other pages the logo in the header

stays so that works for me*/

image1.setUrl(IMAGE_URL);

ApplicationBean1 ab = getApplicationBean1(); // this

ab.setPath(IMAGE_URL);]// and this added

}

and that made the trick.! :)

for some it might have looked trivial but it took me some time to see how it can work.

Pawel34a at 2007-7-12 22:15:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...