Checking empty column of array using javascript

299 views
Skip to first unread message

sagar....@flowian.com

unread,
Dec 17, 2014, 12:07:34 AM12/17/14
to suppor...@runmyprocess.com
Hi Team,

In my application there is one array widget. Which will have two columns.
I want to set a column in "Inactive" state, when it has some content in it.For that purpose I have use the following code.

if(id_arrayname.id_columnname[i].getText())
{
id_arrayname.id_columnname[i].setActive(false);
}

The problem is that when my array contain more than one rows and the respective column is empty for all the present rows, then the condition in "if" statement gives me different results for different rows.

I also tried

if(id_arrayname.id_columnname[i].getText()!=null)
{

id_arrayname.id_columnname[i].setActive(false);
}

Please suggest me any other solution..

Regards,
Sagar

Bidisha Das

unread,
Dec 17, 2014, 1:53:17 AM12/17/14
to suppor...@runmyprocess.com
Hi Sagar,
Would you let me know what result it is showing since your code looks good.


Thanks & Regards
Bidisha

sagar....@flowian.com

unread,
Dec 17, 2014, 3:35:40 AM12/17/14
to suppor...@runmyprocess.com
Hi Bidisha,

When I trying to find what is in the empty column I got it as a “null”.

And the null value for that column is present in only the First row of array.
For other rows the following “if” condition is “false”.

if(id_arrayname.id_columnname[i].getText())
{
}

My scenario is as
My array contains two column one is “Questions” and the other is “Answers”
One user fills questions into the array widgets “question” column and in the next step other user answers the asked questions in the second “Answer” column.

So the array widget is same but the screens are different. The above script is fine on single screen.
But on the second screen it is not behaving as expected.


Regards,
Sagar

Bidisha Das

unread,
Dec 17, 2014, 4:13:06 AM12/17/14
to suppor...@runmyprocess.com
Hi Sagar,
Please make sure that the java script and array widget is active for second screen also.


Thanks & Regards
Bidisha

sagar....@flowian.com

unread,
Dec 17, 2014, 4:27:16 AM12/17/14
to suppor...@runmyprocess.com

Hi Bidisha,

My array widget and Javascript is active for both the screens.

For my first screen it is fine.

But for second screen the empty column showing that it has content and If I find what is that then I found that it is null.

Rgards,
Sagar

Bidisha Das

unread,
Dec 17, 2014, 4:33:28 AM12/17/14
to suppor...@runmyprocess.com
Hi Sagar,
Instead of null, you can use (id_arrayname.id_columnname[i].getText()!="") or (id_arrayname.id_columnname[i].getText()!=undefined) and check if still face the same issue.


Thanks & Regards
Bidisha

sagar....@flowian.com

unread,
Dec 17, 2014, 7:21:47 AM12/17/14
to suppor...@runmyprocess.com
Hi Bidisha,

I have tried all the options but still the problem is not solved.

Regards,
Sagar

sagar....@flowian.com

unread,
Dec 17, 2014, 7:54:16 AM12/17/14
to suppor...@runmyprocess.com, sagar....@flowian.com
Hi Bidisha,

I have used the two if statement one inside the other and it is working.

I appreciate your instant support.

Regards
Sagar
Reply all
Reply to author
Forward
0 new messages