Checkbox and database records
Hi,
I think what I'm trying to do should be relatively simple, but I just can't figure it out. I want a form that displays a list of labs (retrieved from the database) with a checkbox beside each lab. I would then check all checkboxes and for those that are checked I would pass those lab names to my report. I don't know how to set it up to have a dynamic number of checkboxes depending on the number of labs in the database. I also don't know how to set up the checkboxes to display the name of the lab (which would be a record from the database).
I hope someone can help me with this.
Thanks in advance.
Celine,
Here's one approach to what you are trying to build:
Create a datablock based on your database table.
Set the form to display multiple values(i.e.) tabular.
Add a check box item to the same datablock. Ensure the check box is a non database item.
This will display a check box against each row of the tabular view of the base table with as many checkboxes available as there are rows in the base table.
Do an execute_query in a when-new-form-instance and the tabular form will be populated with the data from the database table.
You can detect which record was selected by using the when-check-box-changed trigger.
You can use a PL/SQL table or record group to pass multiple values or a global variable(s) if the number of values is known.
Similar Messages
-
We have the following problem:
when using a DataField mapped on a field of a database table,
if the value of the table field is NIL, the content of the DataField is N/A.
Is it possible to set it to an empty string instead of N/A without controlling
explicitly every single DataField and every record in the database table?
Thanks
GiovanniHello envision3d and bregent, I thankyou very much !!!
"bregent" <[email protected]> wrote in
message
news:f0qkag$cmo$[email protected]..
> >if you know how many records you have:
>
>>SELECT TOP 10 *
>
> Good idea. Just do a select count first and subtract 5. -
Adobe Acrobat reader and Database Records
I used an article form Stefan Cameron titled Connecting a Form to a Database to make an PDF that I want to be able to use to read and modify a access database.<br /><br />I have made a form that is connected to an access database. I have add several linked fields a <<First, <Previous, Next> and Last>> buttons. The connection and the movement buttons all work in Adobe LiveCycle Designer 8.0 and Adobe Acrobat 8.0 pro.<br /><br />When I load the PDF on another computer and try to use Adobe Reader 8.0, it does not work. Did I do something wrong or is Adobe Reader is unable to import data.
I used an article form Stefan Cameron titled Connecting a Form to a Database to make an PDF that I want to be able to use to read and modify a access database.<br /><br />I have made a form that is connected to an access database. I have add several linked fields a <<First, <Previous, Next> and Last>> buttons. The connection and the movement buttons all work in Adobe LiveCycle Designer 8.0 and Adobe Acrobat 8.0 pro.<br /><br />When I load the PDF on another computer and try to use Adobe Reader 8.0, it does not work. Did I do something wrong or is Adobe Reader is unable to import data.
-
Deleting and updating records in a database table
dear all ,
i have created a databse table to which i have to update and delete records thru my program whixh i am unable to do so plz help me.Hi Sonu,
To delete and update the records in your database table, you can create a Function Group and all the necessary function modules for it. This will a good approach as this will separate the database interface logic and the business logic. You need to use the DELETE and UPDATE ABAP keywords to delete and update the records of the database tables. Have a look at the ABAP Keyword documentation for a complete details of the usage.
Have a look at the following link:
DELETE
http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3aef358411d1829f0000e829fbfe/frameset.htm
UPDATE
http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3aef358411d1829f0000e829fbfe/frameset.htm
Hope this will help.
Thanks,
Samantak. -
Problem with checkbox and drop down menu
I am using DW8 with PHP/MySQL.
I made a insertion form and a couple of the fields are
checkboxes and another is a drop down menu. Everything works fine,
however, when I create an update form and the recordset calls the
data it doesn't retain its values on those items.
For example, if I checked a box when inserting the record and
then call the data up for the update form, the box is not checked,
making the user believe it was never checked in the first place.
The same thing goes for the drop down menu. If I have 3
options in the menu and someone selects the third one, when the
update form is used it defaults to the first option automatically
instead of actually calling up the original value selected.The fact that two scripts do not work together does not mean
there is a bug in the RH script. It is simply that they were not
designed by their respective developers to work together. This
happens with multiple scripts in any html file.
Try creating a new project and then importing just this topic
into it. Does it still have the problem? -
How to realize Checkbox and Radio Buttons based on Attributes in JHeadstart
Hy@ all,
I try to redevelop the Summit Forms Demo in ADF.
The module "ORDER" contains, among other things, a checkbox and radio buttons based on database columns(VARCHAR2).
The column(checkbox) named PAYMENT_TYPE contains the values CASH and CREDIT and the column(radio button) called ORDER_FILLED contains the values Y and N.
After creating the business components, I set in JHeadstarts Application Definition the Display Type of these two attributes to checkBox and radio-horizontal.
I created a dymanic domain for the radio-horizontal and a static domain for the checkBox.
The radio-horizontal within the dymanic domain works nearly correct.
I set the Data Collection in this dynamic domain to the required Group and the Value and Meaning Attribute to the necessary Attribute.
Within the JSF- Page the values are shown right but unfortunately there are too many radio buttons available. Instead of displaying the two radio buttons CASH and CREDIT were many CASH and CREDIT radio buttons shown.
I can´t find any solution for this case.
The problem with the checkBox is that therfore a static domain is required but I want to show the value of the checkBox based on the described attribute, like the handling of the radio horizontal.
But I don´t know how to implement this, if it is possible.
I´m using JHeadstart v10.1.3.2 and I´m pleased about any reply or solution.
Best regards
ChrisChris,
If you run the application module tester, and query the view object usage underlying your dynamic domain, how many rows does it return? It should return only two rows, one for CASH and one for CREDIT. If more than two rows are returned, your query is wrong.
What is the problem with using a static domain for the checkbox?
Steven Davelaar,
JHeadstart Team. -
Saving database records in a flat file
I am trying to save data from relational database into a flat file and then read back records based on the certain criteria.
What will be a good approach for me? Should I use random access files or sequential files for storing and
retrieving data or is there some other technique that is more efficient that I can use.
ThanksI don't think that reading database records from a flat file based on certain criteria is a good approach, no matter how you produce the flat file. Using a second database table makes more sense to me, especially since you already have database software available and ready for use.
(You asked about a "good approach" and then you wanted a technique that was "more efficient". Those two aren't the same thing at all.) -
I have a ton of documents and databases in AppleWorks v 6.0 that I can no longer open on my MacBook Pro. Is there any way to recover this info? Some documents can be opened and resaved with textedit, but not my database with all important addresses.
I tried Peggy's List > Select All > Copy > Paste into an AW spreadsheet suggestion.
In my case, pasting into the spreadsheet lost all text formatting (mostly text set to bold). The results of formulas were pasted, and checkboxes were pasted as "on" or "off". The DB did not contain any pop-up menus or radio buttons, but I expect they would transfer as a number showing the list position of the chosen item.
Pasting the copied List view data into a Numbers table gave a result similar to that with AppleWorks. I selected B2 as the target cell (for top left cell of the pasted data) to avoid any effects of posting into a header row or column. Bold and regular text formatting looked the same as it had in AW's List view.
Based on that, I'd slip the 'paste into an AppleWorks Spreadsheet step, and paste directly into a Numbers Table.
Regards,
Barry -
How to output database record in .doc format?
Good day to all of you! I want to output the database records to a formatted .doc document.For example,
Here are the db records:
firstname mid lastname age
ryan g gomez 23
shiela m vanilla 21
and the created document will be a .doc file, which will be formatted with image etc...
+"File for the first record let's say RyanGomez.doc"+
h4. Company Logo || Company Name
h4. -------------------------------------------------------------------------------------------------------
First Name: Ryan Middle Intial:G Last Name:Gomez
+"and a separate file for the second format.. and so on...til all the records are created"+
h4. Company Logo || Company Name
h4. -------------------------------------------------------------------------------------------------------
First Name:Shiela Middle Intial:A Lastname:Vanilla
I know that I need Bufferedwriter/reader or printwriter but I'm having a problem on how to format or edit the output ...any help regarding this?
I have tried using iText but I think it can only output pdf file...I need a doc output file.try {
// Create a statement
Statement stmt = connection.createStatement();
// Prepare a statement to insert a record
String sql = "DELETE FROM my_table WHERE col_string='a string'";
// Execute the delete statement
int deleteCount = stmt.executeUpdate(sql);
// deleteCount contains the number of deleted rows
// Use a prepared statement to delete
// Prepare a statement to delete a record
sql = "DELETE FROM my_table WHERE col_string=?";
PreparedStatement pstmt = connection.prepareStatement(sql);
// Set the value
pstmt.setString(1, "a string");
deleteCount = pstmt.executeUpdate();
System.err.println(e.getMessage()); -
Previous and next records in a table
Let's say I have a table where I have
item name sequence customer number
I want to select these three fields where name = 'INSPECTION', but I'd also like to grab the record prior to this and the record after this, regardless of the name content. I need to do it for each customer number.
Is it possible for a novice like me to do?
Thank youWhat is "next record" and "previous record" for you in this context? A database table doesn't have records in any specific order. They have an arbitrary order.
If for you, the records have the sequence as an ordering information, then you could use LAG and LEAD functions. -
Report with checkbox and collection
Hi all
I need to manage an interactive report to filtering and selecting rows by checkboxes and then use a collection to manage the selected records.
I used a first collection to create the source record set by a On-Load Before-Header Process:
DECLARE
v_id NUMBER;
var1 Varchar2(8);
var2 Varchar2(10);
var3 VARCHAR2(50);
var4 VARCHAR2(10);
var5 VARCHAR2(100);
var6 VARCHAR2(5);
cursor c_Populate is
SELECT
dep.chassis_code AS chassis_code,
dep.model_code AS model_code,
m.model_description AS model_description,
dep.acc_doc_number AS acc_doc_number,
dest.description AS destination_descr,
(trunc(sysdate) - dep.entry_date) Anzianita
FROM deposit_chassis dep, warehouses w, warehouse_map map, models m, site s,
destinations dest, T_SUB_DESTIN_DEALERS sdd
WHERE
dep.status = 5 AND
w.ware_code = map.ware_code AND
dep.DEALER_CODE = sdd.DELIVERY_POINT AND
dep.DESTINATION_CODE = sdd.DESTINATION_CODE AND
map.map_code = dep.map_code AND
m.model_code = dep.model_code AND
DEP.UNLOADING_SITE = S.SITE_CODE AND
DEP.destination_code = dest.destination_code And
dep.unloading_site = 'S0000074' and w.site_code = 'S0000074';
i NUMBER;
BEGIN
APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(p_collection_name => 'MY_COLLECTION');
OPEN c_Populate;
LOOP
FETCH c_Populate into var1, var2, var3, var4, var5, var6;
EXIT WHEN c_Populate%NOTFOUND;
APEX_COLLECTION.ADD_MEMBER(
p_collection_name => 'MY_COLLECTION',
p_c001 => var1,
p_c002 => var2,
p_c003 => var3,
p_c004 => var4,
p_c005 => var5,
p_c006 => var6);
END LOOP;
CLOSE c_Populate;
END;
Then I created a region for a SQL report:
SELECT
APEX_ITEM.CHECKBOX(1,c001) Chk,
apex_item.text(2, c001) Telaio,
apex_item.text(3, c002) ModelCode,
apex_item.text(4, c003) Model,
apex_item.text(5, c004) Doc_Number,
apex_item.text(6, c005) Destination,
apex_item.text(7, c006) Age
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = 'MY_COLLECTION';
Then, with a submit button and the relative process (below), I need to load a new collection for further elaboration.
How can I obtain the single values for each field of my selected row (see MY_COLLECTION) ?
APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(p_collection_name => 'COL_AVAILABLE_CHASSIS');
FOR i IN 1..APEX_APPLICATION.G_F01.Count
LOOP
APEX_COLLECTION.ADD_MEMBER(
p_collection_name => 'COL_AVAILABLE_CHASSIS',
p_c001 => I need the Telaio
p_c002 => I need the ModelCode
p_c003 => I need the Model
p_c004 => I need the Doc_Number
p_c005 => I need the Destination
p_c006 => I need the Age
END LOOP;
Thanks in advance,
MassimoDear Jari
I've looked at your sample.
Yes it seems ok for my apps
So, i've done the following update to my code:
Souce Report
SELECT
APEX_ITEM.CHECKBOX(3,c001) Chk,
APEX_ITEM.TEXT(4,c001) Telaio,
APEX_ITEM.TEXT(5,c002) ModelCode,
APEX_ITEM.TEXT(6,c003) Model,
APEX_ITEM.TEXT(7,c004) Doc_Number,
APEX_ITEM.TEXT(8,c005) Destination,
APEX_ITEM.TEXT(9,c006) Anzianita
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = 'MY_COLLECTION'
The Submit Process
DECLARE
l_row NUMBER := 1;
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F03.COUNT
LOOP
FOR j IN l_row..APEX_APPLICATION.G_F04.COUNT
LOOP
IF APEX_APPLICATION.G_F04(j) = APEX_APPLICATION.G_F03(i) THEN
-- ONLY FOR TEST PURPOSE --
htp.p('Telaio: '||APEX_APPLICATION.G_F03(i));
htp.p('Campo: ' ||APEX_APPLICATION.G_F04(j));
htp.p('Campo: ' ||APEX_APPLICATION.G_F05(j));
htp.p('Campo: ' ||APEX_APPLICATION.G_F06(j));
htp.p('Campo: ' ||APEX_APPLICATION.G_F07(j));
htp.p('Campo: ' ||APEX_APPLICATION.G_F08(j));
htp.p('Campo: ' ||APEX_APPLICATION.G_F09(j));
l_row := j + 1;
EXIT;
END IF;
END LOOP;
END LOOP;
COMMIT;
END;
Is it correct to manage G_F0x like my code ?
Thanks,
Massimo -
Convert the Database records to a standard XML file format?
Hai,
i want to convert the Database records to a standard XML file
format which includes the schema name, table name, field name
and field value. i am using Oracle 8.1.7. Is there any option
please help me
Thanks in advance.You could put the files somewhere and I can export them as QuickTime. Or you could find anyone you know who has Director. Or do the 30 day trial download
Another approach would be to play the DCR in a browser window, and do a screen recording. But that’s unlikely to give the perfect frame rate that you would get by exporting from Director. -
Trouble with ASP and databases
Hi,
I am trying to create a form in Dreamweaver 8 so my customers
can enter their information and save it to a sql server database. I
am able to set up the connection to the database using ASP VB. I
can create the fields and which records it will update, but as soon
as I save it, I no longer have access to the database. I can't even
add a new one. In the database window the plus sign is greyed out.
It tells me "To preview pages containing server-side code, you need
a testing server. Would you like to specify one now?" The page is
located under the correct site. I can upload it but when I punch in
the info, it gives me a page not found.
Everything works fine until I save the file.
Plese help!Right now I have it set up so it points to the same server.
Here are my settings:
Under the advanced tab-
Remote Info:
Access = FTP
FTP Host = xxxxxx
Host directory = xxxxxxx
Login = xxxxxx
Password = xxxxxx
Testing Server
Server Model = ASP VBScript
Access = FTP
FTP host = xxxxxx
host directory = xxxxxxx
Login = xxxxx
Password = xxxxxx
On both accounts the ftp host and the host directory are the
same.
I don't receive any errors when I finish. Alos everything
tests correctly to the server. -
Using Java Bean in JSP to show database record
I have links in my Tomcat container that if someone clicks on a specific link it should go to a Record page (Show.jsp) with all the values associated with a record from a database.
For example if someone clicks on a specific link like this:
LinkExample
it would take you to a jsp with database info for someone named Jones and show you his info:
Lastname = Jones
Firstname = Mike
City = San Diego
I would like to do this using a Java helper class and bean so I dont have any database connection or Java code in my JSP.
I created Java class file that has Database connection that works with a Java bean. I just dont know how to get the Show.jsp to work with the Java Bean and Java helper class file.
Here is what I have for Show.jsp and this is the part I have been working on the longest but cant get it to work because it doesnt seem to work with the database:<jsp:useBean id="user" class="num.UserDB"/>
//do I call getUser(lastname) here and if so how?
<jsp:setProperty name="user" property="*"/>
Last Name: <jsp:getProperty name="user" property="lastname"/><BR>
First Name: <jsp:getProperty name="user" property="firstname"/><BR>
City: <jsp:getProperty name="user" property="city"/><BR>My Java Helper class that compiles and connects to database:
package num;
import java.io.*;
import java.sql.*;
import java.util.*;
import num.User;
public class UserDB
public User getUser(String lastname)
User user = new User();
try
Class.forName...//database connection stuff here
ResultSet results = stmt.executeQuery("SELECT * from user where lastname = '" + lastname + "'");
if(results.next() == true)
results.next();
user.setLastname(results.getString("lastname"));
user.setFirstname(results.getString("firstname"));
user.setFirstname(results.getString("city"));
catch(Exception e)
System.out.println("Exception...");
return user;
}My Java Bean that compiles here:
package num;
public class User
private String firstname;
private String lastname;
private String city;
public User()
//no arg constructor
public User(String firstname, String lastname, String city)
this.lastname = lastname;
this.firstname = firstname;
this.city = city;
public String getLastname()
return lastname;
public void setLastname(String lastname)
this.lastname = lastname;
//more bean methods for all fields here
Sorry if I wasnt specific enough. I have a link that passes a value (field that is passed is called lastname) to a JSP where I want to show record info for that value that is passed.
My question is how do I show the database record info on Show.jsp for the lastname field value of Jones where I want to use a Java Bean and Database helper class in Show.jsp
Here is the message I get when I hit the link (LinkExample) and it goes to Show.jsp:
org.apache.jasper.JasperException: Cannot find any information on property 'lastname' in a bean of type 'num.UserDB'
.....My UserDB class:
public class UserDB
public User getUser(String lastname)
User user = new User();
try
Class.forName("org.gjt.mm.mysql.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/dbconnone?user=smitherson&password=abcdefg");
Statement stmt = conn.createStatement();
ResultSet results = stmt.executeQuery("SELECT * from user where lastname = '" + lastname + "'");
if(results.next() == true)
results.next();
user.setLastname(results.getString("lastname"));
user.setFirstname(results.getString("firstname"));
user.city(results.getString("city"));
catch(Exception e)
System.out.println("Exception..." + e);
return user;
}Bean class:
package num;
public class User
private String firstname;
private String lastname;
private String city;
public User()
//no arg constructor
public User(String firstname, String lastname, Sting city)
this.firstname = firstname;
this.lastname = lastname;
this.city = city;
public String getFirstname()
return firstname;
public void setFirstname(String firstname)
this.firstname = firstname;
public String getLastname()
return lastname;
public void setLastname(String lastname)
this.lastname = lastname;
public String getCity()
return city;
public void setCity(String city)
this.city = city;
-
How to delete a database record by using EJB entity beans
Hi, All,
Does anyone know how to use entity bean to delete a database record? I have all the EJB entity beans created, including access beans to each. I can successfully create records, find and update records, however, I haven't find a way to delete records yet.
Your response is appreciated.
CathyPlease see EJB Forums for continue discussion on this subject.
Reference titile: "how to delete database record by using CMP entity beans "
Maybe you are looking for
-
Firefox no longer works with Forums?
Yesterday (Thursday, March 23), my Firefox stopped working with Forums. Now get the following: 404 Not Found Resource /forums/usersettings!default.jspa not found on this server
-
What size external hard drive do i need to backup my macbook pro?
I know I need to backup my computer, especially since I have been experiencing some problems with it and will need to take it into a store to get looked at, but I do not know what size external hard drive I need to back my computer on.
-
LabVIEW Applicatio​n throws Error in Run VI Invoke node
Hi All, We are facing an issue with an application developed from LabVIEW 2010SP1. Application Description: In our application, there is a top level VI which tries to run VIs dynamically[using Run VI invoke node] from a particular folder. This folder
-
How will come back 5th list to 3rd list in interactive reporting
hi all, which of this code is correct to comeback 5th to 3rd list at user-command. case sy-ucomm. when 'back'. if sy-lsind = 5. sy-lsind = 3. endif. endcase. or at user-command. case sy-ucomm. when 'back'. if sy-lsind = 5. sy-lsind = 2. endif. endcas
-
Thermal issues with PowerMac G5 Dual 2.0 Processor
I've been having issues with my fans running super loud for no apparent reason. I have been told that my thermal meter for one of my processors has gone bad and that I have to replace both my processors at a cost of over $800! I am simply wondering i