• Unexpected runtime error while enter a comment

    By Patrick Kwintensson 1 decade ago

     

    2 errors occur when a user attempt to post a comment on an entry in the 
    IBM Wiki template for Notes/Domino.                                     
    
    The event is triggered by clinking on the 'Post Comment' button.        
    
    As Anonymous:                                                           
    
    Unexpected runtime error                                                
    The runtime has encountered an unexpected error.                        
    
    Error source                                                            
    Page Name:/page.xsp                                                     
    Control Id: button1                                                     
    Property: onclick                                                       
    
    
    Exception                                                               
    Error while executing JavaScript action expression                      
    Script interpreter error, line=26, col=6: [TypeError] Exception         
    occurred calling method NotesDocument.save() null                       
    
    JavaScript code                                                         
    
    
       1: var db:NotesDatabase=database;                                    
       2:                                                                   
       3:// Create and populate new comment document                       
       4: var rdoc:NotesDocument=db.createDocument();                       
       5: rdoc.appendItemValue("Form","comment.htm");                       
       6: rdoc.appendItemValue("author",@Name("[CN]",@UserName()));         
       7: rdoc.appendItemValue("status", "Published");                      
       8: rdoc.appendItemValue("subject", document1.getItemValueString      
    ("subject"));                                                           
       9: rdoc.appendItemValue("PermLink", document1.getItemValueString     
    ("PermLink"));                                                          
      10:                                                                   
      11://Get comment field and get individual lines                      
      12: var o=getComponent("Comment");                                    
      13: var p=o.getValue();                                               
      14:                                                                   
      15://Create Array of lines                                           
      16: var a=p.split("\n");                                              
      17:                                                                   
      18://Convert Array to Vector                                         
      19: var v:java.util.Vector = new java.util.Vector(java.util.Arrays.   
    asList(a))                                                              
      20:                                                                   
      21: var item:NotesItem=rdoc.appendItemValue("textcomment",v);         
      22:                                                                   
      23:// Make response, compute default values and save                 
      24: rdoc.makeResponse(document1.getDocument());                       
      25: rdoc.computeWithForm(false,false);                                
      26: rdoc.save();                                                      
      27:                                                                   
      28://Clear Comment Field                                             
      29: o.setValue("");                                                   
    
    
    
    
    
    As Registered:                                                          
    
    Unexpected runtime error                                                
    The runtime has encountered an unexpected error.                        
    Error source                                                            
    Page Name:/page.xsp                                                     
    Control Id: linkTagCloud                                                
    
    Exception                                                               
    Error while executing JavaScript computed expression                    
    Script interpreter error, line=1, col=72: [ReferenceError] 'label' not  
    found                                                                   
    JavaScript code                                                         
       1: label+" ("+applicationScope.get(compositeData.id).getTagCount     
    (tagArray)+")";                                                         
    
    When re-opening the entry via the 'Back' button in the browser the      
    comment is saved.