Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7189909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:24:08+00:00 2026-05-28T19:24:08+00:00

I have created a table which is filled in with remote data. I’m getting

  • 0

I have created a table which is filled in with remote data. I’m getting this data with a php script that creates xml. The xml looks a bit like this:

<kalender>
   <afhaaldag>
      <datum>Monday 30 January 2012</datum>
      <afval>GFT</afval>
      <afval>PMD</afval>
      <afval>Restafval</afval>
   </afhaaldag>
   <afhaaldag>
      <datum>Monday 06 February 2012</datum>
      <afval>GFT</afval>
      <afval>Snoeiresten</afval>
   </afhaaldag>
</kalender>

I have managed to get all the information in the correct position. Each ‘afhaaldag has one row in my table, and each tag inside that has a label. It looks something like this:

Monday 30 January 2012
GFT
Snoeiresten
Restafval

Monday 06 February 2012
GFT
Snoeiresten

I’m adding the multiple labels for ‘afval’ with this loop:

var allAfval = item.getElementsByTagName('afval');
var subView = Ti.UI.createView({bottom:10});
for(var j = 0; j<allAfval.length; j++)
{
    var afval = allAfval.item(j).text;
    var subLabel = Titanium.UI.createLabel({
        text:afval,
        color:'black',
        left:15,
        top:topPosition+20
    });
    topPosition +=20;
    subView.add(subLabel);
    subLabel.catId = afval;
    dataLabels.push(subLabel);
}
row.add(subView);
table.appendRow(row);

Now I want to enable user to filter labels, but since I have multiple labels in one row, I can’t use my previous solution (which worked fine until I added more ‘afval’ lables). To do the filtering I’m using a picker, with this eventListener:

picker.addEventListener('change', function(e)
{
    var filteredLabels = [];
    for(var k=0; k<dataLabels.length; k++)
    {
        if(e.row.id == 'alles')
        {
            filteredLabels = dataLabels;
        }
        else if(dataLabels[k].catId == e.row.id)
        {
            filteredLabels[filteredLabels.length] = dataLabels[k];
        }
        table.setData(filteredLabels);
    }
});

The problem is that my array dataLabels isn’t filled for some reason. When I do an alert at the end (right before I close my function) I’m getting this weird errorMessage (which doesn’t give me any information):

[Ljava.lang.Object;@43f0e008

Could someone please help me out, I’m really stuck with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:24:08+00:00Added an answer on May 28, 2026 at 7:24 pm

    after lots of frustration, but a whole lot more determination, I finally got the solution. What I did is this: I made a subView (because the labels have to come in one row, each row can have multiple labels) and stored the labels on that subView (the date I’m getting before this loop). I also created a new row (wich basically will replace the original rows from the table after the user has filtered) and I’m storing that information in a new array (which will replace the data source after filtering)

    var allAfval = item.getElementsByTagName('afval');
    var subView = Ti.UI.createView({bottom:10});
    for(var j = 0; j<allAfval.length; j++)
    {
        var afval = allAfval.item(j).text;
        var subRow = Ti.UI.createTableViewRow();
        var subLabel = Titanium.UI.createLabel({
            text:afval,
            color:'black',
            left:15,
            top:topPosition+20
        });
        var subLabelDate = Titanium.UI.createLabel({
            text:datum,
            color:'black',
            font:{fontWeight:'bold'},
            left:15,
            top:topPosition
        });
        topPosition +=20;
        subRow.add(subLabel);
        subRow.add(subLabelDate);
        subView.add(subLabel);
        subRow.catId = afval;
        dataLabels[y++] = subRow;
    }
    row.add(subView);
    

    With this eventListener I filter through the table and give the users the information they want. Data is the original data source (so if the users want to see all the events they’ll get the original table, if they want a specific event they’ll get the new data source)

    picker.addEventListener('change', function(e)
    {       
        var filteredData = [];
        for(var k=0; k<dataLabels.length; k++)
        {
            if(e.row.id == 'alles')
            {
                filteredData = data;
            }
            else if(dataLabels[k].catId == e.row.id)
            {
                filteredData[filteredData.length] = dataLabels[k];
            }
            table.setData(filteredData);
        }
        table.setData(filteredData);
    });
    

    Hopefully it’s usefull to someone else. Let me know 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a table umriss which I filled with data and I still
Let's say I have a dynamically-created table that is filled with data from a
I have created an archive table which will store data for selecting only. Daily
I have created a a subclass of Table in my ASP.NET project which creates.
I have a dynamically created table which in the last <td> there is a
i have a table which contains a bunch of dynamically created radio button lists,
I have a product table which simplifies to this: create table product(id int primary
i have created a db names movielibrarysystem in which i have 3 tables.. that
I have a stored procedure inside which I create a temporary table that typically
I have a user table that has many columns, it looks roughly like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.