| Author |
c:forEachToken
|
Mijeong Yi
Greenhorn
Joined: Feb 12, 2006
Posts: 4
|
|
make use of <c:forEachToken> select box create========== <c:set var="setNum1"><c ut value="${fNum1}" /></c:set> <select name="sNum"> <c:forEachToken var="num" items="00001/00002/00003/00004" delims="/"> <option value=" " <if test="{setNum1 == [num value]}"> selected </c:if>> <c ut value="${num}" /> </option> </c:forEachToken> </select> // help me!! [num value]is array num[i] in JAVA. but, JSTL express it. [ February 12, 2006: Message edited by: Mijeong Yi ] [ February 12, 2006: Message edited by: Mijeong Yi ] [ February 12, 2006: Message edited by: Mijeong Yi ]
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
If you are talking about c:forTokens, you should use "num" to check the value : <c:if test="${setNum1 == num}"> [ February 12, 2006: Message edited by: Satou kurinosuke ]
|
[My Blog]
All roads lead to JavaRanch
|
 |
Mijeong Yi
Greenhorn
Joined: Feb 12, 2006
Posts: 4
|
|
compare setNum1 with each items. setNum1 compare 00000 setNum1 compare 00001 : : I Can't speak english well. I'm sorry.... [ February 12, 2006: Message edited by: Mijeong Yi ]
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
I Can't speak english well. I'm sorry....
It's ok. Me either Have a look at the piece of code I have posted above, and tell me what you think about it. It compares setNum1 to each token taken from the list. If it matches, the option will be selected.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56521
|
|
"dawn sky", There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it. In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Thanks! bear JavaRanch Sheriff
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Mijeong Yi
Greenhorn
Joined: Feb 12, 2006
Posts: 4
|
|
Ok. Thanks
|
 |
 |
|
|
subject: c:forEachToken
|
|
|