简体   繁体   English

Tapestry-可能的列表形式元素吗?

[英]Tapestry - Form element for list possible?

I tried my best to make the title represent the question, but it needs some explaining, and i'll try to do that in the simplest form I can. 我尽力使标题代表问题,但是需要一些解释,我将尝试以最简单的方式做到这一点。

Let's say I have a page with a class and a .tml file. 假设我有一个包含类和.tml文件的页面。 The page has an ArrayList of Strings. 该页面具有字符串数组列表。 I would like to make a form which allows the user to enter as many strings as they would like into that array list. 我想制作一个表格,允许用户在该数组列表中输入任意数量的字符串。 I'd rather, if possible, not have the page refresh each and every time, but would rather have an "add new string" button. 我希望,如果可能的话,不要让页面每次都刷新,而是希望有一个“添加新字符串”按钮。

So for example, if _ _ _ _ _ represents an input box, I would like this: 因此,例如,如果_ _ _ _ _代表一个输入框,我想这样做:

Form:
Input 1: _ _ _ _ _

[Button: Add new row] [Button: Submit]

If the user presses add new row, the form should update to: 如果用户按添加新行,则表格应更新为:

Form:
Input 1: _ _ _ _ _
Input 2: _ _ _ _ _ 

[Button: Add new row] [Button: Submit]

When submitted, I would like to add all of those strings into the ArrayList. 提交后,我想将所有这些字符串添加到ArrayList中。

Is there something out there already to do something similar to this? 已经有一些东西要做类似的事情了吗? For my actual purpose, I would need to edit it a little as each new "row" actually has more options next to it in the form, but if someone can point me to the right place to work this out then I'm sure I can figure the rest out. 出于我的实际目的,我需要对其进行一些编辑,因为表单中每个新的“行”实际上旁边都有更多选项,但是如果有人可以将我指向正确的位置进行处理,那么我敢肯定可以找出其余的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM