thanks for helping me! i have been solved it.. your idea was very good!

before i use <%=(String)an_author%>, it throws a exception,
'[ServletException in:/tiles/admin/selectAuthor.jsp] null'

i don't know why, because the author_id data type is a java.lang.Integer...

until i changed it to <%=an_author.toString()%> , now ,it's work...



----- Original Message -----
From: "Claire Wall" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, November 29, 2003 12:56 AM
Subject: Re: validation : the select field and checkbox field origin value
lost...


> Ricky,
>
> it is possible to do what you wish to do by doing the following (example
> taken from a similiar thing that i did):
>
>   <logic:iterate id="user" name="myForm" property="users">
>   <bean:define id="id" property="id" name="user"/>
>    <html:option value="<%= (String)id %>"><bean:write name="user"
> property="username"/></html:option>
>   </logic:iterate>
>
> here i am iterating through a list of User objects in my form (my User
> object is basically a class with the fields 'id' and 'username'). By using
> <bean:define..> you can then use a JSP expression to set the value of the
> <html:option> using the id of the <bean:define>. So in your case it will
be
> something like:
>
> <logic:iterate name="authors" id="author">
>   <bean:define id="an_author" property="author_id" name="author"/>
>       <html:option value="<%= (String)an_author %>">
>             <bean:write name="author" property="author_name" />
>     </html:option>
> </logic:iterate>
>
>
> hope this helps
> claire
>
> ----- Original Message -----
> From: "Ricky" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Friday, November 28, 2003 4:37 PM
> Subject: Re: validation : the select field and checkbox field origin value
> lost...
>
>
> > thanks for helping me..  and then i search a question like this at
achieve
> > mailing and it told me use <html:option>, and i test it, the solution is
> ok,
> > but, what a pity, i can't use <html:option> , because.. if i use it...it
> > will show me the exception :"equal symbol expected"
> > in the jsp page , i use a <logic:iterate to add my option element, and
> can't
> > nested a <html:option> in it. just like this.
> >
> > <logic:iterate name="authors" id="author">
> >   <html:option value="<bean:write name="author" property="author_id"
> > />"><bean:write name="author" property="author_name" /></html:option>
> > </logic:iterate>
> >
> > if i use that code above , it shows me the exception... so i have to
> abandon
> > the <html:option> tag, what a pity... :(   i can only use common html
> syntax
> > <option>, so my first problem you replied me come out..
> >
> > and could anyone have a better solution about my case?
> >
> > or i can change the <login:iterate> to java script as java.util.List to
> use
> > a loop to get my select option...in fact, i don't want insert a java
> script
> > in my page, all of my page are using taglib, none java script within my
> jsp
> > page....
> >
> > and what about <nested> tag... any other better way?
> >
> >
> >
> > ----- Original Message -----
> > From: "Janice" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Saturday, November 29, 2003 12:15 AM
> > Subject: re: validatation : the select field and checkbox field origin
> value
> > lost...
> >
> >
> > > Hi Ricky,
> > >
> > > After validation, struts will display whatever you specified in the
> input
> > > parameter of your action mapping.  If you specify an action (like
> > > displayForm.do), then all of the processing that is done in that
action
> > will
> > > be performed before the page is shown.  I suspect this is why the
values
> > on
> > > the form that were changed have gone back to their defaults.  What you
> > > probably want to do instead is specify the .jsp page that you would
> > normally
> > > forward to upon success (like myForm.jsp).
> > >
> > > hth,
> > > Janice
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to