Issue With Upgrade to 2.0

Nov 12, 2008 at 1:05 AM
Hi I am very excited about new version.

Encountered the below 2 errors upon building after referencing the new dll.

Error    4    Type 'com.flajaxian.FileUploader' does not have a public property named 'ProgressBarChangeJsFunction'.     

Error    5    Content ('<![CDATA[                                                                                  function(bar, percDiv, percentage, progress, loadedBytes, currentFileLoadedBytes){                                                                                    if(!!bar){                                                                                      bar.style.width =                                                                                        ((progress == 0 || progress == 1) ? 0 : (progress * this.getProgressBarWidth()))+"px";                                                                                    }                                                                                    if(!!percDiv){                                                                                      percDiv.innerHTML = (progress == 0 || progress == 1) ? "":(percentage + "%");                                                                                    }                                              ...') does not match any properties within a 'com.flajaxian.FileUploader', make sure it is well-formed.       

Here is the code

    <fjx:FileUploader ID="FileUploader2" OnFileReceived="FileUploader2_FileReceived" runat="server" >
                                                                                <ProgressBarChangeJsFunction>
                                                                                      <![CDATA[
                                                                                function(bar, percDiv, percentage, progress, loadedBytes, currentFileLoadedBytes){
                                                                                  if(!!bar){
                                                                                    bar.style.width =
                                                                                      ((progress == 0 || progress == 1) ? 0 : (progress * this.getProgressBarWidth()))+"px";
                                                                                  }
                                                                                  if(!!percDiv){
                                                                                    percDiv.innerHTML = (progress == 0 || progress == 1) ? "":(percentage + "%");
                                                                                  }
                                                                                  if(progress == 1){
                                                                                    // do what you want to do here
                                                                                    // for example to redirect to google do:
                                                                                    document.location.href = 'Status.aspx?Status=Done';
                                                                                  }
                                                                                }
                                                                                    ]]>
                                                                                    </ProgressBarChangeJsFunction>
</fjx:FileUploader>

Any help would be fantastic Cheers

Coordinator
Nov 12, 2008 at 2:16 AM
Edited Nov 12, 2008 at 2:28 AM
 The *JsFunction properties have been removed.

For JavaScript event use

<
script>
function FileStateChanged(uploader, file, httpStatus, isLast){ 
      Flajaxian.fileStateChanged(uploader, file, httpStatus, isLast);

                       // here you can use
                       // httpStatus
                       // file.bytes
                       // file.name
                       // file.state
                       // httpStatus
                       // isLast                      
                       // state : Selected = 1; Uploading = 2; Uploaded = 3; Cancelled = 4; Error = 5;

                      // here you can call uploader.cancel(); for example if httpStatus is not 200
                      // to redirect after all is done use: 
                      // if(isLast && file.state > 2){ document.location.href = 'Status.aspx?Status=Done'; }
     

</script>  

 

<fjx:FileUploader ID="FileUploader1" JsFunc_FileStateChanged="FileStateChanged" runat="server">
...
</fjx:FileUploader>


Nov 12, 2008 at 3:01 AM
perfect thank you - love the new beta :)