at 2003. március 1. 19:46 wrote:
> > Hi All,
> >
> > I read intake service and howto documentation, but I need some codes
> > forexample an user registration.
> >
> > There are two mode of operations: insert or modify
> >
> > In insert there is no business object (null), the form code is following:
> >
> > <form method="post"
> > action="$link.setPage('UserForm.vm').setAction('UsrAction')">
> > #if ($uid != 0) ## modify
> > #set ($itUser = $intake.User.mapTo($user))
> > ## modified business object (ExtendedUser)
> > #else ## new user registration
> > #set ($itUser = $intake.User.Default )
> > #end
> > ...
> > #if( ! $itUser.Email.isValid())
> > #errorMsg($itUSer.Email.Message)<br>
> > #formLabel("e-mail")
> > <td><input type="text" name="$itUser.Email.Key"
>
> value="$itUser.Email"></td>
>
> > ok, it seems to be good, but
> > 1. when I register a new user and I fill a wrong email value, I get an
>
> intake
>
> > error message, but the value is empty! Generated html is:
> > <input type="text" size="30" name="usr_0umail" value="">
> > Why it clear presetting value?
>
> there is somewhere a patch dealing with this issue, you will have to search
> the mailing list for it.
>
> > 2. If I modifiy user's values there is a wrong fieldname in the generated
> > html:
> > <input type="text" size="30" name="usrnullumail"
> > value="[EMAIL PROTECTED]">
> > What is usrnullumail instead of usr_0umail?
>
> is your Object implementing Retrievable interface ?
> regards Akmal
yes, it is, but I don't know what I have to do in set/getQueryKey:
public class Student extends com.zamek.vili.om.BaseStudent
implements Persistent, Retrievable {
private String key;
public void setQueryKey(String newKey) {
this.key = newKey;
}
public String getQueryKey () {
return key;
}
}
and I don't know do I have to use setQueryKey in velocity form, or it
automatic.
--
thx,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]