• Problem with empty text-tags? ( oEntryData.text has no properties )

    By Stefan Deser 2 decades ago

    On trying to expand a category, where i got DXL with an empty text-tag: </text> i get the error message: (I'm not sure, if the empty text-tag is the problem, but i think so … )



    oEntryData.text has no properties



    The problematic line is about 1510 in jsNotesView2.1.5:



    s = oEntryData.text[0].text;



    If i change this line to the following, i do not get any errors anymore:



    var s;

    if( oEntryData.text ) {

    s = oEntryData.text[0].
    text;

    } else {

    s = "";

    }



    The DXL from ?ReadViewEntries i like to display with NotesView2 is:




    &lt;viewentries toplevelentries=&quot;4&quot;&gt;<br/>
    


    &lt;viewentry position=&quot;2.1.1&quot; unid=&quot;A81E0939F73B1C5DC12572B2004854D3&quot; noteid=&quot;207A&quot; siblings=&quot;19&quot;&gt;<br/>
    


    &lt;entrydata columnnumber=&quot;2&quot; name=&quot;TicketType&quot;&gt;<br/>
    


    &lt;textlist&gt;<br/>
    


    &lt;text&gt;<br/>
    

    /development/v54/hm_servicedesk_d.nsf/Null?OpenImageResource

    </text>

    </textlist>

    </entrydata>


    &lt;entrydata columnnumber=&quot;3&quot; name=&quot;IcoFdbckWay&quot;&gt;<br/>
    


    &lt;textlist&gt;<br/>
    


    &lt;text&gt;<br/>
    

    /development/v54/hm_servicedesk_d.nsf/Null?OpenImageResource

    </text>

    </textlist>

    </entrydata>


    &lt;entrydata columnnumber=&quot;4&quot; name=&quot;IcoStatNr&quot;&gt;<br/>
    

    <text>115</text>

    </entrydata>


    &lt;entrydata columnnumber=&quot;5&quot; name=&quot;IcoPrioNr&quot;&gt;<br/>
    

    <text>104</text>

    </entrydata>

    <entrydata columnnumber="6" name="IconBckInfo">

    </entrydata>


    &lt;entrydata columnnumber=&quot;7&quot; name=&quot;CreateDate&quot;&gt;<br/>
    

    <text>03.04.2007</text>

    </entrydata>


    &lt;entrydata columnnumber=&quot;8&quot; name=&quot;UserID&quot;&gt;<br/>
    

    <text>ABC</text>

    </entrydata>


    &lt;entrydata columnnumber=&quot;9&quot; name=&quot;&quot;&gt;<br/>
    

    <text/>

    </entrydata>


    &lt;entrydata columnnumber=&quot;10&quot; name=&quot;ProcessEditor&quot;&gt;<br/>
    

    <text>Anonymous</text>

    </entrydata>


    &lt;entrydata columnnumber=&quot;11&quot; name=&quot;&quot;&gt;<br/>
    

    <text/>

    </entrydata>


    &lt;entrydata columnnumber=&quot;12&quot; name=&quot;EquipNbr&quot;&gt;<br/>
    

    <text>[not assigned]</text>

    </entrydata>


    &lt;entrydata columnnumber=&quot;13&quot; name=&quot;ReferenceNumber&quot;&gt;<br/>
    

    <text>ABC-1234567890</text>

    </entrydata>


    &lt;entrydata columnnumber=&quot;14&quot; name=&quot;ProblemShort&quot;&gt;<br/>
    

    <text>Some Text</text>

    </entrydata>

    </viewentry>


    &lt;viewentry position=&quot;2.1.2&quot; and so on ... <br/>
    





    Hope this info helps :)



    Cheers,



    Stefan

    • @Formula in column

      By Stefan Deser 2 decades ago

      There's also something special in this view, what could lead to this problem: There are icon-columns, where @Formulas are used to display self-made icons. For example column 3:



      ?ReadDesign:



      <column columnnumber="3" width="25" name="IcoFdbckWay" title="" format="2" icon="true" listseparator="none">



      ?ReadViewEntries



      <entrydata columnnumber="3" name="IcoFdbckWay">

      <textlist>

      &lt;text&gt;<br/>
      

      /development/v54/hm_servicedesk_d.nsf/Null?OpenImageResource

      &lt;/text&gt;<br/>
      

      </textlist>

      </entrydata>





      I think the <textlist>-tag is a result of the @Formula, because where the Notes icons are used, there is just a number (which has to be complemented with "/icon/vwicn"). Perhaps this is the reason for the above mentioned error ("oEntryData.text has no properties"), which i receive on expanding the second layer (cause only on the third layer their are these icons … ).



      Kind regards,



      Stefan

      • yup, that's it

        By jason a thomas 2 decades ago

        Thanks Stefan.



        I took a quick look and it seems you are right. If a column is specified to display as icon but the column formula returns text (a custom image) instead of a number, it breaks my code!



        The reason is that my code uses the &preformat querystring argument when calling ?readviewentries. This simplifies things because all column xml looks the same:



        However, using text in an icon column somehow forces the column to look like:



        I was trying to avoid compensating for different column formats by using &preformat in the first place!



        Anyway, I will develop a fix as soon as I can. It shouldn't be too hard.

        • Quick and dirty fix for this issue

          By Stefan Deser 2 decades ago

          Hi Jason,



          if got a quick'n'dirty workaround:



          As i do not have much time right now, i can't figure out the line numbers …



          1)



          // * ICONS *

          for(var x = 0 ; x < this.columns.length ; x++){

          var val = entry.columnDisplayValues[new String(x)];<br/>
          if(this.columns[x].icon){<br/>
              if(! isNaN(parseInt(val))) {   // If it is a number<br/>
                  val = (&quot;00&quot; + val).right(3);<br/>
                  val = '[&amp;lt;img border=&quot;0&quot; src=&quot;/icons/vwicn' + val + '.gif&quot; alt=&quot;&quot; \\/&amp;gt;]';<br/>
              } else if (val != &quot;&quot;) {<br/>
                  val = '[&amp;lt;img border=&quot;0&quot; src=&quot;' + val + '&quot; alt=&quot;not found&quot; \\/&amp;gt;]'; <br/>
              } else {<br/>
                  val = '[&amp;lt;img border=&quot;0&quot; src=&quot;/icons/ecblank.gif&quot; alt=&quot;&quot; \\/&amp;gt;]';<br/>
              }<br/>
          

          }



          There is already a blank by Lotus Notes:/icons/ecblank.gif :)



          2) (Basically an "enhancement" to what i think i've already posted)



          About line 1500:



          var s;

          if( oEntryData.text ) {

          s = oEntryData.text[0]._text;<br/>
          

          }

          else if( oEntryData.textlist ) {

          if(oEntryData.textlist[0].text) {<br/>
              s = oEntryData.textlist[0].text[0]._text; <br/>
          }<br/>
          

          } else {

          s = &quot;&quot;; <br/>
          

          }



          Both fragments in jsNotesView2.1.5.

          As i said: Quick and dirty.



          Cheers,



          Stefan

          • thanks

            By jason a thomas 2 decades ago

            Good code, Stefan. pretty much the same way I would do it. look for this fix in the next release shortly