Custom Integrator - Date Picker/LOV does not return a value to the cell
Hi,
I have configured a webADI template with a date picker in it. Though the picker is rendered when i double-click on the cell, the selected date is not populated back. Same happens for any other list of values may render in the integrator. Any suggestions on debugging this issue.
Regards,
Vinayaka
I have got the LOV working now. The issue was that I had not provided the table-select-column with the interface column name. It was set to the table column name.
Regards,
Vinayaka
Similar Messages
-
Group Used as LOV does not return records
Have:
1. A header table called Claims
2. A detail table called ClaimLines
3. The Claims Table has a foreign key called emp_no which refers to an employee table ( Claims for an employee)
4. The ClaimLines table has a foreign key called mem_id which refers to an employee family members table that also has emp_no as a foreign key (family members for an employee)
5. A JHS group for Claims that shows the employee name and employee id. An LOV populates the employee name and employee id
6. A details group fro CalimLines that shows family member name. An LOV populates the member name and member id. (The idea is to pull family members for the employee selected in the header section in 5 above.
Problem:
The calims LOV populates the employee name and employee id correctly.
When I move to the calimlines (details), the members who should be restricted to the employee selected in the Claims group does not return any records.
The LOV for the members is based on a VO called DependentsofEmpolyee that has a where clause emp_no=:p_emp_id (:p_emp_id is a bind parameter)
The LOV group for the members has an EL expression in the Query Bind Parameters
p_emp_id=#{bindings.ClaimsEmpId.inputValue}. The expression is to restrict the members to those who belong to the employee selected in the Claims section of the page.
Debug gives the following information:
-ViewObject DependentsOfEmployee1: bind parameter values have not changed, NO Requery performed.
It seems that the p_emp_id is not being populated with the emp_id from the header section(Claims)
The same EL expression works if applied to a dynamic LOV. The drawback of the dynamic LOV is that is only populates two fields, the value attribute and the meaning attribute. In our case we need to populate more than one attribute.Thanks for the input.
I tried the following
1. Create a managed bean in faces-config.xml.
<managed-bean>
<managed-bean-name>FamiliyLovContext</managed-bean-name>
<managed-bean-class>FamiliyLovContext</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
2. Updated the skeleton class FamilyLovContext.java to:
public class FamiliyLovContext {
Number empId;
public void setEmpId(Number empId) {
this.empId = empId;
public Number getEmpId() {
return empId;
3. Copied tableLovItem to tableLovItemFamily and added the following to the section
<af:selectInputText
<af:setActionListener from="#{bindings.ClaimsEmpId.inputValue}"
to="#{FamilyLovContext.empId}"/>
4. Used the the new template for the lov item in the claimlines group.
5. set the query bind parameters of the lov group to #{FamilyLovContext.empId}
I gor the following error
16:38:08 ERROR (ApplyRequestValuesPhase) -java.lang.IllegalArgumentException: argument type mismatch
javax.faces.el.EvaluationException: java.lang.IllegalArgumentException: argument type mismatch
at com.sun.faces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:248)
at oracle.adfinternal.view.faces.taglib.listener.SetActionListener.processAction(SetActionListener.java:50)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
at oracle.adf.view.faces.component.UIXComponentBase.broadcast(UIXComponentBase.java:548)
at oracle.adf.view.faces.component.UIXEditableValue.broadcast(UIXEditableValue.java:243)
at oracle.adf.view.faces.component.UIXSelectInput.broadcast(UIXSelectInput.java:170)
The ClaimsEmpId attribute is Number(4,0) -
When LOV does not return the value
Check that you are not calling setText(String) on the web bean to set the default value. It causes your bean to no longer draw the value from the underlying VO. One of the symptoms is that selecting a value from the LOV modal window will not return that value to the base page. (The value from the LOV will actually be set on the VO, but the UI won't reflect it.)
Setting the default value in the model layer is prefered. You can do this by overriding the create(AttributeList nameValuePair) method of OAEntityImpl or OAViewRowImpl.
If, for some reason, you need to set the default value from the client side, you need to call setText with the pageContext, e.g., setText(pageContext, "myDefault");Hello
Upon giving your question further thought I think that you would be better off if you added an 'id' column to table T1 and referenced this 'id' column in table T2 . Something like
Table_T1(id number, c1 varchar2(100)
and
Table_T2(.other_columns.. ,t1_id)
Your LOV will now be select c1 display,id return from table_t1The column t1_id will be defined to use this LOV.
You will need no other modifications to the form on table_t2
Varad -
LOV does not return the value (1)
Avoid calling setText on the web bean to set the default value. It causes your bean to no longer draw the value from the underlying VO. One of the symptoms is that selecting a value from the LOV modal window will not return that value to the base page. (The value from the LOV will actually be set on the VO, but the UI won't reflect it.)
Setting the default value in the model layer is prefered. You can do this by overriding the create(AttributeList nameValuePair) method of OAEntityImpl or OAViewRowImpl.
If, for some reason, you need to set the default value from the client side, you need to call setText with the pageContext, e.g., setText(pageContext, "myDefault");Hi RamKumar,
Thanks for your reply.. I have already done that but no luck :(
Regards,
Hemanth J -
MessageChoice does not return correct value
Hi
I am problem with MessgeChoiceBean's improver beharior
For the first time it retunrs blank and subsequently In one page if I select Yes, it returns No.
In another page it does not return any thing for the first two selections. And I reciev flip values.
I ran VO outside, VO is returning correct values.
MessageChoice attributes and associated PPR:
Data Type: Varchar2
Initial Value: N
Pick List view Definition: oracle.apps.xxx.docs.common.lov.server.YesNoVO
Pick List View Instance: YesNoVO3
Pick List Display Attribute: Meaning
Pick List Value AttributeL LookupCode
ActionType: firePartialAction
Event: handleNewLocationFlagChange
Parameter Name: newLocationFlag
Parameter Value: ${oa.CustomerInfoVO1.NewShipToLocationFlag}
ProcessParameterForm Code:
if ("handleNewLocationFlagChange".equals(event))
String newLocationFlag = pageContext.getParameter("newLocationFlag");
Serializable[] parameters = { ""+newLocationFlag};
Class[] paramTypes = { String.class};
am.invokeMethod("handleNewLocationFlagChange", parameters, paramTypes);
VO definition:
select LOOKUP_CODE,MEANING
FROM ONLINE_DOCS_LOOKUPS
WHERE ONLINE_DOCUMENT_CODE = 'ALL'
AND LOOKUP_TYPE = 'YESNO'
ORDER BY ATTRIBUTE1
View output:
LOOKUP_CODE MEANING
N No
Y Yes
I have quite a bit number of columns to change render property.
Any help will be appreciated.
Thanks
PrasadYour question is not clear, are you saying the values in the messageChoiceBean is not displayed properly. As far as I can see from the definition the poplist picks the values from a lookup(Yes, No) values and has a PPR action associated with it. Did you check what this method handleNewLocationFlagChange is doing in the AM ?
-
Server does not return query metadata check the query
hi,
i want know how to use bex query designer,
when i insert a data provider,the message is appear "server does not return query metadata check the query",
who can help me ?
thanks a lot !
addition: my current entironment is: gui710 with sp4,bi710 with sp2.Hi,
All the yellow and red lights will have an effect on query performance or execution. Read up on them as there are too many to explain via this forum.
There is a document on SDN on query performance. Some useful links:
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9f4a452b-0301-0010-8ca6-ef25a095834a]
[http://help.sap.com/saphelp_nw70/helpdata/en/41/b987eb1443534ba78a793f4beed9d5/frameset.htm]
[http://help.sap.com/saphelp_nw70/helpdata/en/d9/31363dc992752de10000000a114084/frameset.htm]
[http://help.sap.com/saphelp_nw04/helpdata/en/2e/caceae8dd08e48a63c2da60c8ffa5e/frameset.htm]
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0501cb9-d51c-2a10-239c-c141a22c45a6]
Cheers... -
Why is the giving me this error (method does not return a value) PLEASE !!
I have this code and it is giving me this error and I don't know how to fix it
can anyone out there tell me why
I have included the next line of code as I have had problems in the curly brackets in the past.
The error is
"Client.java": Error #: 466 : method does not return a value at line 941, column 3
Please help
THX TO ALL
private Date DOBFormat()
try
if
(MonthjComboBox.getSelectedItem().equals("") ||
DayjComboBox.getSelectedItem().equals("") ||
YearjComboBox.getSelectedItem().equals("")){
else
String dateString = StringFromDateFields();
SimpleDateFormat df = new SimpleDateFormat("dd/mm/yyyy");
Date d = df.parse(StringFromDateFields());
System.out.println("date="+d);
return d;
catch (ParseException pe)
String d= System.getProperty("line.separator");
JOptionPane.showMessageDialog( this,
"Date format needs to be DD/MM/YYYY,"+ d +
"You have enterd: "+ StringFromDateFields() + d +
"Please change the Date", "Date Format Error",
JOptionPane.WARNING_MESSAGE);
return null;
//File | Exit action performed
public void jMenuFileExit_actionPerformed(ActionEvent e) {
System.exit(0);
}Fixed it needed to have a return null;
this is the code
if
(MonthjComboBox.getSelectedItem().equals("") ||
DayjComboBox.getSelectedItem().equals("") ||
YearjComboBox.getSelectedItem().equals("")){
return null; -
Function does not return a value
CREATE OR REPLACE PACKAGE BODY Promo_Version_Logo_Pkg IS
FUNCTION Promo_Version_Logo_Rule(Rc IN test.Ot_Rule_Context)
RETURN Ot_Rule_Activation_Result
IS
PRAGMA AUTONOMOUS_TRANSACTION;
v_Result NUMBER;
CURSOR Cur_Promo_Logos IS
SELECT Pvlo.Promo_Id,
Evt.On_Date,
Evt.Channel_Id,
Evt.Start_Time,
Evt.Duration,
Pvlo.Logo_Id
FROM Event Evt,
Event_Technical_Data Etd,
Promo_Version_Logo_Opt Pvlo,
Promo_Timing Pt
WHERE Evt.Event_Technical_Data_Id = Etd.Event_Technical_Data_Id
AND Etd.Promo_Timing_Id = Pt.Promo_Timing_Id
AND Pt.Promo_Timing_Id = Pvlo.Promo_Timing_Id
AND Evt.Channel_Id = Rc.Channelid
AND Evt.On_Date >= Rc.Fromdate
AND Evt.On_Date <= Rc.Todate
AND Evt.Day_Type_Id = Rc.Daytype;
BEGIN
FOR Each_Record IN Cur_Promo_Logos LOOP
v_Result := Testing_Pkg.Insert_Event(v_Channel_Id => Each_Record.Channel_Id,
v_Tx_Time => Each_Record.Start_Time,
v_Tx_Date => Each_Record.On_Date,
v_Content_Id => Each_Record.Logo_Id,
v_Duration => Each_Record.Duration,
v_Event_Type => Uktv_Tools_Pkg.c_Logo_Kind_Code,
v_Container_Id => Each_Record.Promo_Id);
IF v_Result = -1
THEN
EXIT;
END IF;
END LOOP;
END Promo_Version_Logo_Rule;
END Promo_Version_Logo_Pkg;why do I get this "Hint: Function 'Promo_Version_Logo_Rule' does not return a value" after I compile it? The Testing_Pkg.Insert_Event should insert some values somewhere...I just want to try to test it before I move on onto the next bit of it, but I do not understand what I am doing wrong...
ThanksYou need something like:
END LOOP;
RETURN v_Result; -- if this is what you are trying to get the function to do
EXCEPTION
WHEN OTHERS THEN
<exception handling/logging - whatever you want>
RAISE; --this with then raise an error back to the calling process
END Promo_Version_Logo_Rule;This way the function either returns a value, or an exception which can be handled in the calling procedure -
Fetching Form Data... does not return form's field list to edit
I have a Portal Form based on a view. It works fine if I run it.
Suddenly I am unable to edit the form field properties:
1) In the application list, I do not get run option for the form.
2) If I go to manage and edit, "Fetching Form Data..." does not return the list of fields, so I am unable to change field properties.
3) I can still run the form.
Please help, I need to fix this within hours.
Thanks in advance.I think I know what causes the error. Whenever I use HTML tags inside the Display Options/label text box I get this error.
I have tried <p align="right">xyz</p> and <h4 align="right">xyz</h4>. In both cases I can run the form the first time and the label appears right justified, but when you try to edit the form, bottom left shows "error on page" and field data does not show up.
To fix this I had to go to the version before I added the HTML tags to the label.
Thank you for your help. -
LOV does not return the value (2)
PPR in general does not work correctly if invalid HTML is generated. One example of an invalid HTML is having an opening <TD> tag immediately following another opening <TD> tag.
After checking everything else, if LOV still does not return the value, test whether it's not a problem with the invalid HTML by placing the messageLovInput outside of the complicated layout nestings you may have. If it works outside of the layout nestings, look for the possible problems in the layout nestings.Hi RamKumar,
Thanks for your reply.. I have already done that but no luck :(
Regards,
Hemanth J -
UPDATE ... RETURNING does not return new value
Hi all,
I've created the following objects in Oracle DB 10.2.0.3.0:
CREATE TABLE TAB1
ID NUMBER PRIMARY KEY,
EDITED_AT DATE,
VALUE VARCHAR2(64)
CREATE SEQUENCE S_TAB1
INCREMENT BY 1
START WITH 1;
CREATE TRIGGER T_TAB1_BIE
BEFORE INSERT OR UPDATE ON TAB1
FOR EACH ROW
BEGIN
IF INSERTING THEN
SELECT S_TAB1.NEXTVAL INTO :NEW.ID FROM DUAL;
END IF;
:NEW.EDITED_AT := SYSDATE;
END;
/Then I tried to do the following in SQL Plus:
SQL> insert into tab1(value) values('ddd');
1 row created.
SQL> commit;
Commit complete.
SQL>
SQL> select * from tab1;
ID EDITED_AT VALUE
1 27.03.2008 17:01:24 ddd
SQL>
SQL> declare dt date; val varchar2(64);
2 begin update tab1 set value = 'ddd' where id = 1 returning edited_at, value into dt, val;
3 dbms_output.put_line('txt = ' || dt || ', ' || val);
4 end;
5 /
txt = 27.03.2008 17:01:24, ddd
PL/SQL procedure successfully completed.
SQL>
SQL> select * from tab1;
ID EDITED_AT VALUE
1 27.03.2008 17:02:12 ddd
SQL>As it can be seen Returning clause of an Update statement does not return a new date, i.e. 27.03.2008 17:02:12, that was updated by the trigger, it returns an old one - 27.03.2008 17:01:24. Please advise me why Database returns an old value? I do believe that UPDATE ... RETURNING ... statement should return new, generated by the trigger, value.
Thanks in advance.
Regards,
Yerzhan.you need to explicitly include the column in your UPDATE statement SET clause that you expect to return the result you want it to be. here's what i think what happened even though you have a trigger the first statement that was processed was your update statement. at the time of the update it has to return the current values to the returning clause that is the values on the table. now comes next the trigger which gives edited_at column a new value. when the trigger got fired the process don't return anymore to the UPDATE RETURNING statement. it's like each sequence of codes does not executes in parallel.
SQL> CREATE TABLE TAB_1
2 (
3 ID NUMBER PRIMARY KEY,
4 EDITED_AT DATE,
5 VALUE VARCHAR2(64)
6 );
Table created.
SQL> CREATE SEQUENCE S_TAB1
2 INCREMENT BY 1
3 START WITH 1;
Sequence created.
SQL> CREATE TRIGGER T_TAB1_BIE
2 BEFORE INSERT OR UPDATE ON TAB_1
3 FOR EACH ROW
4 BEGIN
5 IF INSERTING THEN
6 SELECT S_TAB1.NEXTVAL INTO :NEW.ID FROM DUAL;
7 END IF;
8 :NEW.EDITED_AT := SYSDATE;
9 END;
10 /
Trigger created.
SQL> insert into tab_1(value) values('ddd');
1 row created.
SQL> commit;
SQL> select * from tab_1;
ID EDITED_AT VALUE
1 28-mar-2008 10:31:18 ddd
SQL> declare dt date; val varchar2(64);
2 begin update tab_1 set value = 'ddd', edited_at = sysdate
3 where id = 1 returning edited_at, value into dt, val;
4 dbms_output.put_line('txt = ' || dt || ', ' || val);
5 end;
6 /
txt = 28-mar-2008 10:32:39, ddd
PL/SQL procedure successfully completed.
SQL> select * from tab_1;
ID EDITED_AT VALUE
1 28-mar-2008 10:32:39 ddd
SQL> -
Hi All,
I have a cube in which i'm using the TIME DIM that i created in the warehouse. But now i wanted a new measure in the cube which is Average over time and when i wanted to created the new measure i got a message that no time dim was defined, so i created a
new time dimension in the SSAS using wizard. But when i tried to process the new time dimension i'm getting the follwoing error message
"Errors in the high-level relational engine. The data source view does not contain a definition for "SSASTIMEDIM" the table or view. The Source property may not have been set."
Can anyone please tell me why i cannot create a new measure average over the time using my time dimension? Also what am i doing wrong with the SSASTIMEDIM, that i'm getting the error.
ThanksHi PMunshi,
According to your description, you get the above error when processing the time dimension. Right?
In this scenario, since you have updated the DSV, it should have no problem on the table existence. One possibility is that table has been specified for tracking in the notifications for proactive caching, but isn't available any more for some
reason. Please change the setting in Proactive Caching into "MOLAP".
Reference:
How To Implement Proactive Caching in SQL Server Analysis Services SSAS
If you have any question, please feel free to ask.
Best Regards,
Simon Hou
TechNet Community Support -
Res.getPathTranslated() does not return correct URL of the page requested
Hi,
The res.getPathTranslated() statement in the below code (in doFilter method) does not return the correct URL of the requested webpage.
Whenever a web page is accessed using a return statement (eg : return "nextPage"; ) inside a button's action method or a hyperlink's action method, the res.getPathTranslated() returns the URL of the current webpage instead of returning the URL of the webpage that is actually requested.
For example if there is a button on the page http://localhost:29080/MyJaas/faces/firstPage.jsp
And the button_action() is as follows
button_action()
return "nextPage";
The res.getPageTranslaged() returns "http://localhost:29080/MyJaas/faces/firstPage.jsp" instead of "http://localhost:29080/MyJaas/faces/nextPage.jsp"
However, if the webpage is requested by populating the URL property of the hyerlink in creator IDE, the res.getPathTranslated() returns the correct (requested) web page.
How to make res.getPathTranslagted() return the correct URL when the webpage is accessed from hyperlink's / button's action method?
I know that the explation is not very clear, so please bear with me. Let me know if you need more clarificatons. Thanks in advance for showing interest in this issue.
And by the way, the code below is the same as that used in Jaas Authentication tutorial :- http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/jaas_authentication.html
package jaasauthentication;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.http.HttpSession;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class SecurityFilter implements Filter{
/** Creates a new instance of SecurityFilter */
private final static String FILTER_APPLIED = "_security_filter_applied";
public SecurityFilter() {
public void init(FilterConfig filterConfig) {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException{
HttpServletRequest req = (HttpServletRequest)request;
HttpServletResponse res = (HttpServletResponse)response;
HttpSession session = req.getSession();
String requestedPage = req.getPathTranslated();
String user=null;
//We dont want to filter certain pages which include the Login.jsp/Register.jsp/Help.jsp
if(request.getAttribute(FILTER_APPLIED) == null) {
//check if the page requested is the login page or register page
if((!requestedPage.endsWith("Login.jsp")) && (!requestedPage.endsWith("Register.jsp")) && (!requestedPage.endsWith("Help.jsp"))){
//Requested page is not login.jsp or register.jsp therefore check for user logged in..
//set the FILTER_APPLIED attribute to true
request.setAttribute(FILTER_APPLIED, Boolean.TRUE);
//Check that the session bean is not null and get the session bean property username.
if(((jaasauthentication.SessionBean1)session.getAttribute("SessionBean1"))!=null) {
user = ((jaasauthentication.SessionBean1)session.getAttribute("SessionBean1")).getUsername();
if((user==null)||(user.equals(""))) {
res.sendRedirect("Login.jsp");
return;
//deliver request to next filter
chain.doFilter(request, response);
public void destroy(){
}Guys any solution for the above problem?
Right answer fetches 10 duke dollars.. -
Function Does Not Return any value .
Hi ,
I am wrtting the below funtion without using any cursor to return any message if the value enters by parameters
does not match with the value reterived by the function select statement or it does not reterive any value that
for the parameters entered .
E.g:
CREATE OR REPLACE FUNCTION TEST_DNAME
(p_empno IN NUMBER,p_deptno IN NUMBER)
RETURN VARCHAR2
IS
v_dname varchar2(50);
v_empno varchar2(50);
V_err varchar2(100);
v_cnt NUMBER := 0;
BEGIN
SELECT d.dname,e.empno
INTO v_dname ,v_empno
FROM scott.emp e , scott.dept d
WHERE e.empno=p_empno
AND d.deptno=p_deptno;
--RETURN v_dname;
IF p_empno IS NOT NULL AND p_deptno IS NOT NULL
THEN IF v_dname is NULL THEN
v_err :='Not Valid';
RETURN v_err;END IF;
ELSIF p_empno IS NOT NULL AND p_deptno IS NOT NULL
THEN IF v_dname is NOT NULL THEN
RETURN v_dname; END IF;
ELSE
RETURN v_dname;
END IF;
END;
Sql Statement
SELECT TEST_DNAME(1234,30) FROM dual
AND IF I enter a valid combination of parameter then I get the below error :
e.g:
SQL> SELECT TEST_DNAME(7369,20) FROM dual
2 .
SQL> /
SELECT TEST_DNAME(7369,20) FROM dual
ERROR at line 1:
ORA-06503: PL/SQL: Function returned without value
ORA-06512: at "SCOTT.TEST_DNAME", line 24
Where I am missing .
Thanks,Format you code properly and look at it:
CREATE OR REPLACE
FUNCTION TEST_DNAME(
p_empno IN NUMBER,
p_deptno IN NUMBER
RETURN VARCHAR2
IS
v_dname varchar2(50);
v_empno varchar2(50);
V_err varchar2(100);
v_cnt NUMBER := 0;
BEGIN
SELECT d.dname,
e.empno
INTO v_dname,
v_empno
FROM scott.emp e,
scott.dept d
WHERE e.deptno=d.deptno
AND e.empno=p_empno
AND d.deptno=p_deptno;
--RETURN v_dname;
IF p_empno IS NOT NULL AND p_deptno IS NOT NULL
THEN
IF v_dname is NULL
THEN
v_err :='Not Valid';
RETURN v_err;
END IF;
ELSIF p_empno IS NOT NULL AND p_deptno IS NOT NULL
THEN
IF v_dname is NOT NULL
THEN
RETURN v_dname;
END IF;
ELSE
RETURN v_dname;
END IF;
END;
/Both p_empno and p_deptno in
SELECT TEST_DNAME(7369,20) FROM dualare not null. So SELECT will fetch some v_dname and v_empno. Since p_empno and p_deptno iare not null your code will go inside outer IF stmt and will execute its THEN branch. That branch consist of nothing but inner IF statement. And since v_dname is NOT NULL it will bypass that inner IF and exit the outer IF. And there is no RETURN stmt after that outer IF. As a result you get what you get - ORA-06503. Also, both if and elsif in your code check same set of conditions which makes no sense.
SY. -
Date Picker Widget does not work on template spawned (copied) pages
Hi,
I am trying to set up a PDF document form for a client using Adobe Acrobat Pro XI. I have several date fields where I am wanting to use the Form Router Date Picker Widget (which has been downloaded and installed). This works perfectly fine when it is just one page. However, I am using a template with a script that creates a copy of the first page activated from a button -- ideally to allow users to create however many pages they want before submitting everything. The code from the button is as follows:
var myTemplateArray = this.templates;
var myTemplate = myTemplateArray[0];
myTemplate.spawn(this.numPages, true, false);
// Get the field name prefix that Acrobat automatically adds to the new fields
var f_prefix = "P" + (this.numPages - 1) + ".cvcIntake";
// Reset the newly created fields
this.resetForm([f_prefix]);
// Go to the new page
this.pageNum = this.numPages-1;
The problem begins when a new page is added. If I try to click on the date picker on the second page, it shows up on the first page next to the same field that was copied. And if a date is selected it is entered into the field on the first page.
In looking into what is going wrong I found several things. First, the naming aspect on the copied page is creating all of the calendar objects with the prefix "P1.cvcIntake.fld" ("fld" is the prefix of the form fields on the first page). Second, going to the properties of the date picker object, its name has been changed to "P1.cvcIntake.FR_00000_CALENDARBUTTON_fld.Start_Date" and that action code is:
FormRouter_PlaceCalendar(getField("fld.Start_Date"), 3, "yyyy-mm-dd", 18.61102294921875);
Obviously both the name and the action code are going to cause it to do what it is doing now. Unfortunately I am not sure what to try to do to fix things, as my skills at writing code for Acrobat is probably just a little better than beginner. It seems to me that I need to be using a completely different approach for this part. Does anyone have any advice on how I might be able to manage this problem?
Thanks ahead for your time and consideration,
MikeIt took quite a while for me to solve this problem, but even longer to post it here (my apologies to anyone looking for a solution to it prior to now). Anyway, the real trick for me was to discover that I didn't have to explicitly put any numbering notations after adding the new fields (such as + "#" + this.pageNum) -- it turns out that the proper notational numbering is handled automatically.
While I am sure the real pros out there might be able to find a lot of ways to handle certain aspects better, below is the result of a great many hours of research, trial and error, and persistence. Considering the help I have received from this forum, I would be thrilled if I could make a contribution that helps anyone solve this problem. If so, I would be glad to hear from you! In any case, if anyone has any comments or questions please let me know.
// Get templates in array.
var aTemplates = this.templates;
var myTemplate = aTemplates[0];
// Spawn new form page to end using page renaming.
myTemplate.spawn(this.numPages, true, false);
// Get the field name prefix that Acrobat automatically adds to the new page fields.
var fldNamePrefix = "P" + (this.numPages - 1) + ".cvcIntake";
// Reset the newly created fields to be cleared of any data.
this.resetForm([fldNamePrefix]);
// Init array counter for found calendar fields.
var calFldsCnt = 0;
// Array for found unusable copied calendar fields.
var aCvcIntakeCalFlds = [];
var pageCnt = this.numPages-1;
// Loop through all fields.
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
var aNameSlice = f.name.split(".");
// Find all copied template-renamed calendar fields and save names in array.
if ((aNameSlice[1] == "cvcIntake" && aNameSlice[2] == "FR_00000_CALENDARBUTTON_fld") || ((aNameSlice[1] == "cvcIntake" && aNameSlice[2] == "FR_00000_Calendar"))) {
aCvcIntakeCalFlds[calFldsCnt] = f.name;
calFldsCnt++;
continue;
// Skip template-renamed fields.
} else if (aNameSlice[1] == "cvcIntake") {
continue;
// Find non-button calaendar fields to create copy for new page.
if (aNameSlice[0] == "FR_00000_Calendar") {
var calFieldsName = aNameSlice[0] + "." + aNameSlice[1];
var calField = this.addField(calFieldsName, f.type, pageCnt, f.rect);
var t = this.getField(calFieldsName);
// Copy non-function proprties of page 0 calendar fields.
for ( var p in f ) {
try {
if ( typeof f[p] != "function" ) {
if (p != "name" || p != "page" || p != "rect" || p != "type") {
t[p] = f[p];
} catch(e) {}
// Default all to hidden.
t.display = display.hidden;
// Set "CalendarMonth" items as they are on page 0.
if (aNameSlice[1] == "CalendarMonth") {
var aMonths = new Array(["January", "1"],
["February", "2"],
["March", "3"],
["April", "4"],
["May", "5"],
["June", "6"],
["July", "7"],
["August", "8"],
["September", "9"],
["October", "10"],
["November", "11"],
["December", "12"]);
t.setItems(aMonths);
// Copy button captions.
if (f.type == "button") {
t.buttonSetCaption(f.buttonGetCaption());
// Set action for all calendar "Day_X" fields.
if (calFieldsName.indexOf("Day_") > 0) {
t.setAction("MouseUp","FormRouter_SetCurrentDate(event.target.buttonGetCaption());");
// Find page 0 calendar buttons and make new page copies.
if (aNameSlice[0] == "FR_00000_CALENDARBUTTON_fld") {
var calButtonName = "FR_00000_CALENDARBUTTON_P" + pageCnt + ".cvcIntake.fld." + aNameSlice[1];
var calButton = this.addField(calButtonName, f.type, pageCnt, f.rect);
var t = this.getField(calButtonName);
// Copy non-function proprties of page 0 calendar buttons.
for ( var p in f ) {
try {
if ( typeof f[p] != "function" ) {
if (p != "name" || p != "page" || p != "rect" || p != "type") {
t[p] = f[p];
} catch(e) {}
// Get button icon copy.
t.buttonSetIcon(f.buttonGetIcon());
// Set up variable name for button action that call calendar activation.
var dateFieldName = "P" + pageCnt + ".cvcIntake.fld." + aNameSlice[1];
t.setAction("MouseUp","FormRouter_PlaceCalendar(getField(" + "\"" + dateFieldName + "\"" + "), 1, \"mm\/dd\/yyyy\", 0);");
// Go through array of captured non-usable template-copied calendar fields and buttons, removing each from page.
for (i=0; i<=aCvcIntakeCalFlds.length; i++){
this.removeField(aCvcIntakeCalFlds[i]);
// Go to the new page
this.pageNum = pageCnt;
Maybe you are looking for
-
Can't get an if conditional to work
Evening folks. As per title, I can't get my if, else if, else conditional to work. Was hoping someone could point out something really simple that my eyes can't see. Don't think I need to post anymore code than this, but please let me know if you nee
-
Hi, I've a DVD (free of copyrights) which i need to have on my mac. It's the video recording on my graduation cermony which i've taken from a friend. I'm supposed to copy it, or rip it, and then return it back. I don't know what to do. Please help.
-
Confirm quantity for an prod order
After confirming quantity for an order, can I use the same stock for another order
-
I have not found a way to create Guides in PSE 4 or 5, or any information on doing this. Can anyone tell me how this can be done? Also, guides made on a file created in Photoshop 7 or CS2 do not show up when the file is opened in Elements - is there
-
OWSM Custom Step to modify SOAPBody
We're trying to write a custom step that takes a username out of a WS-SECURITY header and forces it into an element in our SOAPBody. My code to pull the name from the header works fine, so does my code to iterate through the body to find the element