This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 17, 2012, 7:57 PM
68 Posts
topic has been resolvedResolved

Getting document fields values

  • Category: Dojo and Client Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer,Administrator
  • Tags:
  • Replies: 3
Hi.
 
How to make in JavaScipt (client) get document value ?
 
I want to make something like this (this is server side code that won't work) only in client:
document_test.getItemValueString("document_field");
 
Or even when I have document in edit mode I want to get value of certain field (in form) of this document.
May 17, 2012, 9:43 PM
122 Posts
Re: Getting document fields values
Check out SSJS getClientId() global function or #{id:myField} syntax for CSJS. Bear in mind that any SSJS or #{id:...} syntax is converted at page load time. Consequently, best method is to ge the ID and pass to CSJS functions to retrieve the value.
May 19, 2012, 8:36 AM
68 Posts
Re: Getting document fields values
I too early pass it to resolved the bolded values don't work on page load but with button they work ? What i have done wrong ?
 
<script type="text/javascript">    
dojo.require("dijit.ProgressBar");

var progressBarSetValue = function(){

    var maxIloscID = '#{javascript:getClientId("maxIloscRozwiazan_Ankieta1");}'; <--- This lane write simple string to maxIloscID not value
    //var maxIloscID_Value = document.getElementById(maxIloscID).value;
    var iloscID = '#{javascript:getClientId("iloscRozwiazan_Ankieta1")}'; <--- This lane write simple string to iloscID not value
    //var iloscID_Value = document.getElementById(iloscID).value;
    jsProgress.update({ maximum: 100, progress: maxIloscID_Value/iloscID_Value });
}  
dojo.addOnLoad(progressBarSetValue);
</script>
 
Resolved by putting script on page event: onClientLoad
May 21, 2012, 8:50 AM
122 Posts
Re: Getting document fields values
onClientLoad event will work, because all of the server-side processing has completed and any default values put into the field. As a result, the Client-Side JavaScript can actually retrieve values.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal