What's behind JSP & Servlets
Sun Sep 11, 2011 1:53 pm
i have 2 comboboxes on jsp page.first combobox is been fillin onload and second combobox must be fille by choosing an option from first combobox like :city and countries.
how i can "push" to make the loading data from bean class?
Mon Sep 12, 2011 12:48 pm
can you post your code please.
Tue Sep 13, 2011 8:47 am
<%@page import="shopking.Product"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html>
<head>
<title>חיפוש מתקדם</title>
<link rel="stylesheet" type="text/css" href="cssFiles\menu.css"/>
<link rel="stylesheet" type="text/css" href="cssFiles\advance_search_page.css"/>
<jsp:useBean id="user" class="shopking.AdvanceSearchClass" scope="page"/>
<%@page import="java.util.ArrayList"%>
<%@page import="shopking.Category"%>
</head>
<body>
<img src="images\web_logos\shopking_logo.png" class="shopking_logo">
<%ArrayList<Category> cc = user.getCategoriesList(); %>
<select name="categoryName" id="categoryName" dir="rtl">
<option value="all">הכל</option>
<% for(int i=0 ;i<cc.size();i++){%>
<option value="<%=cc.get(i).getCategory_Id()%>"><%=cc.get(i).getDescriptionH()%>
</option><%}%></select>:קטגורית חנות
<input type="text" name="FREEtext">:קטגורית מוצרים
<input type="number" id="to" width="3">עד <input type="number" id="from" width="3">מחיר מ
<script>
var categoryP=document.getElementById("categoryName");
categoryP=category.selectedIndex();
var from=document.getElementById(from).valueOf();
var to =document.getElementById(to).value();
<%ArrayList<Product>prodList=user.getProductListByCategory(Integer.parseInt(categoryP), Double.parseDouble(from), Double.parseDouble(to)); %>
<select name="Products" dir="rtl">
<% for(int i=0;i<prodList.size();i++){%>
<option value=<%=i %>><%=prodList.get(i).getProducr_NameH()%></option>
<%}%>
</select>
</script>
</body>
</html>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.