fileuplaod_wgt.buttonBar.find("button.cancel")
fileuplaod_wgt.buttonBar.find("button.start")
fileuplaod_wgt.buttonBar.find('input[type=file]')
upload content
upload.uploadContent'
number of uploaded files
var files = fileuplaod_wgt.uploadContent.find('.files .template-upload');
invalid files
fileuplaod_wgt.uploadContent.find("tr.ui-state-error");
reference:
http://stackoverflow.com/questions/14881131/primefaces-upload-how-to-only-allow-one-upload-in-advance-mode
Tuesday, August 2, 2016
Monday, June 27, 2016
How to disable Choose button in PrimeFaces fileupload component
The javascript function is to disable "Choose" button in <p:fileUpload /> component a file has been uploaded.
It is applicable to PrimeFaces 3.5
function below will find the Choose button from the passed in widgetVar when the file component onchange,
if the number of uploaded files more than 1,
disable the Choose button.
<script type="text/javascript">
function onchangeDisableChooseBtn(upload_widget_var) {
if(upload_widget_var.buttonBar.find('input[type=file]').get(0).type == 'file') {
upload_widget_var.buttonBar.find('input[type=file]').change(function() {
var files = upload_widget_var.uploadContent.find('.files tr');
if (files.length >= 1) {
upload_widget_var.buttonBar.find('input[type=file]').get(0).disabled=true;
}
onchangeDisableChooseBtn(upload_widget);
});
}
}
</script>
Done!!
Wednesday, June 22, 2016
How to hide icons in PrimeFaces fileUpload component.
PrimeFaces version: 3.5
to hide icon in choose button
to hide icon in upload button
to hide icon in cancel button
Done!!
to hide icon in choose button
.fileupload-buttonbar .fileinput-button .ui-icon-plusthick{
display: none !important;
}
to hide icon in upload button
.fileupload-buttonbar .start .ui-icon-arrowreturnthick-1-n{
display: none !important;
}
to hide icon in cancel button
.fileupload-buttonbar .cancel .ui-icon-cancel{
display: none !important;
}
Done!!
Tuesday, June 21, 2016
Blinking Text effect
<span id="elementIdToBlink">any text to blink.</span> <script> $(function(){ // Self-executing recursive animation (function pulse(){ $('#elementIdToBlink').delay(1000).fadeOut('slow').delay(50).fadeIn('slow',pulse); })(); }); </script>
reference:
http://stackoverflow.com/questions/7223503/jquery-pulsate-times
Done!!
Monday, June 20, 2016
Encryption/Decryption with Java
Following are the steps to encrypt/decrypt with Java
1. determine the encryption key
2. get the keyspec from the encryption key
3. instantiate the secretkeyfactory
4. generate the secretkey from the keyfactory
5. instantiate the cipher
6. encrypt/decrypt the string into byte array
7. encode to base 64
8. return the encrypted/decrypted string
Sample Code
1. determine the encryption key
2. get the keyspec from the encryption key
3. instantiate the secretkeyfactory
4. generate the secretkey from the keyfactory
5. instantiate the cipher
6. encrypt/decrypt the string into byte array
7. encode to base 64
8. return the encrypted/decrypted string
Sample Code
public static final String key = "kianworknotes";
Subscribe to:
Posts (Atom)
Popular Posts
- How to create database view with Oracle SQL Developer Data Modeler
- How to add/remove row in datatable
- How to easily embed a Google Map in your website
- Velocity without template(.vm) file
- How to add Sequence Generator to a table in Oracle SQL Developer Data Modeler
- How to handle multilingual error messages for jQuery validation plugins
- How to edit Liferay email notification templates
- How to switch EJB client to local or remote interface without changing code
- How to enable CKEditor in PrimeFaces Extension
- How to export data model to DDL with Oracle SQL Developer Data Modeler