Total members 11895 |It is currently Sun Dec 22, 2024 10:59 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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?




Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time

can you post your code please.

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time

<%@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>


Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time
Post new topic Reply to topic  [ 3 posts ] 

  Related Posts  to : filling two comboboxes
 Filling JComboBox from database     -  
 ASP.NET code for filling and displaying a DataGrid     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
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