No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
Kumaravadivel Subramani wrote:You got no errors and no display, so have you debug the database values are being retrieved correctly before put it into <select>?
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
Kumaravadivel Subramani wrote:I meant to say debug can help to check out the DB values are extracted properly.
Kumaravadivel Subramani wrote:Have to debug your Servlet code that extracts values from DB. Eclipse or other IDE would be very helpful for you to debug.
SCJP, SCWCD.
|Asking Good Questions|
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
Kumaravadivel Subramani wrote:Have you got values from DB while debugging? Is the problem about to display the content retrieved?
Amit Ghorpade wrote:First thing is, there is a better way to display the page you are trying in the code above, go for a JSP.
Then you can use Javascript for the calender and Java beans for DB values.
Really helps in keeping things simple and maintainable.
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
Kumaravadivel Subramani wrote:Seems you have to give some text to display as caption in the <option> tag while value attribute would be sending the given value to server. Try this
out.println(" <option value=\"+rs.getString(\"NO\")+\">someText</option>");
example link : http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_option_value
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
Kumaravadivel Subramani wrote:Actually <option value="somtext"> won't be displayed and caption only does, this is due to hiding the actual value from the displaying one. If you want to check you can see that via page source of your web browser.
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
archana tiwari wrote:
Kumaravadivel Subramani wrote:Actually <option value="somtext"> won't be displayed and caption only does, this is due to hiding the actual value from the displaying one. If you want to check you can see that via page source of your web browser.
yeah i have done this values are being displayed in page source but what should i do to display database values in drop down box then.
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
Kumaravadivel Subramani wrote:I've posted another after that saying as follows,
out.println(" <option value=\"+rs.getString(\"NO\")+\">rs.getString(\"NO\")</option>");
archana tiwari wrote:
Kumaravadivel Subramani wrote:I've posted another after that saying as follows,
out.println(" <option value=\"+rs.getString(\"NO\")+\">rs.getString(\"NO\")</option>");
but its not working ........same value is getting printed.....i want database values
No pain, No gain.
OCJP 1.6, Liferay Certified Developer 6.1
Kumaravadivel Subramani wrote:Have you tried this code as Eshwin Sukhdeve said? In the result set have you got anything from DB? If you struck with DB value retrieval more example available in net. Check whether result set having value or not then try to display the value.
Punit Jain wrote:please use code tags.
to display calendar you can use java script.
have a google search for javascript calendar.
Hope this helps.
Don't get me started about those stupid light bulbs. |