Problem with Logic-iterate and enumeration

2002-06-06 Thread struts (H2Opilot)


hi,
I have a List of Numbers and I like to use 3 columns and n rows.

Is there a possible way to realise this via Logic-iteration.

Normally, it look like that every next step in the iteration there is
always another row.

Like this:

table width=100% border=0 cellspacing=1 cellpadding=1
logic:iterate id=element name=bla_f property=numberss
type=app.Data

  tr bordercolor=#66
  td
bean:write name=element property=number/
  /td

  td
** this should be the next element of Data, but how increment the
element??  *
   bean:write name=element property=number/
  /td

  /tr

/logic:iterate
/table

any ideas?


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Problem with Logic-iterate and enumeration

2002-06-06 Thread dhay



I hate using scriptlets, but had to do so in the end for the problem - although
could have made a custom tag I guess.  Here's what I do:

  TABLE BORDER=0 CELLPADDING=8 CELLSPACING=8
 TR
logic:iterate id=category name=mfdCategoriesForm
property=categories indexId=index
TD
   bean:write name='category' property='name'/
/TD
   %
  //insert rows where necessary
  int categoriesInRow = 3;
  if ((index.intValue()  0  ((index.intValue()+1)
 % categoriesInRow == 0)))
  {
   %
/TR
TR
   %
  }
   %
/logic:iterate
 /TR
 /html:form
  /TABLE

HTH,

cheers,

Dave




struts (H2Opilot) [EMAIL PROTECTED] on 06/06/2002
10:40:07 AM

Please respond to Struts Users Mailing List
  [EMAIL PROTECTED]; Please respond to
  [EMAIL PROTECTED]

To:   Struts Users Mailing List
  [EMAIL PROTECTED]
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Problem with Logic-iterate and enumeration




hi,
I have a List of Numbers and I like to use 3 columns and n rows.

Is there a possible way to realise this via Logic-iteration.

Normally, it look like that every next step in the iteration there is
always another row.

Like this:

table width=100% border=0 cellspacing=1 cellpadding=1
logic:iterate id=element name=bla_f property=numberss
type=app.Data

  tr bordercolor=#66
  td
bean:write name=element property=number/
  /td

  td
** this should be the next element of Data, but how increment the
element??  *
   bean:write name=element property=number/
  /td

  /tr

/logic:iterate
/table

any ideas?


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]








--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Problem with Logic-iterate and enumeration

2002-06-06 Thread Galbreath, Mark

This seems like a kludge, but I don't know of another way of doing it with
Struts tags.  Anybody else?

tr
  logic:iterate * * * length=3 offset=0
tdbean:write * * * //td
  /logic:iterate
/tr
tr
 logic:present
   logic:iterate * * * length=3 offset=3
  tdbean:write * * * //td
  /logic:iterate
/tr
tr
  logic:iterate * * * length=3 offset=6
  tdbean:write * * * //td
  /logic:iterate
/tr
tr
  * * * 
do for how many more groups of 3 numbers you anticipate
will only print out if data is present
  * * *
/logic:present
/tr

Empty tr/tr tags shouldn't bloat table space.

Mark

-Original Message-
From: struts (H2Opilot) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 10:40 AM

hi,
I have a List of Numbers and I like to use 3 columns and n rows.

Is there a possible way to realise this via Logic-iteration.

Normally, it look like that every next step in the iteration there is
always another row.

Like this:

table width=100% border=0 cellspacing=1 cellpadding=1
logic:iterate id=element name=bla_f property=numberss
type=app.Data

  tr bordercolor=#66
  td
bean:write name=element property=number/
  /td

  td
** this should be the next element of Data, but how increment the
element??  *
   bean:write name=element property=number/
  /td

  /tr

/logic:iterate
/table

any ideas?


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Problem with Logic-iterate and enumeration (2)

2002-06-06 Thread Galbreath, Mark

Or perhaps something like?

%! int count = 0 %
logic:iterate * * *
  tr
logic:iterate * * * length=3 offset=%= count %
  tdbean:write * * * //td
/logic:iterate
  /tr
  % count += 3 %
/logic:iterate

Mark

-Original Message-
From: struts (H2Opilot) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 10:40 AM

hi,
I have a List of Numbers and I like to use 3 columns and n rows.

Is there a possible way to realise this via Logic-iteration.

Normally, it look like that every next step in the iteration there is
always another row.

Like this:

table width=100% border=0 cellspacing=1 cellpadding=1
logic:iterate id=element name=bla_f property=numberss
type=app.Data

  tr bordercolor=#66
  td
bean:write name=element property=number/
  /td

  td
** this should be the next element of Data, but how increment the
element??  *
   bean:write name=element property=number/
  /td

  /tr

/logic:iterate
/table

any ideas?


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]