How to assign value to array in backing bean JSF 2.0?

This is not true. Your problem is probably caused because you didn't preinitialize the array yourself. JSF/EL namely won't do it for you (like as with every other "nested object").

It will only set the array value by the given index.

Obviously this doesn't work because the getters and setters don't know which index to use when assigning the values. This is not true. Your problem is probably caused because you didn't preinitialize the array yourself.

JSF/EL namely won't do it for you (like as with every other "nested object"). It will only set the array value by the given index. E.g.

Private int positions; public Bean { positions = new int3; // You need to preinitialize it yourself! } public int getPositions() { return positions; } // No setter needed! With.

Hmm that's a good point. I had it preinitialized in the declaration but not in the constructor. I will try it like you said and let you know.

Thank you. – D. Bermudez Oct 6 at 16:06 That wouldn't make the difference.

Your concrete problem is thus caused by something else. An SSCCE would help a lot in nailing it down. – BalusC Oct 6 at 16:07 It worked!

Thank you. – D. Bermudez Oct 6 at 16:32 Hmm OK, you're welcome :) Sure that the problem wasn't actually caused by something else?

A wrong array length maybe? What exception did you initially got? ArrayIndexOutOfBoundsException?

If so, then it was definitely that. – BalusC Oct 6 at 16:41.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions