Based on that JSP expression I guess you also have a getter for
parent.children. If not, then that's probably why Stripes won't call the
setter. I think it calls the getter to determine if the list is null before
it tries to set it.
If that's not the problem, then I suggest you turn on debug logging and look
carefully at what Stripes is doing during binding. The debug logging is
quite detailed and will probably reveal the problem.
-Ben
On Wed, Feb 11, 2009 at 11:36 PM, Alex Wibowo <[email protected]> wrote:
> Gday,
>
>
> I have a bean as follows:
>
>
> public class Parent{
> List<Child> children = new ArrayList<Child>();
>
> public void setChildren(List<Child> children){
> for (Child child: children){
> child.setParent(this);
> }
> this.children= children;
> }
> }
>
>
> and in the jsp:
>
> <c:forEach begin="0" end="${fn:length(actionBean.parent.children) == 0 ? 5
> : fn:length(actionBean.parent.children) - 1}" var="i">
> <stripes:text name="parent.children[${i}].name/>
> </c:forEach>
>
>
>
> However... the setChildren() method didnt get called at all. I've tried to
> supply the array version:
>
> public void setChildren(Child[] child){
> setChildren(Arrays.asList(child));
> }
>
> but it still doesnt work.
>
> The reason I need setChildren to get called, is to set the parent property
> on the children (I'm using hibernate's mappedBy).
>
>
>
> Any ideas?
>
>
>
> Thanks a lot! Oh... and I'm using Stripes 1.4.3
>
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users