ViewLink accessor erratic; sometimes returning with value, sometimes null
When does a ViewLink Accessor gets initialized or assigned a value.
consider the following code:
setAnAttribute(Object value) {
setAtttributeInternal(ATTRIBUTEINDEX, value);
Row row = getViewLinkeAccessorView();
if(row!= null) //sometimes this one executes the if block, sometimes not.
}
When does a ViewLink Accessor gets initialized or assigned a value.
consider the following code:
setAnAttribute(Object value) {
setAtttributeInternal(ATTRIBUTEINDEX, value);
Row row = getViewLinkeAccessorView();
if(row!= null) //sometimes this one executes the if block, sometimes not.
}
Similar Messages
-
ViewLInk Accessor unpredictable, sometimes null, sometimes with value
When does a ViewLink Accessor gets initialized or assigned a value.
consider the following code:
setAnAttribute(Object value) {
setAtttributeInternal(ATTRIBUTEINDEX, value);
Row row = getViewLinkeAccessorView();
if(row!= null) //sometimes this one executes the if block, sometimes not.hi anton.
Maybe this is also related to your issue:
"Difference Between View Link Attribute and View Link Instance in Data Model"
http://radio.weblogs.com/0118231/stories/2004/11/08/differenceBetweenViewLinkAttributeAndViewLinkInstanceInDataModel.html
success
Jan Vervecken -
ViewLink accessor attribute NULL when VO has bind vars
Hi! I noticed that a ViewLink accessor attribute returns a NullPointer when the ViewObject SQL has a bind variable. i have a data model with Dept and Employee ViewObjects that is connected via viewlink.
I inserted a bind parameter :pDept and added on the whereclause "DeptNo = :pDept" to filter the employee returned based on Department. I then created a new Dept Row and a new employee on the same transaction (no commiting yet). When I got a reference to the viewLink accessor on the EmployeeViewRowImpl, i got a null reference when i tried to reference the viewLInk accessor for the department view:
//code snippet inside EmployeeViewRowImpl
void setAnAttribute(Object value) {
Row row = getDeptView(); //returns null
}I notice that when I removed the bind variables and the where clause, I get the correct ViewLink accessor.
Is this expected behavior? if this is a bug, how can i get around this problem?hi anton.
Maybe this is also related to your issue:
"Difference Between View Link Attribute and View Link Instance in Data Model"
http://radio.weblogs.com/0118231/stories/2004/11/08/differenceBetweenViewLinkAttributeAndViewLinkInstanceInDataModel.html
success
Jan Vervecken -
ViewLink Accessor returning null when VO has a BindParameter
I have DeptView and EmpView that is link with a DempEmpViewLink. the link is two way so DeptView has a RowIterator Viewlink accessor and EmpView has a Row ViewLInk accessor.
However inside the employeViewRow code, I always get a Null value when I access the Dept accessor.
//inside Employee View Row.java
Row row = this.getDeptView(); //returns null
...This happens when The DeptView has a bindvariable because I need to filter the DeptView so I have a where clause on the SQL statement. However, when I remove the whereclause and the bindvariable, the Dept ViewLInk accessor returns the correct row.
regards,
AntonHi Chris,
My scenario is actually a Invoice Header and Details screen.
I have a HeaderView, DetailsView, and a HeaderDetailLink defined by a Composition Assoc. The headerView has a BindParameter on it. So on my page, I can view/navigate invoices and its details. but at the same time using the same viewobjects and same page, I need to be able to create and save a record on the header and details at the same time by just one Commit/Save. (Similar to a Forms application (header Form, and Details table).
On pageload i execute a methodaction that inserts a row on the header and the detail at the same time. Then on the jsp page, I put some values on the header. Next i put a value on a fieldA on the detail. But when I put a value on fieldA, I need to compute the value of fieldB on the detail based on fieldA and a field of the Header row, fieldHeader.
So to compute fieldB, I put a code on the settermethod of fieldA in the DetailRowImpl.java file:
//detailRowImp.java, setFieldA()
public void setFieldA(Number value) {
setAttributeInternal(FIELDA, value);
... Row row = getHeaderRow(); //returns null
Number fieldbValue = compute(value, row.getAttribute("FieldC")); //NullPointerException
}What are your thoughts? any suggestions?
regards,
Anton -
How can I return multiple values with PL/SQL Web Services
Hi,
I'm new to developping Web Services. I'm doing some tests with JDeveloper and OC4J on my local machine with a Web Services based on a PL/SQL function within a package. Right now that function only returns one value. So the xml response only has one output.
I'd like to know how can I return multiple values with my PL/SQL Web Service. For example, if I want to return an employee's name and id? And that the xml contains two output : <employee>, <empid>?
Reginald
ps : I have searched the forum and I couldn't find an answer to this question, if that has been discussed AND answered before, can you please post the link? ThanksAlright, I actually found my answer. Since this was asked I think as a followup somewhere else I'll give my answer.
It is very simple, all you have to do is create an Object Type and then Return that object type. After that, JDeveloper will take care of everything and you will have an xml response with multiple values. Here
{color:#ff0000}
create or replace TYPE person AS OBJECT
( id_interv number,
first_name VARCHAR2(50),
last_name VARCHAR2(50),
date_birth date
);{color}
Then your function used in your Web Service should look something like this :
{color:#ff0000}
function info_emp (p_empno IN VARCHAR2) RETURN person AS
l_emp person := person(-1,'','','');
BEGIN
SELECT first_name
,last_name
,emp_no
INTO l_emp.first_name
,l_emp.last_name
,l_emp.emp_no
FROM emp
WHERE upper(emp_no) = upper (emp_no);
{color}
{color:#ff0000}
RETURN l_emp;
EXCEPTION WHEN NO_DATA_FOUND THEN
l_emp := person (-1,'n/a','n/a','n/a');
RETURN l_emp ;
END info_emp;{color}
{color:#ff0000}{color:#000000}After that, this is what the xml response looks like :{color}{color}
<first_name xsi:type="xsd:string">John</first_name>
<last_name xsi:type="xsd:string">Doe</last_name>
<emp_no xsi:type="xsd:string">0250193</emp_no> -
Pl/sql package for use with workflow will not return a value
hi all,
just trying to intercept a requisition being turned into an order if it uses a certain cost code. so i have amended the workflow and created a package to check what cost centre a requisition is using. how over the workflow stops on the function that calls the package witha a status of complete as if the package is not returning any values.
the package is as below:
CREATE OR REPLACE PACKAGE APPS.xxhccWFcapitalcheck AS
procedure XXHCC_CHECK_CAPITAL(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out NOCOPY vARCHAR2);
END xxhccWFcapitalcheck;
CREATE OR REPLACE PACKAGE BODY APPS.xxhccWFcapitalcheck AS
procedure XXHCC_CHECK_CAPITAL(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out NOCOPY varchar2 ) is
x_progress varchar2(100);
x_resultout varchar2(30);
l_doc_mgr_return_val VARCHAR2(1);
l_doc_string varchar2(200);
l_preparer_user_name varchar2(100);
doc_manager_exception exception;
p_test varchar2(100);
l_req_id varchar2(30);
CURSOR p_line_id IS
SELECT
codes.segment2 cost_center
FROM
po_requisition_headers_all headers,
po_requisition_lines_all lines,
po_req_distributions_all dist,
gl_code_combinations_v codes
WHERE
headers.requisition_header_id = lines.requisition_header_id
AND
lines.requisition_line_id = dist.requisition_line_id
AND
dist.code_combination_id = codes.code_combination_id
AND
headers.segment1 = l_req_id;
line_rec p_line_id%rowtype;
BEGIN
-- Do nothing in cancel or timeout mode
--if (funcmode <> wf_engine.eng_run) then
-- resultout := wf_engine.eng_null;
-- return;
-- end if;
l_req_id := wf_engine.GetItemAttrNumber (itemtype => itemtype,
itemkey => itemkey,
aname => 'DOCUMENT_NUMBER');
--FOR line_rec in p_line_id
---loop
open p_line_id;
fetch p_line_id into l_doc_string;
close p_line_id;
IF p_line_id= 'Q9DEF'
dbms_output.put_line p_line_id;
Then resultout := 'COMPLETE:F';
return;
p_test := 'USE DIFFERENT CODE';
ELSE
resultout := 'COMPLETE:T';
return;
END IF;
END LOOP;
end;
END xxhccWFcapitalcheck;
any help would be great!Hi Community, first of all, english is not my native language and im not sure to use the correct terms for PowerCenter - so if im wrong please help me correct and make clear what we need. We have a kind of 3-steps ToDo. First step: Load data from an external source into a "local" datastore (its an oracle db on a server in our "hands")Second step: Check data against several verifications, this is done with a PL/SQL Package. The PL/SQL Package shall be called with an Interfacename who is set in the First PowerCenter Mapping. Our current thoghts are to do this via a stored procedure, which runs as "Target Post Load" and gets a variable "Interface Name".Is that possible? Im not quite sure about it. About the last part its even more unclear how we can solve it:Third part should be switch back to PowerCenter now - and the package (or to be correct a function in the package) should return a value for "okay everything fine => workflow continue" or "something happened => workflow is stopped" Im not sure how i can handle this. I hope my explanations are good enough so you can provide some help?!If there are any questions please ask! Thank you alot, best regards, Christian
-
Help with an SQL Expression - Return field value where Datetime is Min or First datetime
Hello,
I'm extracting results for a patient population.
I have 6 SQL expressions that pull back the first date for specific procedures or Medications being ordered.
These Expressions work perfect - One of the expressions return the first time a lab was ordered.
I'm using SQL that return
Min(OrderDatetime)
From OrderTable
Where
LABCode = XXX
I've now been ask to return the value of this lab result.
Question: How do I write an SQL expression that return the Lab value of the Min(OrderDatetime)
Example Data
PATID* LABID * OrderDatetime * ResultValue
Pat1*133 * 12/12/2013 11:00:pm * 77
Pat1*145 * 12/12/2013 11:45:pm * 45
Pat1*147 * 12/13/2013 12:10:AM * 78
I was to return 77
Thanks
SteveHere is what I came up with but I'm getting an error -
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <,>,>= or when the subquery is used as an expression.
Any thoughts on what I'm doing wrong?
SELECT LABRESULTS.ORDER_VALUE as LabResult
FROM LABRESULTS, ORDERS_PROD, PATIENT_HSP
WHERE
"ORDERS_PROD"."CSN_ID" = "LABRESULTS"."CSN_ID" AND
"ORDERS_PROD"."ORDER_PROC_ID" = "LABRESULTS"."ORDER_PROC_ID" AND
ORDERS_PROD.ORDER_INST IN (
SELECT Min(ORDERS_PROD.ORDER_INST)
FROM ORDERS_PROD
WHERE "PATIENT_HSP"."CSN_ID" = "ORDER_PROD"."CSN_ID" AND
("ORDERS_PROD"."ORDER_STATUS_C"<>4 OR
"ORDERS_PROD"."ORDER_STATUS_C"<>9) AND
"ORDERS_PROD"."FUTURE_OR_STAND" IS NULL AND
"ORDERS_PROD"."REASON_FOR_CANC_C" IS NULL AND
("ORDERS_PROD"."PROC_CODE" = 'LAB7764' OR
"ORDERS_PROD"."PROC_CODE" = 'LAB7765' OR
"ORDERS_PROD"."PROC_CODE" = 'LAB7766' OR
"ORDERS_PROD"."PROC_CODE" = 'LAB7767') -
Dear All
Plz see below comments of Sujay.. can any one tell me is there any other sollution for that? plz note, while i am trying to use 501 MVT with ZSPR there is no FI doccument generated but if i use ROH material, then fi doc generated with value.. why and how it is happening?
plz advice
Subject: Re: maintaining spares returned
Message: As per your mentioned specification what i see is material type ZSPR is a valuated material, so in that case if you doing reverse movement 202 wrt 201 then it should cancel the effect of 10.00 RS, which the system is doing correctly.
Now coming to your question if you want to return the material to your respective store without any valuation, then why don't you do 501 movement.
BRthanks for clarification.
however it will not change the answer in general.
return from user departments are usually done with 202 movement, 501 is usually used for receipts from external vendors without having a PO.
In any case the movements will be valuated with the price in the material master, if the material type is quantity and value managed.
There is only one option to return at zero value: make the field fo external valuation in the movement optional, and try then to enter a zero manually while executing the movement. This will post the movement with no value and reduce the MAP of the material accordingly.
But this is pretty dangerous as you will not really have a control about the use of this field, any user can enter any value and will effect the material prices. -
Updating a table with a query that return multiple values
Hi,
I'm trying to update a table which contain these fields : ItemID, InventoryID, total amounts
with a query that return these values itemId, inventoryid and total amounts for each items
Mind you, not all the rows in the table need to be updated. only a few.
This what i wrote but doesn't work since the query return multiple values so i can't assign it to journalAmounts.
UPDATE [bmssa].[etshortagetemp]
SET JournalAmounts = (SELECT sum(b.BomQty) FROM [bmssa].[Bom] b
JOIN [bmssa].[SalesLine] sl ON sl.ItemBomId = b.BomId
JOIN [bmssa].[SalesTable] st ON st.SalesId = sl.SalesId
WHERE st.SalesType = 0 AND (st.SalesStatus IN (0,1,8,12,13)) AND st.DataAreaId = 'sdi'
GROUP BY b.itemid, b.inventdimid)
Any advise how to do this task?Remember that link to the documentation posted above that explains exactly how to do this. When you read it which part exactly were you having trouble with?
-
IE/ExternalInterface do not return any value if movie added with appendChild
There is a problem with IE/ExternalInterface if movie is added to DOM f.ex appendChild. JavaScript functions are called but they do not return any value.
MS first response was that this is 3rd party/Adobe problem.
Fixing this with innerHTML is not the solution. Using here Any suggestions ?
Simplified test case has
var flashMovie = '<OBJECT id="testId" codeBase="http://fpdownload..
// Works in IE and FF
document.getElementById("testdiv").innerHTML = flashMovie;
// ExternalInterface.call calls JS but does not return value in IE. Works in FF
var tempDiv = document.createElement("div");
tempDiv.innerHTML = flashMovie;
document.body.appendChild(tempDiv);
Here is complete code
http://pastebin.com/fbc0aa9a
Here is AS3 code in for ajax.swf
http://pastebin.com/d4efd47b
-HYou are right about that duplicate id of the movie in this example, but that is not case here.
I appreciate if you try this and confirm that problem exist or any work-around.
Here is more explanation to original post:
In HTML is JavaScipt
function fromJs()
return "text from js..";
that is called from AS3
var s = ExternalInterface.call("fromJs");
This "s" value and also ExternalInterface.objectID are null in AS3.
Here example again only with non-working case without that duplicate id with innerHTML
http://pastebin.com/f4e33af93
and also movie with AS3 code is attached.
Using plain innerHTML this case works
document.getElementById("testdiv").innerHTML = '<OBJECT..
and with appendChild does not work
var tempDiv = document.createElement("div");
tempDiv.innerHTML = "<OBJECT ..
document.body.appendChild(tempDiv); -
Error with function returning "multiple" values
Hi
i am trying to write a function to return "multiple" values
however, it returned the following error during compilation
Compilation errors for FUNCTION sch1.myfn
Error: PLS-00382: expression is of wrong type
Line: 19
Text: RETURN V_res;
Error: PL/SQL: Statement ignored
Line: 19
Text: RETURN V_res;
ques :
1 - is there a need to always declare a table ? as it'll only return a single record with multiple columns
CREATE OR REPLACE TYPE result as table of result_t;
CREATE OR REPLACE TYPE result_t as object
(user varchar2(100), comments varchar2(4000));
CREATE OR REPLACE FUNCTION myfn (IN_ID IN VARCHAR2, IN_BEGIN IN DATE) RETURN result IS
type V_res_t is RECORD (user varchar2(100), comments varchar2(4000));
V_res V_res_t;
BEGIN
select a.user, a.comment
into V_res.user, V_res.comments
from view1 A,
(select distinct id,
begin_time,
max(time) over(order by time desc) max_time from view2 b
where id = IN_LOTID
and begin_time = IN_BEGIN) b
where a.id = b.id
and a.begin_time = b.begin_time
and a.time = max_time
and a.id = IN_ID
and a.begin_time = IN_BEGIN;
RETURN V_res; --> this is the line that the system keep complaining
END;
Note : pls ignore whether the return results is correct but i am expecting it to always return a single row
pls advise
tks & rgdsAnd if you really want to return a type as a table of, work with PIPELINED function :
SQL> CREATE OR REPLACE TYPE result_t as object
2 (user# varchar2(100), comments varchar2(4000));
3 /
Type created.
SQL> CREATE OR REPLACE TYPE result as table of result_t;
2 /
Type created.
SQL>
SQL> CREATE OR REPLACE FUNCTION myfn (IN_ID IN VARCHAR2, IN_BEGIN IN DATE) RETURN result
2 pipelined is
3 user# varchar2(100);
4 comments varchar2(4000);
5 BEGIN
6 pipe row (result_t(user#,comments));
7 return;
8 END;
9 /
Function created.
SQL>PS: there is non sense to use pipelined function in my example, it is just an example to return a type as table.
Nicolas. -
My cursor is acting erratic sometimes. What can I do to get the cursor to stop acting this way.
Here is a support article that provides troubleshooting steps for an erratic trackpad - maybe this will be helpful for you:
Trackpad or Magic Trackpad is jumpy or erratic - Apple Support
Cheers,
GB -
I've set up a ViewLink between two ViewObjects and exposed an accessor on the parent. The ADF framework defines this accessor as returning oracle.jbo.RowIterator, the actual implementation class that is returned seems to be oracle.jbo.server.ViewRowSetImpl. I would like to know if I can rely on this being the return type (I guess probably not!).
What I am trying to do is:
1) From a row in the parent use the ViewLink accessor get detail rows (I want to do this without defining the relationship in the Data Model, I've seen this refered to as 'row-level master-detail').
2) Store these detail rows (defined as RowIterator, actually a ViewRowSetImpl) in a collection in the ApplicationModule
3) In a later request have the potential to search within the detail rows.
I intend to search within the detail rows by applying ViewCriteria to their corresponding ViewObject, however in order to do this I have to rely on them being in a ViewRowSetImpl and make sure the query parameters are bound.
e.g. In an App Module method, (_viewStack being my collection)
ViewRowSetImpl vrsi = (ViewRowSetImpl) _viewStack.peek();
Object[] params = vrsi.getParameters(true);
ViewObject vo = vrsi.getRowSet().getViewObject();
vo.setWhereClauseParams(params);
....Apply Criteria to vo and reexecute.I've done a quick test and this approach seems to work. I don't like having to do the cast though. Any thoughts ?
ThanksWe've been doing it like that for years.
If the VL is one-to-many, you will always get a RowIterator back.
Since a VL is basically a master RowIterator controlling a detail RowSet, I believe it's safe to do something like you (and we) do.
Sascha -
Help with modal dialog returning a value to the calling page
Greetings,
Apex Version: 4.1.0.0.32
What I am trying to do is to create a modal dialog that is called from a form page. The dialog will present the user with an IR report that will allow the him to select a row and return a value from that row to a field on the calling page. I have it working in Firefox, but I get an error using IE 8. I hope someone can show me why it is not working in IE.
Here is how I am doing it:
From the calling page:
Created a button
Action: Redirect to URL
URL Target: javascript:var rc = window.showModalDialog('f?p=&APP_ID.:70:&SESSION.::&DEBUG.:::','','resizable:yes;center:yes;dialogWidth:1000px;dialogHeight:500px;');
On the called page:
The called page is an IR report where the query returns this as one of the columns:
*(Note: I had to put a dot '.' in front of the onclick to get it to show in this thread. It is not there in my real code.)*
select
<a href="#" name="z" style="color:blue; text-decoration:underline;" .onclick="javascript:passBack(''' || LOT_NO ||''');">Select</a>' SelectThis
, column1
, column2
from sometablename;This resolves the anchor to:
<a .onclick="javascript:passBack('232158');" href="#">Select</a>Here is the Javascript function that is called from the anchor onclick:
function passBack(passVal1)
opener.document.getElementById("P75_ITEM1").value = passVal1;
close();
}When I run this in Firefox, it works as expected. I click on the button on the parent page. The modal dialog is opened and the IR report is displayed. I click on one of the links in the report and it returns the correct value back to the calling page and closes the modal dialog.
When I run it in IE8, it fails. I click on the button on the parent page. The modal dialog is opened and the IR report is displayed. I click on one of the links in the report and I get this error: “opener.document is null or not an object”.
I hope that is clear and that someone can help.
Thanks
LarryA quick google search determines that window.opener doesn't exists when using window.showModalDialog
Suggestions range from using window.open instead of window.showModalDialog to using dialogArguments instead of window.opener
Try the following:
In the parent page define a getPopupValue() function:
function getPopupValue(){
var dr = window.showModalDialog('f?p=&APP_ID.:70:&SESSION.::&DEBUG.:::','','resizable:yes;center:yes;dialogWidth:1000px;dialogHeight:500px;');
if ( (dr != undefined) && (dr != '') && (dr != false) ){
$x("P75_ITEM1").value = dr;
}Change the button url to call the function:
javascript:getPopupValue(); On the popup page change the passback function to:
function passBack(passVal1)
returnValue = passVal1;
close();
} -
Applescript returns incorrect value with blank cell
Imagine there is a column of numbers, some which might have the value 0.0 and some which are blank. Imagine wanting to append a data set at the first blank cell using Applescript. As Applescript is currently implemented in Numbers, this is not possible. See the following test.
1. In Numbers, create a new blank spreadsheet.
2. Select cell "A1".
3. Format as text.
4. Execute the following line of Applescript,
tell application "Numbers" to get value of cell "A1" of table 1 of sheet 1 of front document
It returns "0.0".
I would expect a return "" since it is a empty cell formated as text, no less.
Because of this, there is no way to find a blank cell since a blank cell returns a value of 0.0 which might be a valid entry.
Anyone have any ideas for a work around?The value of a blank (empty) cell IS zero.
The value of a cell containing a string whose length is zero contains "".
Given that, I will post a report because I'm not sure than the value returned in AppleScript is the good choice.
In AppleWorks for a blank cell, the returned value was "".
Yvan KOENIG (from FRANCE dimanche 11 janvier 2009 16:31:35)
+Your tracking number for this issue is Bug ID# 6487875.+
Hello
+(1) May I know if the fact than+
+set v to value of cell "B12"+
+returns 0.0 when the cell is blank is the designed result.+
+In AppleWorks in this case, we are accustomed to get an empty string.+
+(2) In version 1, a cell containing an empty string was accepted in an arithmetic operation.+
+In version 2, it is rejected.+
+Is it a design choice or is it a bug ?+
+Your tracking number for this issue is Bug ID# 6487879.+
Hello
+In Numbers, as long as we are referencing cells of the current row (200 for instance), we may use short references like:+
=(BC)*(DE)
+When we save as iWork '08 document, the formula is expanded as+
=(B200C200)*(D200E200)
+Is it a design choice or a bug ?+
Maybe you are looking for
-
Edited photos not showing up in lightroom
I am using lightroom 3 and photoshop CS5. I recently had to reinstall the programs after a hard drive failure. Prior to the reinstall, photos that I had worked on in photoshop automatically showed up in the LR3 library. I updated to the latest versio
-
Cable needed to output video to TV
I'm a complete neophyte, when it comes to using my computer to watch video in my TV. I have a MacBook, model identifier 5,2. What cables would I need to transfer video from the Mac to a TV with HDMI connectors. Can it be done?
-
Dear Expert, Please help me, how to count total page in ABAP list ? Any suggestion or idea to solve this question ? Thank you. Really appreciate your respond and solution.
-
Clinet for RFC Connection in Java Installation
hi , I am in the process of installing Java Add on for EP. I have BW installed in Client 100 But during instlaltion pls tell me teh client no i should give for RFC Connection
-
Trouble recognizing and syncing Ipad 64Gig to OS 10.4.11.
After months of normal use, one day I started having trouble syncing my Ipod 64Gig Touchscreen to my Itunes using OS 10.4.11 on my Imac. Can anyone help????