How to programmatically initialize field in ADF Creation Form
I'm using JDEV 10.1.3.2, ADF BC. The task sounds simple:
1. Create an ADF Creation Form by pulling in a VO (backed by EO) from Data Control.
2. Initialize one of the required fields in a backing bean from processScope.
3. User sets other fields via GUI.
4. Save the new record in the database (Commit).
The problem is how to do step 2? The processScope variable is being retrieved properly, but I have not been able to set the required field so that the user does not have to enter this field. I have an action on the Save button as follows:
public String commandButton_action() {
String psnetid = null;
BindingContainer bc = getBindings();
AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
psnetid = afContext.getProcessScope().get("netid").toString();
//Need to set Netid field in VO to psnetid here
OperationBinding operationBinding =
bc.getOperationBinding("Commit");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
return null;
}Can anyone shed some light on this?
Thanks.
This is outside of the backing bean, but you may try it:
modify the getter on the entity impl class (if you are using ADF BC) to set a default value
This example is to set a default status id on the field.
public class <EntityName>Impl extends EntityImpl {
public static final int STATUSINTLID = 1; //first column name on the entity
public Number getStatusIntlId() {
Object intlId = getAttributeInternal(STATUSINTLID);
if (intlId == null){
int intValue;
intValue = <get value from somewhere code>;
Number defaultValue = new Number(intValue);
if (defaultValue != null){
this.setStatusIntlId(defaultValue);
return (Number)getAttributeInternal(WATERDRAWSTATUSINTLID);
Cheers,
Jim
Similar Messages
-
How to Shift a field in Customer Creation Window to Main Page
Dear All,
We have a requirement of entering Customer Class while creating Customer.(Version R 12.0.6)
In Vision Instance, when we open Create Customer form, Customer Class appears under Account Information Part of Form, where we can select Customer Class from List of Values.
In our Development Instance, when we open the same Create Customer form, Account Information Part of Form, doesn't have any such field. We have to navigate to Save and Add details and give the Info there.
Please guide me how to move the field to Main Creation window to ensure Entry and avoid wastage of time.
Thanks in Advance
SridharSridhar,
Please review the following notes, it may be helpful:
Note: 462038.1 - How To Add New Codes For "Classification" Drop Down Field On New Customer UI In Release 12?
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=462038.1
Note: 438903.1 - How To Add Additional Value To Customer Class Drop Down List (LOV) in Customers Form (ARXCUDCI)?
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=438903.1 -
How to insert into two tables using a Single ADF creation form?
Hi,
I need to make a ADF Creation Form that will insert the data at same time in two tables... Like i have two tables Track (Track_id,Track_Name)
and Module ( Module_id, Track_id, Module_name, Module_Short_name) and i have to insert the data in both the tables using Same Creation Form.
can anybody help me out and gave me the solution,how to do that?
Thanksif you want to insert different data into two different tables then you can drag the two data objects into creation form..
If you want to duplicate the data inserted in the one table to another then you can follow two approach
1. Drag and drop one table, When Save button is invoked then insert data into another table using callable statement.
or
2. Create on-insert trigger in Table1 where you can insert data into table2.
--Prasanna -
Pass Parameter into ADF Creation Form
I have an ADF Read Only Form on page 1, and and ADF Creation Form on page 2. I want three specific fields from page one to be passed into the appropriate fields on page 2. How would I go about accomplishing this?
Thanks,
TimHey Shay,
I got one value to pass:
I put a setAction Listener on the command button. My From was #{backing_confirmTest.outputText2.value}. And my To was #{processScope.Test}.
When I tried to add another setAction listener to the same button it wouldn't let me. Can I not have another set of values like... #{backing_confirmTest.outputText3.value} and #{processScope.Test2}??
Thanks,
Tim -
Can I use View Link in ADF Creation Forms Jdev 10.1.3
Hi...
I created a view link of two tables. Then I created a ADF form with Master Object to show some informations.. and I created a ADF Creation form with the detail Object
I'm trying to submit the informations added in the Detail forms.
but no records are created in Database..
Can I submit a creation form using detail object?
ThanksI figured out "partially" the problem, I tried to overrid the create method, and for any reason the commit operation wasn´t working.
I was trying to set a value for a proprety, but it did not work as a wish.
My intention was.... when an user execute the form. one specific field brings a value.. however I cannot set default value. cause it´ll change sometimes.
it´s something like this
protected void create(AttributeList attributeList) {
super.create(attributeList);
setMyProperty(new Number(0));
do you know how can I figure out this problem? -
How to add new fields to the system form (Ex.expenses to a/r invoice form)
hi
can any one tell me how to add new fields to the system form (Ex.expenses to a/r invoice form)
i want to add expenses field to system a/r invoice form and connect data base also.
i used the code of samples\11.system form manipulation(vb.net) but i'm not able to get it....so can any one help with code or concepts.
reply soon plz..
thankQIf I understood you correctly, you are just trying to add new fields to the invoice form and then use them in your form. you should first go and add the field to your tables, which you would do by going to Tool --> User Defined Fields --> Manage User Fields. There are different documents or categories given. For ex. for invoices, Sales Orders you would add your field under the Marketing Documents. If you want the field to be just one per invoice, add it to the Title, otherwise if you want a field per invoice or Sales Order line, add it to the Rows section. Once you have done that then you can just create a edit box or drop down to represent the field and set the datasource for that to your field. If you want example code to do that, let me know.
-
How to change the Field Symbol, so Adobe Forms takes it as a Table?
Hi guys,
I created an Field Symbol, in a Interface which I use for Adobe Forms. The type of the Field Symbol is STANDARD TABLE, and this field symbol I fill with data from another program.
But the problem is that in adobe forms, this Field Symbol is taken as TEXT FIELD and not as Table... and this shows me a Dump because it can't convert Internal Table to type C (the dump is like that).
What I need, is how to change the Field Symbol, so Adobe Forms takes it as a Table?
I looked at Adobe Form, and found this:
The Type Category of the Field Symbol is DICTIONARY TYPE and I think I need to change it to Internal Table as shown in the right picture.
Does someone have any idea?Hello Taly,
To what i understand your requirement, you need to pass data from Field symbol to internal table in Adobe form.
You have done it correct partially. I have replicated your scenario and steps are below -
1) Create a Z structure
2) Create Z Table Type
3) Create Adobe Interface with Table & Field Symbol. Also do coding as shown to assign the internal table populated in driver program to filed symbol.
4) Design Form as -
5) Code driver as -
*& Report ZR_AF_FS_1
REPORT zr_af_fs_1.
DATA: fm_name TYPE rs38l_fnam,
fp_docparams TYPE sfpdocparams,
fp_outputparams TYPE sfpoutputparams,
it_kna1 TYPE ztt_fs_1.
* Sets the output parameters and opens the spool job
CALL FUNCTION 'FP_JOB_OPEN' "& Form Processing: Call Form
CHANGING
ie_outputparams = fp_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
* <error handling>
ENDIF.
*&---- Get the name of the generated function module
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME' "& Form Processing Generation
EXPORTING
i_name = 'ZAF_FS_1'
IMPORTING
e_funcname = fm_name.
IF sy-subrc <> 0.
* <error handling>
ENDIF.
*-- Fetch the Data and store it in the Internal Table
SELECT kunnr name1 name2 adrnr FROM kna1 INTO TABLE it_kna1 UP TO 15 ROWS.
* Language and country setting (here US as an example)
fp_docparams-langu = 'E'.
fp_docparams-country = 'US'.
*&--- Call the generated function module
CALL FUNCTION fm_name
EXPORTING
/1bcdwb/docparams = fp_docparams
it_data = it_kna1
* IMPORTING
* /1BCDWB/FORMOUTPUT =
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3.
IF sy-subrc <> 0.
* <error handling>
ENDIF.
*&---- Close the spool job
CALL FUNCTION 'FP_JOB_CLOSE'
* IMPORTING
* E_RESULT =
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
* <error handling>
ENDIF.
6) Output -
BR. -
I need to create form that will show empty values because i want to enter new records in empty table. I have found out that i need to select ADF creation form from the context menu when i drag the collection for which i want the form to be created. The problem is that i don't have ADF creation form listed under forms submenu. I'm using JDeveloper 11g.
Can someone help me?
Edited by: user4711269 on Dec 11, 2009 2:33 AMHello Frank and thanks for your answer.
I have managed doing this with only one page with this tutorial http://blogs.oracle.com/shay/2007/07/25/
thanks -
Urgent: how to traverse through records using ADF ReadOnly Form
Hi Guru's,
I am new to ADF.
I am having an requirement where i need to show the records in "ADF Read Only Form" where my query fetch more than one record, now i want to traverse through all the record as we do in ADF Table. How can i achieve this using ADF Readonly Form.
Please suggest me on urgent basis.
Thanks
SPCHi,
What is your JDev version? Did you try setting the rowSelection property of the table?
Ex :
<af:table value="#{bindings.EmpView1.collectionModel}" var="row" rows="#{bindings.EmpView1.rangeSize}"
emptyText="#{bindings.EmpView1.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.EmpView1.rangeSize}" rowBandingInterval="0"
selectedRowKeys="#{bindings.EmpView1.collectionModel.selectedRow}"
selectionListener="#{bindings.EmpView1.collectionModel.makeCurrent}" rowSelection="single"
id="t1">-Arun -
How to enable a field on the person form?
Hello,
I am working in UK Legislation and I need to enable a greyed out field on the person screen. It's the "Disabled" field (to capture the disability of an employee).
This might sound an easy thing to do but I couldn't find any function or profile option that controls this. I couldn't find any metalink note on this. Could any one tell me how to do this or let me know of any metalink note on this?
Many Thanks,
BalooBoth answers were helpful. Thanks a lot.
In the interest of other users I am pasting the answer below:
The Disability Discrimination Act 1995 (DDA) is the main piece of legislation which makes it unlawful to discriminate against a disabled person in their terms of employment, promotion opportunities, by dismissing them or by subjecting them to any other detriment. This act had been further amended, cumulating in the Disability Discrimination Act 2005 which is related to disability generally and extends outside the area of employment although some provisions will relate to employees.
Parts of the Act came into force in December 2005, other parts relating for example to transportation are applicable from December 2006. The above provisions replaced the concept of Registered Disabled Persons and
employment quotas which had been in existence since after the second world war.
In releasing the enhanced Disabilities functionality, it was intended to facilitate the maintenance of disability records through the Disability form and not the Disabled field on the person form. -
I have the Adobe Reader x 10.0.1. Free version.
I downloaded a PDF form and open the document but cannot fill in any of the fields. With the form opened I look at File/Properties/security which shows "Filling of the form fields": Allowed.
I do not find "Typewriter" under view.
How can I type in to fill the fields
RegardThe window snip will let you see:
-
How to read data/fields of the pdf form
Hi,
i want to orchestrate a process where input is interactive forma and output is xml data.
i mean i want to read data/fields of the pdf form.
Which activity do i use on workbench.
Regards
SunilDieter,
I am talking about 3rd senario, where we create one process on workbench, and pass filled pdf as input and then output of process is xml file.
What is the process name here (Like renderPDF process) which extract data from pdf.
regards
Sunil -
How to add new fields in message creation screen
Hi All,
My requirement is to add another 2 fields in the message creation screen.
Also I found this link is bit useful.
Add custom fields to Support Message
Can anyone share the detailed procedure to add a field in the message screen.
Thanks in Advance.
Regards
Narasingam. BHello,
I think of something like:
First, you create extension, with transaction WE30.
Then, reduce your idoc, your extension should also be proposed.
Do not forget to add this extension in outbound we82, and/or we57 in inbound, and WE20, and find BTE or exit to populate extension.
regards.
F.S. -
How to change the fields in a JSF form based on a URL parameter
I am trying to build a generic JSF form of parameters which I want to dynamically change (i.e.
change which field is visible, what the label text should be, etc) based on a URL parameter.
I can set the fields using logic in the backing bean as an action on a command button pressed.
But how do I do it based on the URL parameter ? I can retrieve the URL parameter but I
don't know where to put (or hook) the Java code to do this initialization prior to
the page being rendered for the first time.
The fields in the JSF is being configured dynamically using a database table.
BTW I am using Jdeveloper 10.1.3.5
Thanks
CKThanks. I decided to set a Session bean to store the value of the URL parameter (if it is set)
and then to use the session bean to initialize the attributes of the fields on the JSF Page.
There also seems to be some caching of the inputText fields (i.e. it reverts back to the first
initialized value) even though I tried to change it using the URL parameter in the requestScope
backing bean. So, setting the values into the Session bean and retrieving it back from there
seems to be more reliable. -
Master Detail Form - How 2 update a field in the Detail form using a query?
Hello,
I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
Tried using session storage objects, but made no headway.
Would greatly appreciate pointers on how to go about doing this.
Thanks.
DevIf you are on a Portal Version lesser than 3.0.9.8.3, then please try the following to populate
the PART_DESCRIPTION field.
Steps:-
1> Edit the form and go to the Additional PL/SQl section and put the following code in the
"...after displaying the page area" :-
declare
type t_vc_arr is table of varchar2(4000) index by binary_integer;
l_arr_desc t_vc_arr;
l_form_name varchar2(200);
l_form_state varchar2(500);
begin
l_form_name := p_session.get_module().get_name();
l_form_state := p_session.get_value_as_varchar2(
p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_FORM_STATE'
if l_form_state = 'QUERY_AND_SAVE' then
select description
bulk collect into l_arr_desc
from <schema>.table_x;
htp.p('
<script>
var descArr = new Array();
var Fidx = 1;
var formObj = document.WWVM'||p_session.get_id()||';
var fieldName = "'||l_form_name||'.DETAIL_BLOCK.PART_DESCRIPTION.0";
for i in 1..l_arr_desc.count loop
htp.p('descArr['||to_char(i-1)||']="'||l_arr_desc(i)||'";');
end loop;
htp.p('
for (var i=0; i < formObj.length; i++){
if (formObj.elements.name == fieldName+Fidx){
formObj.elements[i].value = descArr[Fidx-1];
++Fidx;
htp.p('</script>');
end if;
end;
Maybe you are looking for
-
MY CREATIVE ZEN V PLUS 8GB DEAD!!! PLZ H
can anyone help my mp3 player seems to be dead, it wont even turn on...i tried charging it to see if the battery was dead but its not even turning on....can anyone please help me....its really urgent!!!!Message Edited by jayat on 08-7-200706:07 PM
-
The links in aol email do not work - how do I enable them?
I am using the aol toolbar for firefox and none of the links in the emails work.
-
I have an issue in comparing dates in IF condition. I tried the below, its not entering the if condition if :header.start_date = sysdate then end if; NO JOY. Can someone advice me on this. Thanks Pandian
-
I recently purchased a used imac with os 10.6 The problem I am having the admin in accounts in system preferences I would like to change so I can download some items I have tried different things to do this but I cannot figure it out. thanks in adva
-
Trouble streaming from library
When trying to watch a movie out of my library, it often stops and returns to the home page. Is this common, or how xan this be fixed