Jump to content

DesiLogi

Caspio Guru
  • Content Count

    238
  • Joined

  • Last visited

  • Days Won

    16

DesiLogi last won the day on April 1

DesiLogi had the most liked content!

1 Follower

About DesiLogi

  • Rank
    Advanced Member

Recent Profile Visitors

2,059 profile views
  1. Hi Meekee, This is an older post that I just found and I wanted to thank you for putting the code up, as I needed it. Works perfectly!
  2. I figured out the solution, if anyone needs it. An EventListener makes it work: <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { var x = document.querySelector('[name*=cbParamVirtual18]'); x.onchange = function() { var v_virtc = document.getElementsByName("cbParamVirtual18")[0].value; document.getElementsByName("InsertRecordTaxable")[0].value = v_virtc; } }); </script>
  3. Hello, I have a field that normally would be a cascading radio button whose value is dependent on the selection of another field's dropdown value (the parent). However, I need the user to be able to over-ride the cascaded value occasionally. You can't do this normally so I'm trying to use js to do it. There is a text field set to Dropdown, called 'SalesCode.' A Virtual field (Virtual 18) is set to Cascading Text Field so it can receive a value when 'SalesCode' (the parent) is updated. The text field called 'Taxable' is the one I need to update. It's set to a Radio Button with 2 custom choices ('tax' or 'non'). The code I think I need is 'on change' for the SalesCode drop down field. Meaning when the user updates the SalesCode value, it updates Virtual18 (cascaded) and then the code takes the value of Virtual18 and puts in in the Taxable field's Radio Button value (the value in Virtual18 will always be either 'tax' or 'non' so it corresponds with the custom choices in Taxable). If the user wants to override that Taxable value they can change the radio button choice. The code below is something like I think I need but I can't get it to work, any help would be really great! <script> $("#InsertRecordSalesCode").change(function(){ var v_tax = document.getElementsByName("cbParamVirtual18")[0].value; document.getElementsByName("InsertRecordTaxable")[0].value = v_tax; }); </script>
  4. Hi Douvega, Thanks for the tip- I'm glad it's doable but I think it's definitely going to be beyond my own abilities. However, at least I have a way to talk about it with my developer, which helps.
  5. Hi Vitalikssssss, Thanks for the tip- I hadn't thought of using css. That does help the datapage not 'flash' when it opens/auto-submits, which is better. I was hoping there'd be a way to 'run' the datapage in the background and not even have it display (for a second) so the user doesn't know it's there. This solution is a step in the right direction though- thanks!
  6. Hi, Does anyone know if it's possible (and then how) to make a submission form invisible so the user doesn't see it at all (and not the 1 second flash normally with auto-submit)? I have one submission form that passes a parameter (after submit) to another submission form (that has js auto-submit code) so that the new autoID value from the first submission form can be pasted into a new record in a different table (via the 2nd submission form). I have to do it this way instead of using a trigger on the 1st submission form's table because of back-end sql triggers locking the table and not being able to use front-end triggers. So this is a workaround. It's really clunky and time consuming for the user to have the 2nd submission form open and 'flash' (whether the time interval is set to 500 or 1000 it still is ugly) before auto-submitting. I was hoping there'd be a different way to deploy the 2nd submission form, maybe in a web page that's on the server but doesn't 'show' or something like that. Any ideas? Thanks!
  7. Hi, Does anyone know how/where to change the css in the Styles for the Bulk Edit link when it's hovered over, for a tabular datapage. I can change the style for the link in Source/Page Action section: .cbResultSetBulkEditActionLink { /*Results Page Bulk Edit ActionLink Attributes (For Gallery And List Pages)*/ color: green; font-family: Arial, sans-serif; font-size: 14px; font-weight: 600; text-decoration: none; } However, this only changes the link style when it's not hovered over. When hovered over the 'Bulk Edit' link reverts to its default styling and looks jarring. There must be some css somewhere for something like .cbResultSetBulkEditActionLink:hover but I cannot find it. EDIT: In case anyone needs a solution to something like this, I ended up sort of finding a solution. If you put _hover after it (what Caspio seems to use to designate hover), it basically removes the hover effect (it's supposed to change it, if you change the css but it seems to have just disabled hover). So if you put something like: .cbResultSetBulkEditActionLink { /*Results Page Bulk Edit ActionLink Attributes (For Gallery And List Pages)*/ color: green; font-family: Arial, sans-serif; font-size: 14px; font-weight: 600; text-decoration: none; } .cbResultSetBulkEditActionLink_hover { /*Results Page Bulk Edit ActionLink Attributes (For Gallery And List Pages)*/ color: green; font-family: Arial, sans-serif; font-size: 14px; font-weight: 800; text-decoration: none; } in Source/User Defined Styles it seems to work.
  8. Does anyone know how to use Amazon AWS S3 for files (pdf in this case) that are not public but that can be accessed by an authenticated Caspio datapage? I'm using Google Docs Viewer to display uploaded pdf files but it only works if the directory that the pdf file is in is Filestor enabled. The pdf files are proprietary to my users and cannot be public so I cannot use Filestor. I tested out an Amazon AWS solution (putting the pdf file in an S3 Bucket) and storing the S3 file url in a Caspio table, then using that file url with Google Docs Viewer to display the pdf. This does work but of course the S3 file has to be set to 'public' in order to display, which of course is the same issue as with a non-Filestor Caspio file folder. I was hoping to somehow set the AWS S3 bucket to have permissions (and a password) that I could reference in the datapage script that opens the pdf viewer. This way the pdf file wouldn't be public but would still be accessible from a Caspio datapage (the datapage would be authenticated so only the owner of the file would have access to it). It'd be so much easier if Caspio had a pdf viewer (pdf viewed in the browser or a datapate) instead of just downloading to the local computer. But an AWS solution might also work, I just don't know how to get/set permissions to use my specific AWS S3 buckets. Any help would be very much appreciated!
  9. Hi Hastur, Here's an odd thing as well. Some pdf files are showing and some will just download when the file name is clicked on. In testing they're both in the same Filestor enabled folder and I can't see any different in the pdfs themselves. Here's a copy of a pdf file that's not showing up, if you have a chance to take a look. I don't know why this file is any different. Thanks again for the help! EDIT: I think I figured out the reason for the attached file not displaying- it was physically larger than the iframe width setting. I changed the iframe to 100% width and height and it does show up now. So there is the remaining issue: How to get this to work with a non-Filestor folder for the pdf file. Here's a way to possibly tell the difference between the pdf being in a Filestore enabled directory vs one that's disabled: Path with Filestor enabled: https://docs.google.com/viewerng/viewer?url=https://cdn.caspio.com/C2104000/Moodboards/LivingRoom.pdf?ver%3D3 Path with Filestor disabled: https://docs.google.com/viewerng/viewer?url=https://c0afw773.caspio.com/dp/c2104000eb3da3ff88184764b5a3/files/8172684 It seems to me that it if the user has authenticated in Caspio (and they have in my example) then the file should be accessible to that browser to do whatever with, even if the directory is Filestor/disabled. The file can be opened in a datapage, downloaded, etc. So why can't Google Doc Viewer display it? The url must need some kind of modification or something. LivingRoom.pdf
  10. I just realized that this does work: the code opens the PDF when the filename is clicked on (so instead of downloading the pdf it is opened in the browser). I'd thought the datapage would display the pdf upon opening so I'd thought it wasn't working. This actually great- it does display the pdf as I need to, and clicking on the filename is no problem. The last issue is figuring out how to do it in a Filestor disabled folder because the files are private. This forum thread addresses that aspect of it. It would be great if we could combine the non-Filestor aspect of that code with this code, then it'd be an awesome solution.
  11. Hi Hastur, Thanks for the code on this- I can't get it to work in testing, though. I do have Filestor enabled on the directory the pdf is located in so I'm not sure what the issue is. That said, the pdf files I need to display are sensitive to the user so they can't ultimately be in a Filestor enabled folder. There's an old thread that addresses this issue but I can't get the script to work from that either. Is the code you posted working in your own testing? I'm trying to figure out why I can't get the pdf to display even in a Filestor folder. Thanks again for the help. If we can get this worked out I imagine it would be useful for a lot of Caspio users.
  12. I'd put this in an old thread but I thought I should ask it anew so someone might notice. I'm trying to utilize the Google Viewer solution to show a pdf in an html block in a datapage but can't get it to work. I've got a Details datapage, authenticated, that uses a table that stores files. In this case, a pdf file in Caspio Bridge's Files section. This test example's file path in the field "File_Name" is /TestPdf.pdf. The code isn't working and I can't figure out why. All I get is a 'No Preview Available' message. Does the user need to be signed into to Google Docs for this to work? Is there a prefix that needs to go in from of the File_Name field since it's just /TestPdf.pdf? Any help would be really appreciated! <iframe id="iframe_pdf" style="width:80%; height: 1100px; display: none;" align="middle" frameborder="0"></iframe> <script> document.addEventListener('DataPageReady', function (event){ if(!("[@field:File_Name/]" == "")){ embed_pdf(); } }); function embed_pdf(){ var google_link= "https://docs.google.com/gview?url="; var google_param = "&embedded=true"; var pdf_link = "[@field:File_Name/]"; var encoded_pdf_link = encodeURIComponent(pdf_link); var iframe_window = document.getElementById("iframe_pdf"); iframe_window.style.display = "block"; iframe_window.src=google_link + encoded_pdf_link + google_param; } </script>
  13. reposted to new thread since this is 3 years old.
  14. DesiLogi

    PDF Report Page

    Hi JolliBeng, Can you show exactly how you created the datapage to show the pdf within it and also how the download link opens a new tab with the pdf download option? I'm trying to do the same thing: display a pdf that's a file in Caspio Bridge Files (linked to via a field in a table) and then give the option of downloading it from a 'preview' page. Right now the pdf just keeps downloading automatically and I need to display it first. Thanks for any help! Note: it's really the 'preview pdf' in the new tab/window (that opens when you click on the 'Download Data' link in the datapage) that I need if I can't display the pdf in the datapage. I've tried Google's Viewer but can't get that to work. But the 'preview pdf' in new tab would be a great workaround.
  15. Though this is an old thread I'm trying to utilize the solution but can't get it to work. I've got a Details datapage, authenticated, that uses a table that stores files. In this case, a pdf file in Caspio Bridge's Files section. This test example's file path in the field "File_Name" is /TestPdf.pdf. The code in an html block in the datapage is the above from this thread, but it's not working. All I get is a 'No Preview Available' message. Does the user need to be signed into to Google Docs for this to work? Is there a prefix that needs to go in from of the File_Name field since it's just /TestPdf.pdf? Any help would be really appreciated! <iframe id="iframe_pdf" style="width:80%; height: 1100px; display: none;" align="middle" frameborder="0"></iframe> <script> document.addEventListener('DataPageReady', function (event){ if(!("[@field:File_Name/]" == "")){ embed_pdf(); } }); function embed_pdf(){ var google_link= "https://docs.google.com/gview?url="; var google_param = "&embedded=true"; var pdf_link = "[@field:File_Name/]"; var encoded_pdf_link = encodeURIComponent(pdf_link); var iframe_window = document.getElementById("iframe_pdf"); iframe_window.style.display = "block"; iframe_window.src=google_link + encoded_pdf_link + google_param; } </script>
×
×
  • Create New...