Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9208413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:36:47+00:00 2026-06-18T00:36:47+00:00

In a Tapestry component template, is there a simple way to render some markup

  • 0

In a Tapestry component template, is there a simple way to render some markup X times, where X is a parameter of the component?

All I can find in the Tapestry docs is the Loop component:

<table class="navigation" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
    <tr>
        <t:loop source="pageNames" value="pageName">
            <td class="${tabClass}">
                <t:pagelink page="pageName">${pageName}</t:pagelink>
            </td>
        </t:loop>
    </tr>
</table>

But this is overkill if I just want to render something X times, without needing to pass any parameters. For this usecase I’d really expect something like (pseudo-code):

<table class="navigation" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
    <tr>
        <t:loop times="${x}">
            <!-- same markup every time -->
        </t:loop>
    </tr>
</table>

But nothing like this seems to exist – or does it?

For now my workaround is to provide a stub implementation of List which gives size X, and use that as my Loop source:

Class:

private int x;

public List<Object> getX() {
    return new AbstractList<Object>() {
        public Object get(int arg0) {
            return null;
        }
        public int size() {
            return x;
        }
    };
}

Template:

<t:loop source="x">
    <!-- same markup each time -->
</t:loop>

But this is very ugly – surely there’s a nicer way to do something so straightforward?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:36:48+00:00Added an answer on June 18, 2026 at 12:36 am

    This can be done with a loop and tapestry’s range operator

    Santa Claus said: <t:loop t:source="1..3">Ho</t:loop>
    

    http://tapestry.apache.org/property-expressions.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in tapestry we can use the component in two ways <t:type=grid t:source=persons t:row=person t:encoder=personEncoder
is there way to update tapestry zone by ZoneManager with POST field in request
I'm facing a problem when using tapestry 5.2.0 : using multiple times a component
Is there a way to get the Tapestry page class or name of the
I am trying to fill up Palette component in Tapestry 5 with result of
Apache Wicket ( http://wicket.apache.org/ ) and Apache Tapestry ( http://wicket.apache.org/ ) are both component
I am aware that there is something special about tapestry services/resources such as Request,
I'm currently working on some project, using Apache Tapestry 5.3.6. I have issue using
I have set up Tapestry 5 project and all went fine, until I deployed
I'm using tapestry 5.3.3 (which includes the patch for issue #1844)... Is there a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.