Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 4234 invoked from network); 12 Aug 2009 10:38:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Aug 2009 10:38:57 -0000 Received: (qmail 82004 invoked by uid 500); 12 Aug 2009 10:39:03 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 81946 invoked by uid 500); 12 Aug 2009 10:39:03 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 81935 invoked by uid 99); 12 Aug 2009 10:39:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Aug 2009 10:39:03 +0000 X-ASF-Spam-Status: No, hits=1.1 required=10.0 tests=FORGED_HOTMAIL_RCVD2,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Aug 2009 10:38:53 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MbBE1-00063q-4z for users@jackrabbit.apache.org; Wed, 12 Aug 2009 03:38:33 -0700 Message-ID: <24933866.post@talk.nabble.com> Date: Wed, 12 Aug 2009 03:38:33 -0700 (PDT) From: Nemix To: users@jackrabbit.apache.org Subject: Follow a reference property MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: ereas_dre@hotmail.com X-Virus-Checked: Checked by ClamAV on apache.org Hi everybody, I have some problems using Reference property in javascript. At the moment, my CRX repository looks like that : - drugs (nt:unstructured) --- drug1 (nt:unstructured) ------ name (String) ------ uuid --- drug2 (nt:unstructured) ------ name (String) ------ uuid - categories (nt:unstructured) --- cat1 (nt:unstructured) ------ prop11 (Reference on drug1) ------ prop12 (Reference on drug2) ------ ... --- cat2 (nt:unstructured) ------ prop21 (Reference on drug1) ------ ... Nodes under "drugs" are referenceable, so each of them have a UUID. Moreover, they have a string property : name. Nodes under catX have properties that are Reference on the previous UUID. If I click in the repository on those references, it leads me correctly to the nodes unders "drugs". I have a JSP page in which I have : 1 2 I would like that each time I change the selection of the radio button, it calls changeDrugs() function to display the name of each reference (example : if click on "cat1" radio button, it retrieve prop11 and prop12, "make the link" thanks to the reference throught drugs and retrieve the name of the drug). This function is in a javascript file : utils.js function changeDrugs(idr) { var form_d =''; if(idr != "null"){ var drugsList = Sling.getContent("/content/tb_monitoring/categories/"+idr, 2); for(var j in drugsList) { form_d += ''+drugsList[j].name+'
'; } }else{ form_d = ""; } document.getElementById("blocDrugs").innerHTML = form_d; } But drugList[j].name display "undefined". I have tried a couple of other things but doesn't work : drugList[j]["jcr:path"] -> undefined drugList[j] -> display the value of the reference, so something like 4a6b8283-377e-4c45-9080-f821229217e4 Do someone have any idea ? Thanks in advance ;) Audrey -- View this message in context: http://www.nabble.com/Follow-a-reference-property-tp24933866p24933866.html Sent from the Jackrabbit - Users mailing list archive at Nabble.com.