Skip navigation
Currently Being Moderated

Multicolumn Listbox Entries with Image Problem

Feb 4, 2012 9:22 AM

Tags: #scriptui #dockable_panel

Hi all.

 

I'm writing a script that features a multi-column list box to display some info. The info displayed is reloaded based on a dropdown list selection, so depending on the dropdown option, different data is displayed in the listbox.

 

This is all working fine, except for when I want to include an image for each row in one of the columns. On first load, the data (with image) displays as expected. However when I change my data only the first row of the first column of data is displayed in the listbox (without an image).

 

Here's the code I'm using (edited for confidentiality):

 

for(var i=0; i<myData.length; i++) {

    var myRow = myUI.grp.p1.t1.myListBox.add("item", myData[i].column1.columnData);

    myRow.image = File("myIcon.png");

    myRow.subItems[0].text = myData[i].column2.columnData;

    myRow.subItems[1].text = myData[i].column3.columnData;

}

 

If I comment out the "myRow.image..." line, everything loads into the listbox fine every time. Is this a bug, or am I missing something important?

 

Thanks,

 

Christian

 
Replies
  • Currently Being Moderated
    Feb 4, 2012 10:16 PM   in reply to Christian Lett

    Not specifically sure what might be causing the issue, but have you tried using a try/catch to debug it? This usually works for me in narrowing down the specific error in addition to the line it happened at. It may reveal the deeper problem causing the issue.

     

    try{

     

    /// Your code here

     

    }catch(err){

         alert("Error at line: " + err.line.toString() + "\n\n"+err.toString());

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points