Parent child in dynamic drop down
Hi
I have a problem where I have data in a table like parent, n number of children, and again these children have children etc. like a tree structure. First i need to get the parent and show to the user, in a combo box on JSP, once he selects the parent, i need to get all the child recrods and show them in another combo below the parent. If he chooses a child, I need to get all the childern under that and show in another combo below the parent (more or less like Country-State-City combos) but the data is not restricted to any level.
How can i do this. Please help me.
One set of relationship is easy, but after that it becomes quite messy and I would advise to redesign your code...
For one set of relationship..... some sample algo...
<!--HTML for parent. I have left out cpde to keep the previous option slected -->
<select name="parent" onchange="javascript:submit()">
<option value=1>First</option>
</select>
int ch = 0;
<% //Some java code
String opt = request.getParameter("parent");
if(opt != null)
ch = Integer.parseInt(opt);
%>
<select name="child">
<% switch(ch){
case 1:%><option value="1">First child</option>
<% break;
case 2:..............
%>
</select>
I have hardcoded everything but this should be suff to give u the basic idea..
Similar Messages
-
Parent Child Relationships between Drop Down Menus
I have a request for additional functionality. Parent child relationships between drop down lists.
for example,
the first dropdown, could contain North, South, East, West & assign values of 1, 2, 3, 4.
the second dropdown, could contain a filtered set of data depending on the option from the first dropdown,
so the data could look like this in the second drop down:
Manchester 1
Leeds 1
London 2
Southampton 2
Norfolk 3
Newquay 4
so if I select North in the first dropdown, the second drop down would contain all the items with a value of 1, so Manchester & Leeds.
I have managed to get round this using conditional show & hide, but it is much messier on the design screen & also the way in which the data
will be returned is very very messy - seems like a simple addition which would improve the functionality no end.Hi,
We have an "ideas" page where you can see if others have added this already, I believe there are some similar, and you can add your vote. If you don't find something that fits you can add your idea here:
http://forums.adobe.com/community/formscentral?view=idea
Thanks,
Josh -
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 -
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 -
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.
Maybe you are looking for
-
Hangs iTunes unless using USB 1.1
I'd like to add my voice to the numerous problems on this forum with connecting and syncing the Shuffle with iTunes. While my Shuffle has been flaky as long as I can remember, it's pretty much unusable with iTunes 8. In those moments of bliss when I
-
Problem with registrati​on
hi... i have this kind of problem, my gsm card already activate for BIS (Blackberry Internet Service) when i put into the phone, already try to register device to network using Host Routing Table, but after register to network, i do not receive any n
-
How can I restrict the column dragging of JTable?
I have a requirement like, if we have any editable cell in the JTable, we should not allow the user to drag the columns at all. I tried with setDragEnabled(false) ..but its not giving the proper out put..... can any one come up with a solution for th
-
Dupilcate secondary IP's on 2 Hub servers for the Cas Array on VM ware 5.5
I was told today that MS had worked with this company before and they may have recommended the secondary ip on the nic's to be the exact same address. We are experiencing issues with ping by name and ip that are not working or inconsistent. Even afte
-
Help! boxes with A's in them are everywhere
Well, I decided to update my firmware and 10.4.7 on my 3 month old imac G5. All of the font everywhere has turned into a box with an "A" in it...menus, folder names, folder contents, everything. I have started in safe mode and have considered the arc