Hi All,

I think that the following is a problem(bug) with tapestry5.4 persist
strategy flash.
---------------------------------------
problem description:  two fields with FLASH stratege, one is String,
another is List<String>. when i submit form, List<Sting> works, but String
field disapper. following is the code. please help me solve this
problem.Thanks.
------------------------------------------
public class Persist1 {
 @Property
@Persist(PersistenceConstants.FLASH)
private List<String> mails;
 @Property
@Persist(PersistenceConstants.FLASH)
private String username;
 @Property
@Persist(PersistenceConstants.FLASH)
private String address;
 @Property
private String mail;
 @Inject
private Logger log;
 @Log
void setupRender() {
if (!isEmpty()) {
mails.add("xxxxxx");
}
}
 @Log
void onSuccess() {
address = "yunnan";
if (mails == null) {
mails = new ArrayList<String>();
mails.add("xxx...@gmail.com");
mails.add("y...@hotmail.com");
}
}
 public boolean isEmpty() {
return (mails == null || mails.size() == 0);
}
}

Persist.tml-------------------------------------
<!doctype html>
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd";>
    <head>
        <meta charset="UTF-8" />
        <title>Persistence Test</title>
    </head>
    <body>
        <div class="container">
            <form class="form-signin" t:type="form" t:id="inputForm">
                <t:errors />
                <input type="text" t:type="textfield" t:id="username"
class="form-control" placeholder="please enter your username" /> <br />
                your address is : ${address}
                <br />


                <button class="btn btn-lg btn-primary btn-block"
type="submit">Sign in</button>
            </form>
            <t:if test="!empty">
                   <t:loop source="mails" value="mail">
                       ${mail}
                   </t:loop>
                </t:if>
        </div>
        <div class="vimiumReset vimiumHUD" style="right: 150px; opacity: 0;
display: none;"></div>
    </body>
</html>
------------------------------------------------

Reply via email to