How can I make a select box in BeanEditForm for some key that is not showing in BeanEditForm for example I have a table:

Person:

IDPerson
PersonName

and table

Contact:

IDContact
IDPerson
ContactName

and I want to create a BeanEditForm with allows me to choose a person from list when adding a contact in tapestry 5.3.

有帮助吗?

解决方案

Please try following

<t:beaneditor t:id="contact" add="person" object="contact">
    <p:person>
        <t:select .../>
    </p:person>
</t:beaneditor>

It should work, but I'm typing that from top of my head.

其他提示

You can either use a beaneditform with 'add' and a block parameter, as suggested by Michal Gruca, or you can use the beaneditor directly. A <t:beaneditform /> is just a <t:beaneditor /> inside a <t:form />

eg:

<t:form t:id="contactForm">
    <t:errors/>
    <t:beaneditor object="contact" include="firstName,lastName" />
    <t:label for="person" /><t:select t:id="person" value="contact.person" model="..." />
    <t:beaneditor object="contact" include="height,age" />
    <input type="submit" value="message:submit-label" />
</t:form>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top