Skip to main content
7 events
when toggle format what by license comment
Sep 8, 2023 at 16:48 comment added RubenDG anyway comments are not meant for extended discussion. Moreover you should not change the original question. Therefore I think opening a new question would be the best. This way you could get advice from the whole community.
Sep 8, 2023 at 16:46 comment added RubenDG @degmo If the user should select first the type, then upload the file, I would modify the html having first <template lwc:if={showUpload} (please note that if:true and if:false are deprecated, you should use lwc:if|elseif|else directive), then, after closing that template element, I would put the container of lightning-input: <div class="slds-m-around_medium" lwc:else>. In the modal I would add a button to confirm the selection of the file type. This button would toggle showUpload. Another way to achieve this is disable the lightning-input until the user choose a file type.
Sep 8, 2023 at 15:58 comment added degmo Hi @RubenDG thank you again. I need a little more help if you could. I put a prototype based on your suggestion to allow for selection of a file type. I updated the HTML file to icnlude a "dialog" section that pops up when "showupload" is true. However, save operation goes on while the dialog is still open. how can I make SaveFiles wait until the dialog is closed? Much appreciated. This is my first LWC component so I do appreciate your help..my experience so far has been with backend development
Sep 7, 2023 at 19:14 vote accept degmo
Sep 7, 2023 at 18:52 comment added RubenDG @degmo You're welcome, glad I could help. You could leverage either a lightning-input-field or a combobox and getPicklistValues wire adapter. Provide a default value and attach an handler for the change event, storing the selected value in an instance variable, then add it as input parameter to saveFiles method.
Sep 7, 2023 at 14:27 comment added degmo @RubenDB, thank you. That fixed my issue. If I may ask another question. I have a custom picklist field on the ContentVersion table called Type. The values for Type__c are: "Proof of Income", "Proof of Residency", etc. When a file gets uploaded via the custom LWC I am building as above, how can I present a user with a list of values from the field Type so that they can tag the file as one of the types?
Sep 7, 2023 at 8:22 history answered RubenDG CC BY-SA 4.0