Convert 2 tier to 3 tier dynamic drop down.
Hello Everyone,
I have some code (posted below) that works great to develop a 2 level drop down where the second selection is based on the first. What I want to do is adapt this to be a 3 level drop down where the second selection is based on the first selection and the third selection is based on the second selection. I have seen several examples but I am not a coder and do not know java script so I was not able to make them work. The example below I understand so I would like to use this format.
Any help would be much appreciated since my deadline is fast approaching.
Thanks
<cfif isDefined('form.Park')>
<cfset page.Park = form.Park>
</cfif>
<cfoutput>
<cfquery name="get_Main_Group" datasource="Landbird_Monitoring">
SELECT DISTINCT tbl_Sites.Unit_Code
FROM tbl_Sites
ORDER BY tbl_Sites.Unit_Code;
</cfquery>
<form name="DropDown" method="post">
<select name="Park" required="yes" onChange="this.form.submit()">
<option>Park</option>
<cfloop query="get_Main_Group">
<option value="#Unit_Code#" <cfif isDefined('form.Park')><cfif form.Park eq "#Unit_Code#">selected</cfif></cfif>>#Unit_Code#</option>
</cfloop>
</select>
<cfif isDefined('page.Park')>
<cfquery name="get_Sub_Group" datasource="Landbird_Monitoring">
SELECT DISTINCT tbl_Sites.Unit_Code, tbl_Sites.Site_Name
FROM tbl_Sites
WHERE (((tbl_Sites.Unit_Code)='#page.Park#'))
ORDER BY tbl_Sites.Unit_Code, tbl_Sites.Site_Name;
</cfquery>
<select name="Route" required="yes" >
<option>Route</option>
<cfloop query="get_Sub_Group">
<option value="#Site_Name#">#Site_Name#</option>
</cfloop>
</Select>
<br>
</cfif>
</CFOUTPUT>
<input name="Submit" type="submit" value="Click Here" formaction="Sum_Bird_SpeciesList_Route.cfm">
</form>
Hello Dan,
Hoping you can help me out. Took your advice and found an example using cfselect bind that I think will work. It is at: http://tutorial544.easycfm.com/
So I am trying to get the example to work and I get an error message which states "The path to the CFC must be specified as a full path, or as a relative path from the current template, without the use of mappings."
I did a little research and it sounds like I need to edit the text in the line of code below to account for a pathway.
bind="cfc:data.getStates()"
I have tried every pathway I can think of and it does not work. Do you know what the code for this line should look like?
the cfc and cfm files are on my computer at: C:\Internet\Monitoring\vs\Landbird\Data\DataSummaries
the website address where they are shown is: http://science.nature.nps.gov/im/units/klmn/Monitoring/Landbird/data/datasummaries/FormA.c fm
I also posted the code below in case you wanted to see it:
FormA.cfm
<cfform name = "form1" action="formB.cfm" method="Post">
State: <cfselect name="states" bindOnLoad="Yes" bind="cfc:data.getStates()" />
City: <cfselect name="city" bindOnLoad="Yes" bind="cfc:data.getCity({states})" />
<cfinput type="submit" name="submit" value="Search">
</cfform>
data.cfc
<cfcomponent output="false">
<cffunction name="getStates" access="remote" returntype="array">
<cfquery name="states" datasource="Landbird_Monitoring">
SELECT DISTINCT state FROM data
ORDER BY state
</cfquery>
<cfset count="1" />
<cfset results = arraynew(2)>
<cfloop query="states">
<cfset results[count][1]="#state#" />
<cfset results[count][2]="#state#" />
<cfset count= count+1>
</cfloop>
<cfreturn results />
</cffunction>
<cffunction name="getCity" access="remote" returntype="array">
<cfargument name="state" type="string" required="true">
<cfquery name="cities" datasource="Landbird_Monitoring">
SELECT DISTINCT city FROM data
WHERE state = '#state#'
ORDER BY city
</cfquery>
<cfset count="1" />
<cfset results = arraynew(2)>
<cfloop query="cities">
<cfset results[count][1]="#city#" />
<cfset results[count][2]="#city#" />
<cfset count= count+1>
</cfloop>
<cfreturn results />
</cffunction>
</cfcomponent>
Similar Messages
-
How do I enable multiple dynamic drop down boxes?
I'm using Windows 2000, Java SDK 2 Standard, Tomcat, Apache, Microsoft Access and Macromedia Dreamweaver Ultradev 4.
With UltraDev I'm trying to create a jsp page that has more than one dynamic drop down box or more than one dynamic select list box. I can show one dynamic object and as many static objects as I need. But when I add a second dynamic drop down box, with a second recordset, the page will only display the first dynamic object and all content following that object will not display.Here's the code:
<%@page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*"%>
<%@ include file="Connections/conn.jsp" %>
<%
Driver DriverRecordset1 = (Driver)Class.forName(MM_conn_DRIVER).newInstance();
Connection ConnRecordset1 = DriverManager.getConnection(MM_conn_STRING,MM_conn_USERNAME,MM_conn_PASSWORD);
PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("SELECT STATE_NAME, COUNTRY FROM STATE");
ResultSet Recordset1 = StatementRecordset1.executeQuery();
boolean Recordset1_isEmpty = !Recordset1.next();
boolean Recordset1_hasData = !Recordset1_isEmpty;
Object Recordset1_data;
int Recordset1_numRows = 0;
%>
<%
Driver DriverRecordset2 = (Driver)Class.forName(MM_conn_DRIVER).newInstance();
Connection ConnRecordset2 = DriverManager.getConnection(MM_conn_STRING,MM_conn_USERNAME,MM_conn_PASSWORD);
PreparedStatement StatementRecordset2 = ConnRecordset2.prepareStatement("SELECT FIRSTNAME, LASTNAME, AGE FROM PLAYER");
ResultSet Recordset2 = StatementRecordset2.executeQuery();
boolean Recordset2_isEmpty = !Recordset2.next();
boolean Recordset2_hasData = !Recordset2_isEmpty;
Object Recordset2_data;
int Recordset2_numRows = 0;
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="">
<p>
<select name="select2">
<option value="Canada">Canada</font></option>
<option value="France">France</font></option>
<option value="French Guiana">French Guiana</font></option>
<option value="French Polynesia">French Polynesia</font></option>
<option value="French Southern Territories">French Southern Territories</font></option>
<option value="Germany">Germany</font></option>
<option value="United Kingdom">United Kingdom</font></option>
<option value="United States">United States</font></option>
</select>
</p>
<p>
<select name="select">
<%
while (Recordset1_hasData) {
%>
<option value="<%=(((Recordset1_data = Recordset1.getObject("COUNTRY"))==null || Recordset1.wasNull())?"":Recordset1_data)%>" ><%=(((Recordset1_data =
Recordset1.getObject("STATE_NAME"))==null || Recordset1.wasNull())?"":Recordset1_data)%></option>
<%
Recordset1_hasData = Recordset1.next();
Recordset1.close();
Recordset1 = StatementRecordset1.executeQuery();
Recordset1_hasData = Recordset1.next();
Recordset1_isEmpty = !Recordset1_hasData;
%>
</select>
</p>
<p>
//Here's where things go awry
<select name="select4">
<%
while (Recordset2_hasData) {
%>
<option value="<%=(((Recordset2_data = Recordset2.getObject("FIRSTNAME"))==null || Recordset2.wasNull())?"":Recordset2_data)%>" ><%=(((Recordset2_data = Recordset2.getObject("FIRSTNAME"))==null || Recordset2.wasNull())?"":Recordset2_data)%></option>
<%
Recordset2_hasData = Recordset2.next();
Recordset2.close();
Recordset2 = StatementRecordset2.executeQuery();
Recordset2_hasData = Recordset2.next();
Recordset2_isEmpty = !Recordset2_hasData;
%>
</select>
</p>
<p>
<select name="select5">
</select>
</p>
<p> </p>
</form>
<form name="form2" method="post" action="">
<select name="select3">
</select>
</form>
<p> </p>
</body>
</html>
<%
Recordset1.close();
ConnRecordset1.close();
%>
<%
Recordset2.close();
ConnRecordset2.close();
%> -
How to populate data from dynamic drop down list to the text field
Hi,
I tried to populate data from dynamic drop down list to city field. I would like to concat data from drop down list.When selecting add button to add the item and select item from drop down list, data should be displayed in the text field. However, Please help. I spent alot of time to make it works I am not successful.
Please see the link below.
https://acrobat.com/#d=SCPS0eVi6yz13ENV0cnUdw
Thanks for your help
CindyHi Rosalin,
Loop the hidden table, get the values and populate drop down in each iteration.
DropDownList1.addItem("Text","Value");
You can use one more solution for this scenario. If it is a matter of 2,3 dropdowns, put three dropDowns in the form layout and give seperate static data binding to them. At run time make the dropDowns hide/visible as per the requirement.
Hope this helps.
Thanks & Regards,
Sanoosh -
Filling dynamic drop down in adobe interactive form( webdynpro ABAP)
HI all,
Im new in Webdynpro ABAP, my requirement is to fill drop down list in adobe interactive form. i created adobe form and its working fine.
I Created context like ROOT(cardinality 1:1)->DATANODE cardinality 0:n. This context is for drop down and in wddoinit i did like this.
IN WDDOINIT ,
DATA lo_nd_root TYPE REF TO if_wd_context_node.
DATA lo_nd_datanode TYPE REF TO if_wd_context_node.
DATA lo_el_datanode TYPE REF TO if_wd_context_element.
DATA ls_datanode TYPE wd_this->elements_datanode.
navigate from <CONTEXT> to <ROOT> via lead selection
lo_nd_root = wd_context->get_child_node( name = wd_this->wdctx_root ).
navigate from <ROOT> to <DATANODE> via lead selection
lo_nd_datanode = lo_nd_root->get_child_node( name = wd_this->wdctx_datanode ).
get element via lead selection
lo_el_datanode = lo_nd_datanode->get_element( ).
ls_datanode[] = lt_dna_value[].
CALL METHOD lo_nd_datanode->bind_table
EXPORTING
new_items = ls_datanode
set_initial_elements = ABAP_TRUE.
index =
while executing i'm getting this error ": WebDynpro Exception: ADS: com.adobe.ProcessingException: No output was generated while rendering: Stream for: PDFOut.(200,101). " . can u please tell me how to bind value for drop down.
I created sample table in same form and i binded same value to table, that time its executing fine.
can u please tell me solution for this Scenario.
Thanks
Hemachandran.
Edited by: hemachandran R on Sep 12, 2008 2:27 PMhi,
My requirement, is to use dynamic drop down in dynamic table. I am using webdynpro abap.
i populated the value in drop down.
Its working fine but the problem is how to fill the default value in drop down. because i want to bind the default value which im getting specify value from the table.because each row
im getting different values, like first row
CAR
, that CAR want to fill as a default value in drop down and second row as
BIKE
that BIKE want to fill as default value in drop down ( example drop down contain car , bike , cycle).
In adobe form i binded like this
$record.DATANODE.DATA[*].DNA_RATING
i dont know whether this one is correct or wrong .
im getting default value as empty.
please give me some solution how to do this.its very urgent
thanks
hemachandran. -
Dynamic Drop-down list - selected value can't be cleared ...
1. check out the following code of a dynamic drop down list using cursor :-
DECLARE
-- DROP-DOWN LIST OF ALL DEPARTMENTS
TEMPNUMBER NUMBER(2) := 2 ;
-- Because we've to initialize the list
-- at least with 1 item.
CURSOR C_DEPT IS
SELECT DEPT_ID FROM DEPARTMENT;
BEGIN
ABORT_QUERY ;
CLEAR_LIST('DEPTLIST');
FOR TEMP IN C_DEPT LOOP
ADD_LIST_ELEMENT( 'DEPTLIST', TEMPNUMBER, TEMP.DEPT_ID, TEMP.DEPT_ID );
:SRBLOCK.LST := TEMP.DEPTNO;
-- prev. line set the newly selected value
TEMPNUMBER := TEMPNUMBER + 1 ;
END LOOP;
END;
2. problem is as we've to atleast initialize with one list item... that item can't be cleared with CLEAR_LIST.
3. how can i actually clear that and still use cursor. because i've searched forum for this thing and found all those code not working ... for my project ...
4. quick help needed ...Hi Omar,
I have solution for you
To populating or refreshing the lists you can use
two procedures:
One of them - generic, which can be used for all types of list
Another is specific which contain a SQL statement to retrieve the data for
particular list.
1. Specific procedure:
PROCEDURE GET_DEPARTMENT_LIST
IS
sql_stat VARCHAR2(32767);
ret_code NUMBER;
BEGIN
-- SQL Statement for Drop-down List
-- (must have two columns for label and value - both VARCHAR2)
sql_stat := ' SELECT DEPARTMENT_NAME,TO_CHAR(DEPT_ID)'
||' FROM SCHEMA.DEPARTMENT';
POPULATE_MY_LIST('BLOCK.DEPARTMENT_LIST',sql_stat,ret_code);
END;
2. Generic procedure:
PROCEDURE POPULATE_MY_LIST
(item_name VARCHAR2,
sql_stat VARCHAR2,
out_code OUT NUMBER)
IS
rg_id RECORDGROUP;
rg_name VARCHAR2(100);
ret_code NUMBER;
item_id ITEM;
BEGIN
item_id := FIND_ITEM(item_name);
IF ID_NULL(item_id) THEN
out_code := -1;
RETURN;
END IF;
--Creating Record Group with Unique Name
rg_name := 'RG_'||SUBSTR(item_name,INSTR(item_name,'.',1)+1,LENGTH(item_name));
--Checking Record Group Name for existance
rg_id := FIND_GROUP(rg_name);
--If Group does exist - delete it
IF NOT ID_NULL(rg_id) THEN
DELETE_GROUP(rg_id);
END IF;
--Creating Record Group
rg_id := CREATE_GROUP_FROM_QUERY(rg_name,sql_stat);
ret_code := POPULATE_GROUP(rg_id);
IF (ret_code <> 0) THEN
out_code := ret_code;
RETURN;
END IF;
POPULATE_LIST(item_name,rg_id);
IF NOT FORM_SUCCESS THEN
out_code := -2;
RETURN;
ELSE
out_code := 0;
END IF;
DELETE_GROUP(rg_id);
END;
Hope it help.
Dmitry -
Configuring Dynamic drop down in ABAP Function Module based VC application
Dear Expert,
Can someone help me in configuring Dynamic Drop down list in ABAP function module based
VC application, so that all the backend data like material description list should display in drop down list followed by * search.
Thanks & Regards,
KundanHi Anja,
As you suggested i design a combo box with dynamic entry list. But it not displaying any item for selection. Combo box is showing empty. Can you please help me in this so all the backend list should display in combo box dynamically?
Thanks,
Kundan -
Dynamic drop down list in Adobe forms
I have created a drop down list using enumerated drop down list from webdynpro native tab and binded in the object palette by giving $record.sap-vhlist.DESCR\.DATA\.FIELD.item[]* in the list items dynamically.DESCR is the field in the internal table into which i fetched data from the database table .I have written this code in a BADI.I dont know whether my form's display type is activex or native? I am not getting any values in the drop down list.can anybody please tell me what might be missing and how should i know whether my form is ActiveX or Native?
My form is called from portal so i have used BADI to connect portal to formHi sarang,
I have done a dynamic drop down list in which DESCR field comes from database table and pops into the drop down dynamically. I was working for a PCR scenario so the adobe form was called from portal.I will tell u all the required steps.It might work for u as it is working for me:
1.In the form:
I used two elements from library first is a "ENUMERATED DROP DOWN LIST NO SELECT" from web-dynpro native tab and second is "ISR_TEXT DISPLAY INVISIBLE ON EDIT MODE" from ISR controls tab.Place them one on other inthe form.
For drop down list the setting are:
In object, field tab click on list items there in ITEMS put :$record.sap-vhlist.DESCR\.DATA\.FIELD.item[*].in ITEMS TEXT write text in ITEMS KEY write key.
In binding,in default binding put $record.DESCR.DATA[*].FIELD.
For text element the settings are:
In binding,default binding put Normal.
when we select ISR_TEXT DISPLAY INVISIBLE ON EDIT MODE it automatically comes with calculated read only int he value tab.so open script editor and place the below code:
$record.DESCR.DATA.FIELD (in calculate).
2.Now the code in BADI is as follows:
In BADI we have to write the code for drop down list in the METHOD "SCENARIO_SET_ADDITIONAL_VALUES"
As i didnt change the standard BADI i added an enhancement spot in which i wrote a function module which fills ADDITIONAL_DATA. and the below code fills the ADDITIONAL_DATA .
DATA: t_t572b TYPE STANDARD TABLE OF t572b WITH HEADER LINE,
t_t554t TYPE STANDARD TABLE OF t554t WITH HEADER LINE.
SELECT * FROM t572b INTO TABLE t_t572b WHERE sprsl EQ 'E'.
CLEAR ls_additional_data-fieldindex.
LOOP AT t_t572b.
ADD 1 TO ls_additional_data-fieldindex.
ls_additional_data-fieldname ='DESCR_KEY'.
ls_additional_data-fieldvalue = t_t572b-descd.
APPEND ls_additional_data TO additional_data.
ls_additional_data-fieldname ='DESCR_LABEL'.
ls_additional_data-fieldvalue = t_t572b-descr.
APPEND ls_additional_data TO additional_data.
CLEAR t_t572b.
ENDLOOP.
For DESCR field the we have to declare DESCR_KEY and DESCR_LABEL in the place holders for key values and palce holders for default values in characteristics tab(where all the fields for the form are defined) of ur respective scenario.(where ur pcr scenario is defined)
Hope ur problem got resolved.
Please let me know if any doubts.
If ur form is not called from portal and u want a dynamic drop down list the difference is put a data drop down list and in object, field tab click on list items there in ITEMS select the field into which u populated the data from the database table (this code shud be written in code Initialization in the respective interface) and in ITEMS TEXT put $ in ITEMS KEY put $.and in binding as we normally do bind it to the respective field in which the data is populated from database table.
It should work. -
I have to create a form that would have dynamic drop down menus, and then depending on those choices populate a number of fields.
Here is the basic structure
Division ( 5 choices )
Center ( dependent on choice of division )
Dept ( dependent on the choice of division and center )
The department will decide what charge codes will appear on the form.
I have been building dynamic drop downs with if else statements, but I really think I need an array. I know they are going to change something and then I will have lots of changes to do. Updating an array sounds so much easier. Something like:
Division, Center, Dept, Costcode1, costcode2, costcode3
Can I do this? How do I do this. I saw a thread about inserting an array as a variable in the hierarchy, but I can't seem to find how. And then how do I reference it once its built
Thanks in advance.
Kurt
[email protected]For the United States, we use this:
http://www.usps.com/ncsc/addressinfo/citystate.htm -
Dynamic Drop-Down Menu Solution
Hi All,
After spending a lot of time trying to find a good solution for a dynamic drop-down menu, I end up writing my own.
The solution is for a list of items, having ITEM as the primary key of the table and ITEMDESCRIPTION as the list of options for the user to select.
The steps are:
1) JavaBean to return a ResultSet;
2) A custom tag to build a HTML SELECT;
3) A .tld file to declare the custom tag;
4) web.xml where the custom tag mapping resides;
4) A JSP to illustrate how to call the custom tag;
Hoping this will save lots of time to others
Cheers
Trajano Roberto
1) Custom tag
package com.amstras.maintenance.customtags;
* Title: erp
* Description:
* Copyright: Copyright (c) 2001
* Company: amstras
* @author Trajano Roberto
* @version 1.0
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.sql.*;
import com.amstras.maintenance.javabeans.*;
public class listitemmaster extends TagSupport {
private itemmaster itemmaster = new itemmaster();
private ResultSet rs = null;
private String parametername = null;
public int doStartTag() throws JspException {
try {
itemmaster.connect();
rs = itemmaster.listitemmaster();
pageContext.getOut().print( "<select name = \"" + parametername + "\">" );
catch ( Exception e ) {
throw new JspTagException( e.getMessage() );
finally {
return EVAL_BODY_INCLUDE;
public int doAfterBody() throws JspException {
try {
if( rs.next() ) {
pageContext.getOut().print( "<option value = \"" + rs.getString( "ITEM" ) + "\">" + rs.getString( "ITEM" ) + "   " + rs.getString( "ITEMDESCRIPTION" ) + "</option>" );
return EVAL_BODY_AGAIN;
else {
pageContext.getOut().print( "</select>");
itemmaster.disconnect();
return SKIP_BODY;
catch ( Exception e ) {
throw new JspTagException( e.getMessage() );
public void setParametername( String sPARAMETERNAME ) {
parametername = sPARAMETERNAME;
2) JavaBeam where the method to return the ResultSet resides
public ResultSet listitemmaster() throws SQLException, Exception {
if( con != null ) {
try {
String sSQL = null;
sSQL = " SELECT ITEM, ITEMDESCRIPTION FROM ITEMMASTER ORDER BY ITEM ";
ps = con.prepareStatement( sSQL );
rs = ps.executeQuery();
catch( SQLException sqle ) {
error = "SQLException: list item master failed possible record does not exist. ";
error += sqle.toString();
throw new SQLException( error );
catch( Exception e ) {
error = "An exception occured while listing item master record. ";
error += e.toString();
throw new Exception( error );
finally {
return rs;
else {
error = "Exception: Connection to database was lost.";
throw new Exception( error );
3) extract from the .tld file where the custom tag is declared
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>itemmaster</short-name>
<description>item master</description>
<tag>
<name>viewitemmaster</name>
<tag-class>com.amstras.maintenance.customtags.viewitemmaster</tag-class>
<attribute>
<name>item</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<description>item</description>
</attribute>
</tag>
<tag>
<name>listitemmaster</name>
<tag-class>com.amstras.maintenance.customtags.listitemmaster</tag-class>
<attribute>
<name>parametername</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<description>parameter name</description>
</attribute>
</tag>
</taglib>
4) web.xml mapping for the custom tag
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>debugjsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>jspCompilerPlugin</param-name>
<param-value>com.borland.jbuilder.webserverglue.tomcat.jsp.JasperSunJavaCompiler</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>debugjsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>erp/maintenance/itemmaster</taglib-uri>
<taglib-location>/WEB-INF/itemmaster.tld</taglib-location>
</taglib>
</web-app>
5) JSP call to the custom tag
<%@ page errorPage="billofmaterialErrorPage.jsp" %>
<%@ taglib prefix = "im" uri = "erp/maintenance/itemmaster" %>
<html>
<head>
<title>CSI - ERP - add bill of material</title>
<link rel = "stylesheet" href = "/erp/erpstyle.css">
</head>
<body>
<h1>Add Bill of Material</h1>
<form action = "billofmaterialcontroller.jsp" method="post">
<table>
<tr>
<td align = "LEFT"><font color = blue>Parent Item:</font></td>
<td><im:listitemmaster parametername = "parameter1" /></td>
</tr>
<tr>
<td align = "LEFT"><font color = blue>Child Item:</font></td>
<td><im:listitemmaster parametername = "parameter2" /></td>
</tr>
<tr>
<td align = "LEFT"><font color = green>Qty Per:</font></td>
<td><input type = "text" name = "parameter3" size = "5" maxlength = "5" /></td>
</tr>
</table>
<p>
<input type="submit" name="submit" value="Add">
<input type="reset" value="Reset">
</p>
<input type = "hidden" name = "Action" value = "Add">
</form>
Click <a href = "billofmaterial.jsp">here</a> to go back.
</body>
</html>This is a very helpful execellent sample code.
However, If I'm using Model-View-Control approach, then what's the way of applying these codes
to each indivisual file? Say, I have 20 files and only 4 of the 20 need to be treated as they like
to have drop down menu in particular column(s)??? How could the custom tag be applied as the
controller tells the view to present these special treat? or it is not possible (I have to treat each
file, filtered by controller -- one by one as it encounters the special need)?
Thx, Tzae -
Cteate 2 Dynamic drop down list
Hi all
i want to create 2 dynamic drop down list using struts and hibernate
i want the first one to display countries name then if i select a country name the second drop down list will automatic display the country cities .
i'm using database here and my tables like that :-
country table
country_id number(3) pk
country_name varchar(50)
city table
city_id number(5) pk
country_id(3) fk references country(country_id)
city_name varchar(50)
thank you in advanceHi Omar,
I have solution for you
To populating or refreshing the lists you can use
two procedures:
One of them - generic, which can be used for all types of list
Another is specific which contain a SQL statement to retrieve the data for
particular list.
1. Specific procedure:
PROCEDURE GET_DEPARTMENT_LIST
IS
sql_stat VARCHAR2(32767);
ret_code NUMBER;
BEGIN
-- SQL Statement for Drop-down List
-- (must have two columns for label and value - both VARCHAR2)
sql_stat := ' SELECT DEPARTMENT_NAME,TO_CHAR(DEPT_ID)'
||' FROM SCHEMA.DEPARTMENT';
POPULATE_MY_LIST('BLOCK.DEPARTMENT_LIST',sql_stat,ret_code);
END;
2. Generic procedure:
PROCEDURE POPULATE_MY_LIST
(item_name VARCHAR2,
sql_stat VARCHAR2,
out_code OUT NUMBER)
IS
rg_id RECORDGROUP;
rg_name VARCHAR2(100);
ret_code NUMBER;
item_id ITEM;
BEGIN
item_id := FIND_ITEM(item_name);
IF ID_NULL(item_id) THEN
out_code := -1;
RETURN;
END IF;
--Creating Record Group with Unique Name
rg_name := 'RG_'||SUBSTR(item_name,INSTR(item_name,'.',1)+1,LENGTH(item_name));
--Checking Record Group Name for existance
rg_id := FIND_GROUP(rg_name);
--If Group does exist - delete it
IF NOT ID_NULL(rg_id) THEN
DELETE_GROUP(rg_id);
END IF;
--Creating Record Group
rg_id := CREATE_GROUP_FROM_QUERY(rg_name,sql_stat);
ret_code := POPULATE_GROUP(rg_id);
IF (ret_code <> 0) THEN
out_code := ret_code;
RETURN;
END IF;
POPULATE_LIST(item_name,rg_id);
IF NOT FORM_SUCCESS THEN
out_code := -2;
RETURN;
ELSE
out_code := 0;
END IF;
DELETE_GROUP(rg_id);
END;
Hope it help.
Dmitry -
How to create Dynamic Drop down list ?
Hi experts
I want to create a Dynamic Drop down list that should be an Editable,after editing that i need to save.
thanks,
vikram.c.Hello,
Please go through this link:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/linking%2bdrop-down%2blists
If useful reward.
Vasanth -
--urgent Can I use table data to create a dynamic drop down menu?
Hi,
I am asked to investigate the possibility of using APEX to create a table driven dynamic drop down menu? The deadline is tomorrow but I have spent quite a bit of time but still have not any clue. Can any one have such experience to point me a way to focus on?
Many thanks.
JenniferThanks you very much for the help Kevin.
Currently my company is using htp.p style to create web app and using the dynamic menu in a similar way as you explained. Now they want to move to Apex and still keep dynamic menu functionality. After reading your response and research I have done I think I can embed it into Apex application by creating the similar table and PL/SQL package and let Apex to call the PL/SQL package when the application is first called. However may I ask you a question about how to call such pl/sql procedure in Apex? .
The current application has the following URL, from which the procedure pkg_main.print_menu is called and html home page with dynamic menu is displayed.
Http://app server:1234/pls/applicationname/pkg_main.print_menu?p_new_window=N
BUT what about the Apex? The Apex URL format is like the following, where 11563 and 1 is application id and page number. Assume that 1 is home page, but HOW the procedure is called, from WHERE?
http://apex.oracle.com/pls/apex/f?p=11563:1:3397731373043366363
Jennifer -
Hi -
I have written a piece of code to dynamically include data in the drop down list after querying the data base. I can print the values using out.print().. but they do not show up in the drop down list. Below is the code -
Please lemme know the mistake i am committing. Thanks you!
<form name="browse" method = "POST">
<select name="uid">
<%
//out.write("before vec");
unit.setCid(user.getCid());
Vector unitNumbers = unit.getUnitNumbers();
ListIterator iter1 = unitNumbers.listIterator();
while ( iter1.hasNext() ){
Integer num = (Integer)iter1.next();
// out.print(num.intValue());
// out.print("Hellooooooooo");
%>
<options> <%= num.intValue() %>
<% }
%>
</select>
</form>The correct tag should be <option value="val">Val</option>, like this:
<form name="browse" method = "POST">
<select name="uid">
<%
unit.setCid(user.getCid());
Vector unitNumbers = unit.getUnitNumbers();
ListIterator iter1 = unitNumbers.listIterator();
while ( iter1.hasNext() )
Integer num = (Integer)iter1.next();
%>
<option value="<%= num.intValue() %>"><%= num.intValue() %></option>
<% } %>
</select>
</form> -
Dynamic Drop-Down list in a table row or subform
Hi,
I need to display multiple drop-down list elements dynamically. Each of these DDLs will have different values.
For example:
The table will have 2 columns (Student Name text field and Courses drop-down)
Row 1: Student 1 & Courses of Student1 in DDL
Row 2: Student 2 & Courses of Student2 in DDL
When I execute my app, both the drop-downs (i.e. for both the students) are displaying all the courses of all the students. I tried a lot with binding options..
$record.Students[].Courses[]
is refering to all elements of the node. If I use the index 0 for Students node, I am getting 1st element rows.. if I use 1, I am getting 2nd element rows,,,
But How can I set the binding so that Row 1 has only Student 1 courses and Row 2 has Student 2 courses?
IS THERE A WAY TO DYNAMICALLY SET THE BINDING USING JAVASCRIPT?
I tried with tables, subforms.. it is not working. It is working fine in plain web dynpro table but not in an interactive form. I am using NW 2004s SP11, Web Dynpro Java. LiveCycle Designer 7.1, Adobe Reader 7.09.
There are some other posts talking about similar issue.. I tried the solutions mentioned there as well, but nothing worked.
I would really appreciate if any one can provide a solution or pointer to my problem.
Thanks
RamHey. Uh, this probably isn't the answer you were looking for, but it sounds like you've got a problem with your database design there. Generally speaking, your tables shouldn't have multi-valued fields, in the relational model anyway (sql). Instead, you should look at adding a separate table like EMPLOYEE_HOBBIES. Then you have a foreign key using the employees primary key as the foreign key in the employee_hobbies table, see what I mean? I might have misunderstood your explanation though, I'm not sure.
Alternatively, you could just have hobbies as a big freeform varchar field, and don't bother to make people separate their hobbies into different fields (you'd have to abandon the drop-down listbox idea in this case). If there's no really important reason to make the distinction, then it's probably easier just to not do it. -
How to add a dynamic drop down list in RDLC reports in WPF
I have to Load an RDLC report in WPF application and need to include a drop down list in report.Based on the selection of drop down list different reports to be generated.I am using C# and WPF.
Eg: I have to list the details of employees in in RDLC report.There is a country drop down list, Based on the selection of country drop down list we need to display details of employees in the selected country.Looking good.
With rdlc I think you will have to use the windows report viewer control.
If this was SAP crystal reports there's a wpf report viewer.
I never actually tried that with rdlc and I suppose there is a small chance they turn out to be compatible.
If you have questions on rdlc specifically then you're probably better finding a forum specialises in that. Not sure where that would be but maybe in the sql server forums. It's a business intelligence thing and people who do the likes of ssis are
what you want really.
I do reporting myself but I think you'll find few others who do so here.
Good luck.
Hope that helps.
Recent Technet articles:
Property List Editing;
Dynamic XAML
Maybe you are looking for
-
phone4 logo show for 10 seconds, off for 10 seconds, will not come on, is fully charged
-
Delete Button Disabled in Outlook 2010 with Exchange 2013
I recently switched from a 3rd party mail software to Microsoft Exchange. I have had some users ask me why the Delete button is disabled. I didn't enable any special policy to cause this, and the Delete key on the keyboard will delete messages. Th
-
i purchase a movie with my ipad but i sold it and never synced it with itunes how do i get the movie back??!
-
RFC Sender to SOAP receiver through asynchronous communication
Hi all, I have a requirement where I need send data from SAP HR system(through RFC) to webservice asynchronously. For this I preferred RFC as a sender and SOAP as a receiver. Can anybody tell me whether it could be possible because I have gone thr
-
Aco implemenataion for shortest paths.
has anyone used ant colony optimization algorithm for finding shortest paths other than for the tsp? please i need some help and advice. thanks