Hi all,
I have a plugin in JIRA 5.0 using Web work.
In input.vm, I place an File input element. Using Web item to navigate to plugin.
After open my plugin, all drop down menus are stuck. Nothing happen when clicking on it.
It does not happen when I remove File input element.
Anyone could explain this and how can I use Input file element in file .vm?
Thanks in advance,
You should check the JavaScript console from any errors that occur during the page load.
Is your input element wrapped within a form? If not, it probably should be :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh the joy. Somehow, when using an type="file" input tag, Atlassian's Javascript asks for two tags to be in the form:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Timothy,
You seem to have figured this out. Adding the elements you described isn't resolving the error for me. Can you provide more details on what you added to your form? Here is the content of my form:
<input type="hidden" name="pID" value="$metadata.projectID"> <input type="hidden" name="pDocAO" value="$pDocAO"> <input id="fileToUploadInput" type="file" name="attach1" size="30"> <input type="hidden" name="id" value=""> <div id="attach-max-size"></div>
But I still get the same error.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just think of it in this way. If you use the input="file", AJS will pick up on it and will act on in. Therefore, you can refer to how JIRA does the file import.
So, if you provide id's without values, it's definately not going to work.
<div id="attach-max-size" class="hidden">$attachmentSize</div> <input type="hidden" id="id" name="id" value="$randomId" />
Note, both my values have meaning. The attachment size is JIRA's attachment size limit. Random Id is the id of the issue that I am refering to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Timothy,
Thanks for the clarification. I've explored your suggestions and it works as you describe.
I'm upgrading a custom plugin from 4.4.x to 5.2.5 and one of the things we do in this plugin is provide the ability to attach files at the project level, not just at the issue level. I'm not just providing a different way to create issue attachments. So, the restriction to match an issue id is not applicable. To your knowledge, is there a way to override or skip this built-in validation? It's quite annoying for my purposes.
I don't want any of Atlassian's fancy javascript validation or form manipulation for file uploads. I just want to control the UI and form elements myself. This includess not having the js code convert the input type="file" element to a checkbox for multiple file uploads. I want to shut this code off. Ideas?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found the answer and it is documented here: How to ignore-inline-attach.
This is exactly the type of solution I was hoping to find. Very easy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this code. It work for me.
<div class="field-group">
<label class="field-label" for="attachment">Attachment <span class="vp-optional">(optional)</span></label>
<div class="field-container">
<div id="attach-max-size" class="hidden">15728640</div>
<input id="attachment" type="file" name="attachment"/>
<div class="hidden"><input type="hidden" value="14000" name="pid"></div>
</div>
</div>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.