struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abdullah Jibaly" <Abdullah.Jib...@aeroxchange.com>
Subject RE: logic:iterate, with offset and length parameters, lose data
Date Wed, 20 Apr 2005 14:18:20 GMT
Suggestions:

1- Use c:forEach instead of logic:iterate
2- Use a seperate property in your form to store the viewable/changeable stuff,
	for example if you have a collection of strings, you can have an array of strings be
	your viewable/editable property. This will cut down on network traffic and make
	debugging much easier.

Otherwise you can do it as you mentioned with hidden fields:

<c:forEach items="formName.collectionProperty" var="item" varStatus="s">
	<c:if test="${s.index >= offset and s.index < offset + length}" var="displayable">
		<html:input property="collectionProperty" value="${item}" />
	</c:if>
	<c:if test="${not displayable}"><html:hidden property="collectionProperty" value="${item}"
/></c:if>
</c:forEach>

Regards,
Abdullah

-----Original Message-----
From: Oscar [mailto:ocristobal@aena.es]
Sent: Wednesday, April 20, 2005 5:23 AM
To: user@struts.apache.org
Subject: logic:iterate, with offset and length parameters, lose data


Hi, I am using a logic:iterate tag throw a Collection. This collection is a 
property of my ActionForm.
I set also an offset and length.

So, shown elements work fine, but not shown elements are just null. I would not 
like to lose data of the "not shown elements" of the collection.

I dont know how to use html:hidden for my purposes, because I think this only 
can be used for a property.

Any help?
Thanks in advance

Oscar Cristobal


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message