-3

JavaScript code

1: db=database;
2: theView=db.getView(compositeData.PDviewname);

Error while executing JavaScript computed expression Script interpreter error, line=2, col=12: [TypeError] Exception occurred calling method NotesDatabase.getView(null) null

stwissel
  • 20,110
  • 6
  • 54
  • 101
  • I have two CC. First CC contains the links which is generated by a repeatcontrol and onclick of this link i passed the the value to the 2nd CC repeatcontol through sessionScope. able to get value of 1stCC property in cmputed field,editable filed of 2ndCC but not coming in repeatcontrol.for repeatcontrol alone the compositeData value is coming null.I dont know why.While loading the page repeatcontrol looking fot the compositeData itseems..which will get the value only when i click the links in the firstCC.how resolve this issue. – user1802880 Dec 12 '12 at 10:41
  • possible duplicate of [Repeat control Error](http://stackoverflow.com/questions/13837669/repeat-control-error) – Per Henrik Lausten Dec 12 '12 at 11:06
  • Got the answer.. :-)Thanks for the contribution ... Onload the page the repeat control is looking for the session scope value which is null. onclick of the link only sessionScope will be availabe to the page .. by making repeat control visibility hidden while loading the page solved the issue.... :-) – user1802880 Dec 12 '12 at 13:43

1 Answers1

0

You don't catch null values. One possible way:

    var viewName = compositeDate.PDViewName == null ? 'someDefaultName' | compositeDate.PDViewName;
    var theView = database.getView(viewName);

Of course you could also stop the code if viewName is null. You shouldn't use sessionScope here -> your code will break if a user has the unheard idea of opening 2 browser tabs in your application.

stwissel
  • 20,110
  • 6
  • 54
  • 101