Multi step form with three tables
Hi:
I have a database with 3 tables. Table 1 has one-to-many
relationship with two others. Infact in table 1 user should enter
his basic info and details will be submited itno two other tables.
Is there any easy way to make it with DW/colfusion?
I know that session may help but it is needed that each page
can submit information (if the user doesn't fill the last form them
I may loose data with session)
I thought of sending information to other page with form
action="page.cfm" but my problem is I don't know how to submit
information in the second form that the primary key of table one
becoms the foreign key of the next page. Please please I really
need this. I really need it.
Thanks
Benign
Hi:
Thanks for the reply. In fcat I have to put them in different
pages because they have many many fields.
Is there any easy way to do it?
My project is about patients registration database. I am a
medical doctor and know some about coldfusion and some about SQL. I
am doing this project for the patient and free of charge and I can
not hire any professional programmer. My research center has boght
a Coldfusion Web server (Webserve.ca) and we are in hurry to
register the patients and organize their data to manage their
cancer problems or alarming them for future personal/familial
follow ups.(purchasing the host was a problem then {because of the
money shortage}but solved fortunately)
The cancer information tables are about 10 tables and a
parent table for patients general/personal information.
I tried to build it with coldfusion/dreamweaver wizards but I
have many problems. There is no coldfusion expert avaiable as I
said (as you know there is a shortage of money in research centers)
and the solution is something that the patients really need.
It will be great if some one helps me. Surely the name of the
this project savior (you are really a savior of many if you help)
will be a part of the prject.
Thanks
Benign
Similar Messages
-
How to build a form with multiple tables in oracle application express
Hi everyone,
I have got problem in building a form with multiple tables.I have a main table with (20) columns and this main table is related to the other tables with the primary key-foreign key relation ship.My requirement is i have to build a form which has fields from many tables and all the fields are related to the main table using (ID) column.In that form if i enter ID field i have to get information from differnt tables.
Please help me to solve this (building a form with mutiple tables)
Thank you
sansSans,
I am no Apex expert, but with a situation as "complex" as yours, have you thought about creating a VIEW that joins these 7/8 tables, placing an INSTEAD OF trigger on that view to do all the business logic in the database, and base your application on the view?
This is the "thick-database" approach that has been gaining momentum of late. The idea is to put your business logic in the database wherever possible, and let the application (Form, Apex, J2EE, whatever) concentrate on UI issues, -
Secure, multi-section form with administrative rights
I want to create a form that has sections we'll call "yes", "no", and "maybe". Only one section is visible at any time, and only someone with administrative rights can choose which section is visible. Once the section is chosen and the form saved, that section cannot be changed by anyone without admin rights. Can this be done in Acrobat?
The proposed use process would go something like this:
1. Admin receives order and pulls the form.
2. Admin clicks "yes", "no", or "maybe" (tab? radio button?) to reveal the applicable section.
3. Admin fills in some portions, saves the form, and passes it down the line.
4. Down the line, the form is opened and the rest of the form is filled. If "yes", "no" or "maybe" is clicked, nothing happens because this user has no admin rights.
5. The completed form is saved.
I know it would save a lot of effort to make three separate forms. The reason for the single, multi-section form is so the other two sections can be filled on a later date. This saves the effort of refilling the other parts of the form with same data, or changing same data on three separate forms. In addition, admin can open a filled form and click among the different sections to review each section off the one form.
Did that make sense? If so, can it be done in Acrobat?Please also tell me if what I have in mind can't be done so I can stop chasing this idea.
-
Hi All.
I have simple form with CheckBox and Table. I show table when CheckBox is True. My code:
form1.#subform[0].CheckBox1::change - (JavaScript, client)
if (CheckBox1.rawValue == true)
Table1.presence = "hidden";
else
Table1.presence = "visible";
But I would like to hide Table in case when user open form and then when CheckBox is True show table. In case when CheckBox is False the Table is hidden. How it to do? I will appreaciate for sample.
Thanks.Hi,
this is not so difficult. You have to do the following steps:
open a new form.
insert a checkbox and a table into the form.
mark the checkbox
open the script editor (about window)
select "click-event"
write:
if (CheckBox1.rawValue == 1)
Table1.presence = "hidden";
}else
Table1.presence = "visible";
And now you have to hide the table under "object" | "presence" | "hidden (exclude from layout)"
Ready.
Kind regards Mandy
PS: Oh I haven't seen that the problem is solved. -
Generic Extraction By Using function Module with Three Table fields?
Hi,
I need to bring the data from three tables by using function module.
Tables: VBAK, VBAP, VBUK.
Fields are: VBELN, ERDAT, NETWR, WEARK, POSNR, MATNR, FKART, FKTYP.
i referred some of the documents in SDN, it explained by using two table fields.
Please help me.hi, the below pseudo code should help you on creating the logic. It's based on the how to paper. So i just used the parts of intrest. You need to copy the rest form the document. Please notice that this is pseudo code. if you just copy/paste, it will not work.
IF s_counter_datapakid = 0.
OPEN CURSOR WITH HOLD s_cursor FOR
SELECT fields FROM table1 WHERE condition
ENDIF. "First data package ?
* Fetch records into interface table.
* named E_T_'Name of extract structure'.
FETCH NEXT CURSOR s_cursor
INTO TABLE e_t_data
PACKAGE SIZE s_s_if-maxsize.
IF sy-subrc EQ 0.
SELECT fields FROM table2 WHERE condition into itab2 for all entries in e_t_data
SELECT fields FROM table3 WHERE condition into itab3 for all entries in e_t_data
loop at e_t_data
read itab2. move corresponding fields to e_t_data
read itab3. move corresponding fields to e_t_data
collect e_t_data.
endif.
IF sy-subrc <> 0.
CLOSE CURSOR s_cursor.
RAISE no_more_data.
ENDIF.
s_counter_datapakid = s_counter_datapakid + 1.
ENDIF. "Initialization mode or data extraction ? -
Itextsharp using livecycle form with dynamic table
Hello all, after searching Google for the past two days and not able to find any relevant information, hence this post.
Some background:
1) Created a pdf form using Adobe Livecycle designer 9.
2) It is a dynamic form with textboxes and a table configured to repeat rows dynamically.
3) Testing form using xml data within designer works just fine.
Requirement:
Need to populate form dynamically using data from database.
Solution:
Found iTextSharp (free assembly) which assists with populating existing pdf form.
Issue
This assembly works without any issue when populating textfields (see sample code below). The problem I am facing is with the dynamic table where in I am not able to reference rows greater than 1. Since the pdf template contains a table with just one row referencing the first row using acrofield works.
I was under impression since this is a dynamic table with repeat enabled, in asp.net if I referenced row2 onwards the table would grow automatically. Which I have come to realize is not going to be possible.
So I am looking for ideas on how I can accomplish this. I wish this could have been a fixed row table then reference rows would have been easier. However in this situation the table has to be dynamic.
Any ideas thoughts would be appreciated.
Below is my sample code:
PdfStamper ps = null;
try {
// read existing PDF document
PdfReader r = new PdfReader(
// optimize memory usage
new RandomAccessFileOrArray(Request.MapPath("itext.pdf")), null
ps = new PdfStamper(r, Response.OutputStream);
// retrieve properties of PDF form w/AcroFields object
AcroFields af = ps.AcroFields;
// fill in PDF fields by parameter:
// 1. field name
// 2. text to insert
af.SetField("txtCompany", "Company name");
af.SetField("txtDateDepartLocation", "date depart location");
af.SetField("txtDate","test date");
af.SetField("txtServiceNumber", "Service number");
af.SetField("Table2.Row1.Cell1", "1test"); this works
//doesnt work!!!
af.SetField("Table2.Row2.Cell1", "1test");
af.SetField("Table2.Row3.Cell1", "1test");
// make resultant PDF read-only for end-user
ps.FormFlattening = true;
// forget to close() PdfStamper, you end up with
// a corrupted file!
ps.Close();
catch { }
finally { if (ps != null) ps.Close(); }Hi FourEyes;
Try using this.
Select Col1, Col2, Col3
into :P1_Field1, :P1_Field2, :P1_Field3
from Your_Table
Where (your conditions); -
Best way to link user form with user table
Hi all.
What is the best way to link an user form with a user table (with all of the functions, add, update...)? I have created a simple form, and the question is next:
depending the type object of the user table (document, master...) i have facilities to imlement the basic operations in the form? if i create an UDO i have the functions but i want to use the form that i created with a screen painter.
Thanks.Hi again i want add a new comment please.
If i want do all functions (add,update...) of my form in my user table, and i want my user table is a <b>type document</b>? how can add new lines in my user table with objet <b>type document</b>? because when i make the instance i nedd to say what type of document is (item,order...) and when i do an add(), not add() in my user table. In what moment or how can assign that the add,update functions... affect in my table?
Thanks again. -
Generate a report with three table
hi Friends,
i have three table
1-
CREATE TABLE "TRANSACTION_DETAILS"
( "S_NO" NUMBER,
"BILL_NO" NUMBER,
"BILL_DATE" DATE,
"PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
"ITEM_NAME" VARCHAR2(500),
"DESCRIPTION" VARCHAR2(4000),
"QTY" NUMBER,
"RATE" NUMBER,
"AMOUNT" NUMBER,
CONSTRAINT "TRANSACTION_DETAILS_CON" PRIMARY KEY ("S_NO") ENABLE
2-
CREATE TABLE "LAB_WORK_DTL"
( "ID" NUMBER,
"BILL_NO" NUMBER,
"BILL_DATE" DATE,
"PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
"WORK_DETAIL" VARCHAR2(4000),
"LABOUR_AMT" NUMBER,
CONSTRAINT "LAB_WORK_DTL_PK" PRIMARY KEY ("ID") ENABLE
3-
CREATE TABLE "JOB_CARD_DETAILS"
( "ID2" NUMBER,
"BILL_NO" NUMBER,
"BILL_DATE" DATE,
"PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
"AMOUNT" NUMBER,
CONSTRAINT "JOB_CARD_DETAILS_CON" PRIMARY KEY ("ID2") ENABLE
i want to generate a Report of total amout of bill No Like
BILL_NO,BILL_DATE,VEHICLE_NO,SUM(AMOUNT) ,SUM(LABOUR_AMT),SUM(AMOUNT)
I AM USING
select a.BILL_NO,a.BILL_DATE,a.PARTY_NAME,a.VEHICLE_NO,SUM(a.AMOUNT),SUM(b.LABOUR_AMT),SUM(c.AMOUNT) from TRANSACTION_DETAILS a,LAB_WORK_DTL b,JOB_CARD_DETAILS c where a.PARTY_NAME =b.PARTY_NAME and a.PARTY_NAME=c.PARTY_NAME and a.PARTY_NAME =:P38_PARTY_NAME group by a.bill_no,a.BILL_DATE,a.PARTY_NAME,a.VEHICLE_NO,b.bill_no,b.BILL_DATE,b.PARTY_NAME,b.VEHICLE_NO,c.bill_no,c.BILL_DATE,c.PARTY_NAME,c.VEHICLE_NO
ACCORDING TO THIS CODE sum of these column SUM(a.AMOUNT),SUM(b.LABOUR_AMT),SUM(c.AMOUNT) are not correct and there are one more problem if BILL_NO is not in LAB_WORK_DTL JOB_CARD_DETAILS these table then result shows NO DATA FOUND but BILL_NO is avalable in
TRANSACTION_DETAILS this table.
How can i generate this report .
Thanks
Manoj Kaushik1-
CREATE TABLE "TRANSACTION_DETAILS"
( "S_NO" NUMBER,
"BILL_NO" NUMBER,
"BILL_DATE" DATE,
"PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
"ITEM_NAME" VARCHAR2(500),
"DESCRIPTION" VARCHAR2(4000),
"QTY" NUMBER,
"RATE" NUMBER,
"AMOUNT" NUMBER,
CONSTRAINT "TRANSACTION_DETAILS_CON" PRIMARY KEY ("S_NO") ENABLE
2-
CREATE TABLE "LAB_WORK_DTL"
( "ID" NUMBER,
"BILL_NO" NUMBER,
"BILL_DATE" DATE,
"PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
"WORK_DETAIL" VARCHAR2(4000),
"LABOUR_AMT" NUMBER,
CONSTRAINT "LAB_WORK_DTL_PK" PRIMARY KEY ("ID") ENABLE
3-
CREATE TABLE "JOB_CARD_DETAILS"
( "ID2" NUMBER,
"BILL_NO" NUMBER,
"BILL_DATE" DATE,
"PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
"AMOUNT" NUMBER,
CONSTRAINT "JOB_CARD_DETAILS_CON" PRIMARY KEY ("ID2") ENABLE
/Can you define the relation between these three tables. I see in your sql you are joining the three table with the column PARTY_NAME. Is that the proper joining condition? Can you explain that.
And also when you say this
ACCORDING TO THIS CODE sum of these column SUM(a.AMOUNT),SUM(b.LABOUR_AMT),SUM(c.AMOUNT) are not correct What exactly do you mean. What is not correct? Can you show some sample data.
And also it would be of great help to all the people here if you format your SQL and use {noformat}{noformat} tag to preserve the format of your code. -
Step number indicator bar for a multi-step form
I have a form with 3 steps. I have created each step in a separate tab, and there is a 4th tab which gives summary of all the data from the first 3 steps. I want to create something like a progress bar which will be placed on each page and indicate the step no. that the user is on. All the other steps will be faded, and only the current one will be highlighted.
Here's an example of something similar:
http://confluence.sakaiproject.org/confluence/download/attachments/32823/emusic.png
Can someone help me with the javascript/html code? Any suggestions/ideas are welcome.
ThanksGMT,
I've seen some discussions on this forum in the past about a feature like this and also one solution which I can't find. Perhaps you could get creative with the breadcrumb feature if you don't find a solution similar to what you're trying to arrive at.
You could also create a graphic for each 'step' and display that in the HTML header in each page.
Keep Smiling,
Bob R -
A search form with three search criterias
I want to create a search form in Apex with three text boxes that would let us search with a lastName,firstName or a course Name. So i would have three text box regions where the user can enter any one of the search criterias and get a results
the sql query that does the join is as
select Student.Student_id,
Student.First_NAME,
Student.LAST_NAME,
Student.Email1 as Primaryemail,
Student.Email2 as SecondaryEmail,
Student.Phone1 as MobileNumber,
Student.Phone2 as HomeNumber,
Address.Street1 as Street ,
Address.City as City,
Address.State as State,
Address.ZIP as Zip,
Course.PROVIDER_COURSE_ID as CourseID,
Course.Course_Name as Course,
Course.Credit_Hours as Credit_Hours,
INSTITUTION.Name as InstName
from Student Inner join Address on Student.ADDR_ID = Address.ID
Inner Join Institution on Student.INST_ID = Institution.ID
Inner join Course on Course.INST_ID = Institution.IDand i want to incorporate my query into pl/sql example as below which is provide in apex examples as below where it searches for assignee and status. any ideas guys how i can do this or if there is simpler way to do this where the user can have three text boxes and search with their names or course name etc.
declare
c pls_integer := 0;
l_detail varchar2(4000);
i pls_integer;
l pls_integer;
l_max_rows integer;
begin
l_max_rows := nvl(:P2_ROWS,10);
if :P2_SEARCH is null
and :P2_ASSIGNEE is null
and :P2_STATUS is null then
sys.htp.p('<p>'||
apex_escape.html('Please enter at least one search condition.')||
'</p>');
else
-- PUT YOUR QUERY HERE
for c1 in (
select id, project, task_name, start_date, end_date, status, assigned_to,
cost, budget
from EBA_DEMO_SEARCH_PROJECTS
where ( instr(upper(assigned_to),upper(:P2_ASSIGNEE)) > 0
or :P2_ASSIGNEE is null)
and ( instr(upper(status),upper(:P2_STATUS)) > 0
or :P2_STATUS is null)
and ( instr(upper(project),upper(:P2_SEARCH)) > 0
or instr(upper(task_name),upper(:P2_SEARCH)) > 0
or instr(upper(status),upper(:P2_SEARCH)) > 0
or instr(upper(assigned_to),upper(:P2_SEARCH)) > 0
or :P2_SEARCH is null
loop
c := c + 1;
if c = 1 then
sys.htp.p('<ul class="sSearchResultsReport">');
end if;
sys.htp.p('<li>');
sys.htp.prn('<span class="title">');
-- DEFINE DRILL DOWN LINK HERE
sys.htp.prn('<a href="'
||apex_util.prepare_url('f?p='||:APP_ID||':3:'||:APP_SESSION||
':::3:P3_ID:'||c1.id)||'">');
-- ASSIGN PRIMAY ATTRIBUTE HERE, REFERENCE QUERY COLUMN
l_detail := c1.project;
i := instr(upper(l_detail),upper(:P2_SEARCH));
if i > 0 then
l := length(:P2_SEARCH);
l_detail := apex_escape.html(substr(l_detail,1,i-1))||
'<span class="highlight">'||
apex_escape.html(substr(l_detail,i,l))||'</span>'||
apex_escape.html(substr(l_detail,i+l));
end if;
sys.htp.prn(l_detail);
sys.htp.prn('</a></span>');
sys.htp.prn('<span class="description">');
-- ASSIGN SECONDARY ATTRIBUTE HERE, REFERENCE QUERY COLUMN
l_detail := c1.task_name;
i := instr(upper(l_detail),upper(:P2_SEARCH));
if i > 0 then
l := length(:P2_SEARCH);
l_detail := apex_escape.html(substr(l_detail,1,i-1))||
'<span class="highlight">'||
apex_escape.html(substr(l_detail,i,l))||'</span>'||
apex_escape.html(substr(l_detail,i+l));
end if;
sys.htp.prn(l_detail);
sys.htp.prn('</span>');
-- DEFINE ADDITIONAL QUERY COLUMNS FOR SEARCH BELOW
sys.htp.p('<span class="type">');
sys.htp.prn('Assigned to: ');
sys.htp.prn(apex_escape.html(c1.assigned_to));
sys.htp.prn('</span>');
-- display additional column detail
sys.htp.p('<br /><span class="type">');
sys.htp.prn('Status: ');
sys.htp.prn(apex_escape.html(c1.status));
sys.htp.prn('</span>');
sys.htp.prn('</li>');
if c = l_max_rows then
exit;
end if;
end loop;
if c > 0 then
sys.htp.p('</ul>');
sys.htp.p('<p>'||c||' results found.</p>');
else
sys.htp.p('<p>No data found matching your search criteria.</p>');
end if;
end if;
end;i tried to change the pl/sql to incorporate it into my apex application but i consistently get an error as pl/sql not defined.
any help or a slight hint is very much appreciated
thanks for looking and taking the time to read it through if u made it this far or even if u made it half wayThanks that worked and i got the procedure inside apex as well now i have to figure out how to make the search condition so that it will look for a like condition as well so the user can enter sam for samuel and still find the users
declare
c pls_integer := 0;
l_detail varchar2(32767);
i pls_integer;
l pls_integer;
l_max_rows integer;
begin
l_max_rows := nvl(:P37_ROWS,10);
if :P37_SEARCH is null
and :P37_FirstName is null
and :P37_LastName is null
and :P37_Course_Name is null
then
sys.htp.p('<p>Please enter at least one search condition.</p>');
else
for c1 in (
select
/* SIMULATE A UNIQUE COLUMN */
Student.Student_id || ',' || Course.Course_id as FAKE_PK,
Student.Student_id ,
Student.First_NAME as FirstName,
Student.LAST_NAME as LastName,
Student.Email1 as Primaryemail,
Student.Email2 as SecondaryEmail,
Student.Phone1 as MobileNumber,
Student.Phone2 as HomeNumber,
Address.Street1 as Street ,
Address.City as City,
Address.State as State,
Address.ZIP as Zip,
Course.PROVIDER_COURSE_ID as CourseID,
Course.Course_Name as Course_Name,
Course.Credit_Hours as Credit_Hours,
INSTITUTION.Name as InstName
from Student left join Address on Student.ADDR_ID = Address.ID
left Join Institution on Student.INST_ID = Institution.ID
left join Course on Course.INST_ID = Institution.ID
where ( instr(upper(First_Name),upper(:P37_FirstName)) > 0
or :P37_FirstName is null)
and
(instr(upper(Last_Name),upper(:P37_LastName)) > 0
or :P37_LastName is null)
and
(instr(upper(Course_Name),upper(:P37_Course)) > 0
or :P37_Course is null)
and (
instr(upper(First_Name),upper(:P37_SEARCH)) > 0
or instr(upper(Last_Name),upper(:P37_SEARCH)) > 0
or instr(upper(Course_Name),upper(:P37_SEARCH)) > 0
or :P37_SEARCH is null
order by Course_Name desc
loop
c := c + 1;
if c = 1 then
sys.htp.p('<ul class="sSearchResultsReport">');
end if;
sys.htp.p('<li>');
l_detail := c1.Course_Name;
i := instr(upper(l_detail),upper(:P37_SEARCH));
if i > 0 then
l := length(:P37_SEARCH);
l_detail := apex_escape.html(substr(l_detail,1,i-1))||
'<span class="highlight">'||
apex_escape.html(substr(l_detail,i,l))||'</span>'||
apex_escape.html(substr(l_detail,i+l));
end if;
sys.htp.prn(l_detail);
sys.htp.prn('</a></span>');
sys.htp.prn('<span class="description">');
l_detail := c1.FirstName;
i := instr(upper(l_detail),upper(:P37_SEARCH));
if i > 0 then
l := length(:P37_SEARCH);
l_detail := apex_escape.html(substr(l_detail,1,i-1))||
'<span class="highlight">'||
apex_escape.html(substr(l_detail,i,l))||'</span>'||
apex_escape.html(substr(l_detail,i+l));
end if;
sys.htp.prn(l_detail);
sys.htp.prn('</span>');
sys.htp.prn('<span class="type">Incident: ');
sys.htp.prn(apex_escape.html(c1.FirstName));
sys.htp.prn('</span>');
sys.htp.p('</li>');
if c = l_max_rows then
exit;
end if;
end loop;
if c > 0 then
sys.htp.p('</ul>');
sys.htp.p('<p>'||c||' results found.</p>');
else
sys.htp.p('<p>No search results.</p>');
end if;
end if;
end; Edited by: user13133295 on Jun 4, 2013 1:59 PM -
Creating a form with variable table name(s)
Hi,
I am building a form that will allow user(s) switch to other user
(s) dynamically. I have been able able to do this by creating a
non-database table and use record group to read from the base
table of each user.(All the tables in question have the same
structure).
Record group is a read only, and I want to be able to do data
maninpulation with this form.
The questions are
(1) It possible to do data manipulation with record group and if
it is, how?
(2) Is it possible to build a form with a variable table name?
if possible, how?
Somebody pls help.
Thanks,
Olutunde.
nullOlutunde Babarinsa (guest) wrote:
: Hi,
: I am building a form that will allow user(s) switch to other
user
: (s) dynamically. I have been able able to do this by creating a
: non-database table and use record group to read from the base
: table of each user.(All the tables in question have the same
: structure).
: Record group is a read only, and I want to be able to do data
: maninpulation with this form.
: The questions are
: (1) It possible to do data manipulation with record group and
if
: it is, how?
: (2) Is it possible to build a form with a variable table name?
: if possible, how?
: Somebody pls help.
: Thanks,
: Olutunde.
Hi,
you can create and manipulate record groups at runtime(see Forms
Reference 'Create_Group' and 'Add_Group_Row') don't use
Create_Group_from_Query. For your purpose it's better to build a
cursor loop on your Query and add your datas after
manipulating with 'Add_Group_Row' to your Record Group.
It's possible to SET_BLOCK_PROPERTY(QUERY_DATA_SOURCE_NAME) but
it's not possible to change the item property 'Column Name'.
Therefor I would suggest to build a non database block and
populate these block by a programm unit, which works with a
pl/sql cursor loop and the 'create record' to populate these
block.
null -
Newbie: How to handle a multi-step dialogue with no session?
I can't see how to handle the following trivial problem:
1. The user clicks on a button to retrieve values from the database
2. The values returned are displayed in a table on the same page
3. The user clicks a button next to the desired element
4. Some action is performed
I can achieve steps 1, 2, 3 but fail on step 4: the action is not called.
One prerequisite is that I don't want to store anything in the session or application scope.
In the example that follows, when you click on "Show Element" the action is not performed.
This is myExample.jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<HEAD>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Test</TITLE>
</HEAD>
<f:view>
<BODY>
<h:form>
<h:commandButton action="#{myExample.doSearch}" value="Search Database" />
<p/>
<h:dataTable value="#{myExample.elements}" var="elem" binding="#{myExample.dataTable}">
<h:column>
<h:outputText value="#{elem}"/>
</h:column>
<h:column>
<h:commandButton type="submit" value="Show Element" action="#{myExample.doShowElement}"/>
</h:column>
</h:dataTable>
</h:form>
</BODY>
</f:view>
</HTML>This is myExample.java:
package example;
import javax.faces.component.html.HtmlDataTable;
public class MyExample {
private HtmlDataTable dataTable;
private String[] elements;
public MyExample() {
private String[] readFromDatabase() {
return new String[] {"one", "two", "three"};
public String[] getElements() {
return elements;
public void setElements(String[] elements) {
this.elements = elements;
public HtmlDataTable getDataTable() {
return dataTable;
public void setDataTable(HtmlDataTable dataTable) {
this.dataTable = dataTable;
public String doSearch() {
elements = readFromDatabase();
return "";
public String doShowElement() {
String selected = (String) dataTable.getRowData();
System.out.println("Selected element: " + selected);
return "";
}This is in faces-config.xml
<managed-bean>
<managed-bean-name>myExample</managed-bean-name>
<managed-bean-class>example.MyExample</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>Thank you for your answer.
I didn't realise I could use inputHidden for anything more complex than a single string...
I have added a h:inputHidden for the elements array but it still doesn't work.
How should it be used?
<h:form>
<h:inputHidden value="#{myExample.elements}"/>
<h:commandButton action="#{myExample.doSearch}" value="Search Database" />
...While debugging I noticed that at the last button-press the getElements method is called twice before setElements, returning null. -
Using forms with a table retrospectively (ipad)
I have a table in numbers that I am using to track my travel budget. I didn't create the original spreadsheet and there's lots of formulas. There's also a lot of data in there now and it's tricky to use as a spreadsheet so I'd like to implement forms.
My research tells me that the reason I can't start a form at the moment is because the table wasn't set up with headers, & turning headers on now doesn't fix it.
Is there a way to start a NEW table (with headers turned on) and import my current data including formulas/values? So far, I've had no luck trying it myself.
Thanks.There should be no reason you cannot get the headers to work, as long as you fill in a header for every column Even if it is "Calcs 1".
If you must amke a new table, You can make a new table set up with headers and footers then copy/paste the data from the old table into the new one.
Jason -
Multi-row form with button to save and add another row
Can you have a button on a multi-row tabular form that would save the current changes, and than open a new row up on the fom for a new entry to be entered? This would combine the save and add a row button functions.
Add Row button is doing exactly what you are asking for - it will save the chages you
made and add a new row.
Denes Kubicek -
Hello everyone. I hope the holidays treated you all well.
I'm having an issue on where to get started and I'm hoping
you all can either help point me in the right direction or show me
an example that I can further enhance to do what I need it too.
1) I'm looking for a simple form, [Name] [Email_Address]
where I can submit it to a table to view my "Contact List".
2) I would also like to be able click in the table or row of
my "Contact List", that populate the form for editing.
3) Finally, I would like to be able to remove the row from
the table.
If anyone could lead me in the right direction, I would
greatly appreciate it.
Thanks in advance,
Michael LeeCan someone please chime in, send me somewhere, and include
an example?
Michael Lee
Maybe you are looking for
-
Update plot name in the cursor legend
Hi, I have a XY graph with its cursor legend set as visible. The plot name changes based on the string that I sent to its property node, but I don't know how to update its cursor plot name? Cursor is snapped to the plot, but the cursor plot name di
-
Dear All, Any specific command or steps to find which process consuming lot of swap space and there is any specific step to reduce the usage without kill the actual process. Regards, Siva
-
My dictionary is in Japanese, how do I change it back to English?
I select the word and tap define but it gives me the defenition in Japanese.
-
I've tried to open my Itunes multiple times, and no matter what I do it still won't open and gives me the same error. It tells me to reinstall Itunes, and I've deleted both quicktime and itunes and still, it gives me the same error. What do I do?!
-
Change search options to FILE NAME only
Is there a way to change the search options to always search for FILE NAME only? I don't know who'd saech for contents every time, that would seem like a last resort if you couldn't find what you are originally looking for and forgot the file name. W