Hi
as Lucee doesn’t support cfprogressbar, has anyone an easy script or component which I could use to code aprogress bar?
I have some script who rund multiple minuteds processing data and I’d like to show teh user the progress or the processing.
I found a solution on ForgeBox but as far as I understand it requires a full installation which a dedicated Lucee server but I didn’t see an option to just add the progressbar component to my existing Lucee installation.
Anotgher option could be a scrip which uses CSS to show the progress but I couldn’t find any code examples for Lucee/CF
Hope the community has an easly solution
Many thanks in advance
Daniel
Thanks Zackster
looks god, unfortunately that’s a static bar, mean I can’t change the values. Tried to make the bar moving while processing my 10k records wasn’t succesful. Do you have a small code example?
Are you cf-flushing out updates as it processes?
Just have a JavaScript function, updateProgress(44);
Hi Zackster
yes I actually do, I use CFFLUSH Interval = 1
Whenever I update the progress bar it “paints” a new bar so in my test file I have 10 bars at the end with different values. I’d appreciate a small code example as I do something wrong
Thanks Daniel
Sounds like you are you just outputting the html again?
Like I said, use a javascript function which updates the existing html progress bar.
something like this
<progress id="progress" max="100" value="0"> 0% </progress>
<script>
function updateProgress(val){
var el = document.getElementById("progress");
el.value = val;
el.innerHTML = val + "%";
}
</script>
<cfscript>
loop from=1 to=100 index="i"{
echo ("<script> updateProgress(#i#); </script>");
flush;
sleep(500);
};
echo (done);
</cfscript>
3 Likes
Fantastic, that works. I tried the UpdateProgress function but failed due to my Java Script skills
Many thanks!
KInd regards
Daniel