LastResult Scope in Private Functions?
The code for my app is below. I can access the data in
lastResult fine if I do the HTTPService.send() ourside of my
private function and also access lastResult outside of my private
function, however if I put the HTTPService.send() call inside my
private function I get "cannot access property of null object"
error and traces show lastResult is null. Any idea on what's
happening? My ASP page DOES return data so the null isn't a result
of no data being returned. Thanks.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Model id="paramModel">
<root>
<offeringName>Math 101</offeringName>
</root>
</mx:Model>
<mx:Script>
<![CDATA[
private function render():void{
myHTTPData.send(paramModel);
debug.text = myHTTPData.lastResult.offeringName[0];
]]>
</mx:Script>
<mx:HTTPService id="myHTTPData" method="GET"
url="
http://myServer/myASPPage.asp"
//contains actual valid URL in my version
resultFormat="e4x">
</mx:HTTPService>
<mx:Form width="819">
<mx:Button x="178" y="10" label="Button"
click="render();"/>
<mx:TextInput id="offeringName" x="10" y="10"/>
</mx:Form>
<mx:TextArea x="10" y="223" id="debug" width="712"
height="159" fontFamily="Courier New" fontSize="10" color="#4a29b4"
fontWeight="bold"/>
</mx:Application>
You need to listen for the result of your HTTPService call
and assign the returned value to your debug.text in that function.
You cannot call a HTTPService and assign the result in the same
function because Flex only supports asynchronous calls.
<mx:HTTPService id="myHTTPData" method="GET"
url="
http://myServer/myASPPage.asp"
//contains actual valid URL in my version
resultFormat="e4x" result="offeringResult(event)"">
</mx:HTTPService>
private function offeringResult(evt:ResultEvent):void {
debug.text = evt.result.offeringName[0];
Vygo
Similar Messages
-
Use private function with interface
I'm working with ActionScript 2 and wanted to use an
interface for one of my classes. However, the functions that it
would define should be private in the classes that implement the
interface. The problem is that I can't define private functions in
the interface, and if I leave off any scope in the interface
("function findAndSetInformation():Void;") and make it private in
the implementing class ("private function
findAndSetInformation():Void {...") I get the error: "The
implementation of the interface method doesn't match its
definition.WHATS UP ?? WHERE IS TEH MODERATOR ?!!!!
NO REPLY TELL NOW !!!!
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Yh:
hi,
how can i used REPLACE function with LOB database item????!!!1<HR></BLOCKQUOTE>
null -
Private function should not call
I come across a strange thing in Java while doing Inheritance :
Problem is that when we have one super class with a public function in it
and a child class calling that function with its own object then everything
works fine.
But the problem arise when we modify super class function to make it private
and add some more "println()" just to know more clearly what is happening
now compile only super class .java file and try to execute child. u will
find it also work fine but private function should not call.
example (do as follow):
Before Changes
1) SuperClass.java
public class SuperClass
public SuperClass(){} //constructor
public void fun() // public function
System.out.println("Super class function called");
2) javac SuperClass.java
3) ChildClass.java
public class ChildClass extends SuperClass
public ChildClass() {} //constructor
public static void main(String [] args)
ChildClass c1 = new ChildClass();
c1.fun();
4) javac ChildClass.java
5) java ChildClass
Output :
Super class function called
After Change
1) SuperClass.java
public class SuperClass
public SuperClass(){} //constructor
private void fun() //private function ***** CHANGED ***********
System.out.println("Super class function called");
System.out.println("Newly added line is displayed");
2) javac SuperClass.java
3) java Child
output:
Super class function called
Newly added line is displayed
Why this "Newly added line is displayed" is in output ?
Probably you will say Child.java should also compile but we haven't make any
changes in it.
And question is that if we have old binary then we can easily bridge the
data hiding concept.
Please take me out of this problem.Unlike C++, a subclass does not include all the methods/data of the super class.
Instead it is built from the sub class and all its super classes when loaded.
This means you can change a super class, or any class it refers to and the Child class is impacted by this.
The leason is always re-compile all the class which are effected by a change.
Using ant, maven or an IDE will do this.
You can plenty of stange behaviour by recompiling a parent class with compiling its children or the classes which depend on them. -
Public n private function in pl/sql
hello guyz,
i wanna create a package which contains public function and private function.
the package should contain finding highest number as one private function and lowest number as the other private function. Also i need a public function which uses the above private functions to display the result.
Your help is appreciated.Here is a sample script from where you should take the concept and implement it in your case --
satyaki>create or replace package pack_vakel
2 is
3 procedure aa(a in number,b out varchar2);
4 end;
5 /
Package created.
satyaki>
satyaki>create or replace package body pack_vakel
2 is
3 procedure test_a(x in varchar2,y out varchar2)
4 is
5 str varchar2(300);
6 begin
7 str := 'Local ->'||x;
8 y := str;
9 end;
10
11 procedure aa(a in number,b out varchar2)
12 is
13 cursor c1(eno in number)
14 is
15 select ename
16 from emp
17 where empno = eno;
18
19 r1 c1%rowtype;
20
21 str2 varchar2(300);
22 str3 varchar2(300);
23 begin
24 open c1(a);
25 loop
26 fetch c1 into r1;
27 exit when c1%notfound;
28 str2 := r1.ename;
29 end loop;
30 close c1;
31
32 test_a(str2,str3);
33 b := str3;
34 exception
35 when others then
36 b := sqlerrm;
37 end;
38 end;
39 /
Package body created.
satyaki>
satyaki>
satyaki>set serveroutput on
satyaki>
satyaki>
satyaki>declare
2 u number(10);
3 v varchar2(300);
4 begin
5 u:= 7369;
6 pack_vakel.aa(u,v);
7 dbms_output.put_line(v);
8 end;
9 /
Local ->SMITH
PL/SQL procedure successfully completed.
satyaki>
satyaki>declare
2 p varchar2(300);
3 q varchar2(300);
4 begin
5 p:= 'SMITH';
6 pack_vakel.test_a(p,q);
7 dbms_output.put_line(q);
8 exception
9 when others then
10 dbms_output.put_line(sqlerrm);
11 end;
12 /
pack_vakel.test_a(p,q);
ERROR at line 6:
ORA-06550: line 6, column 14:
PLS-00302: component 'TEST_A' must be declared
ORA-06550: line 6, column 3:
PL/SQL: Statement ignoredRegards.
Satyaki De. -
concept of private functions in oracle
Ok. Tell us more about it!Hehehe.... ;)
Op needs to spend some time for some extra words for this thread. ;)
Regards.
Satyaki De. -
What is ESOA? What is the Scope/Role for Functional Consultants in eSOA.
Hi Experts,
1) Does eSOA is a tool, application or module?
2) What is the relation between eSOA and ECC6.0?
3) What is the Scope/Role for Functional Consultants in eSOA?
4) What I have to learn in eSOA?
5) How it is useful for Functional Consultant?
6) How it is useful for Customers?
7) How much time it will take to learn eSOA?
8) Where can get the Material?
9) What all technologies I have to learn before I learn to eSOA?
I am working as a SAP HR Consultant. If I want to learn eSOA what are the pre-requisites.
I donu2019t know anything eSOA.
Please give me the answers.
Regards,
RamHi Ram,
See the answers below
> 1) Does eSOA is a tool, application or module?
ESOA is not any tool,application or module. Its a methodology/Architecture
> 2) What is the relation between eSOA and ECC6.0?
ECC 6.0 provides some Enterprises Services through enhancement packages.
> 3) What is the Scope/Role for Functional Consultants in eSOA?
FUnctional consultant should know which ENterprise Serrvices are available and which should be developed to carry out a business process.
> 4) What I have to learn in eSOA?
. Being a technical guy, there are things to be learnt like ESR, implementing designed serivces through ABAP or Java and consuming it. But being a functional guy, only awareness of what enterprise services are available and what they do and their input/output params and how they can fit into a business process is sufficient.
> 5) How it is useful for Functional Consultant?
see above
> 6) How it is useful for Customers?
Customers can move towards Service Oriented Architecture, get flexibility in changing a business process easily, maintaince cost is less
> 7) How much time it will take to learn eSOA?
depends on your skills
> 8) Where can get the Material?
lot of material in SDN
> 9) What all technologies I have to learn before I learn to eSOA?
ABAP or JAVA,ESR ( being a technical consultant) , Web Services
> I am working as a SAP HR Consultant. If I want to learn eSOA what are the pre-requisites.
you should aware of basics of service oriented architecture
If you further want to clear doubts, do write up.
Regards,
Piyush -
Calling a private function when inside another class?
Can't help it but im curious how classes seem to be able to
call private functions inside other classes. I'm mainly thinking
about the addEventListener() here. When adding a listening function
to a class, that function can be private, and yet it seems to be
called magically somehow. Or maybe its all internal? I dunno.
Anyone? :DHi Kenchu1,
You can grab a copy of the open source API here:
http://www.baynewmedia.com/download/BNMAPI10.zip
(feel free to drop by
the main site for documentation as well :) ). The main class
is the
Events class, "broadcast" method. This method broadcasts
events in a
decoupled fashion, meaning that listeners can listen to
messages that
aren't bound to a specific sender. The AS3 version works in
much the
same way except that I still haven't fully fleshed out the
cross-SWF
communication that this version can do (broadcast across all
movies on
the same computer using LocalConnection).
Basically, the broadcaster works like this:
1. Add event listener and bind to function A (called from
within the
class so the reference is available)
2. Event listener pushes this into the listener array. It was
provided
by the class so the reference is valid and is now a part of
the events
class as well.
3. Broadcast runs through all associated events when it comes
time to
broadcast and calls the function by using the array
reference:
this.listeners[message].call(classInstance,someParameter);
In other words, the class that adds the listener "allows"
the event
broadcaster to use the reference because it passes it out.
You can do
the same thing by calling:
someOtherclass.functionRef=this.privateFunction
someOtherClass is the class that will store the private
reference,
functionRef is some variable to hold the reference, and
privateFunction
is the private function. Then, in someOtherClass, you can
call:
this.fuctionRef(someParameter);
Hope this helps.
Patrick
Kenchu1 wrote:
> Patrick B,
> exactly! Something like that is what im looking for. I
have my own rather
> simple system right now with listeners and classes
calling these, but since i
> dont know how to call a private function, i had to make
all the listening
> classes functions public - something id rather avoid.
Exactly how did your
> event broadcasting system work? Oh, and we're talking
AS3 btw.
>
> How do i call a function via a reference? (to the
function? To what?)
>
http://www.baynewmedia.com
Faster, easier, better...ActionScript development taken to
new heights.
Download the BNMAPI today. You'll wonder how you ever did
without it!
Available for ActionScript 2.0/3.0. -
How do I test a private function with FlexUnit4
Hi,
How do I (If it's possible) test a private function of a class i want to test.
I really don't want to change the function to public only for testing it.
Any suggestions[2 cents better late than never?]
Instead of "private" to "protected", we tend to use "internal". Since our tests live in a "test" directory (at sibling-level to "src") and package structure is replicated, tests can access "internal" resources (methods and members).
If one follows this pattern, it leads to 2 curious consequences:
one can spot definitely-untested methods by their "private"-ness =
good (well tested) code never uses "private" =
I tend to agree with the original author, (sorry mlabriola -- your work is awesome and I never thought I'd find myself disagreeing with you but...) one does need to test private resources. Java allows one to work around the situation with the horrific kludge of using reflection to access private members. Sadly / luckily I'm insufficiently au fait with Flex's version to coax something similar.
Sadly, I'm not sure what alternatives one could have: perhaps a flag that tells the compiler/runtime whether to enforce "private"-ness which one activates during test?
2c, R. -
Error 1013 private function, Help!?
Hey i'm new to this but i've been stuck on this problem for a couple of hours now.. If anybody can see what the problem is that would be great! I've highlighted the line on which the error occurs (line 68) I have my braces correct i believe so i can not see what the problem is. Thanks.
package {
import flash.display.Sprite;
import flash.text.TextField;
import Classes.P_Circle;
import flash.events.MouseEvent;
public class Main extends Sprite {
//private properties
private var container:Sprite = new Sprite ();
private var textBox:TextField = new TextField ();
private var padding:uint = 10;
//initialization
public function Main() {
//adds a random number of images to the contatiner
this.makeImages(getRandomNumber(10,5) );
//add a mouse listener to container
this.container.addEventListener(MouseEvent.CLICK, hitObject);
//add the container to the stage
stage.addChild(this.container);
//function to draw UI and config
this.ConfigUI();
private function ConfigUI():void {
this.textBox.x = 5;
this.textBox.y = -10;
stage.addChild(textBox);
//private methods, calculator
private function hitObject(e:MouseEvent):void {
//change transparancy of circle
e.target.alpha = 0.3;
//calculates new x and y for shapes
textBox.text = 'x ' + e.target.x + '. y:' + e.target.y;
private function makeImages(nImagesToCreate:uint):void {
var obj:P_Circle = new P_Circle(1,1);
// this is to keep the circles from colliding when randomly placed
var maxCols:Number = Math.floor(stage.stageWidth - obj.width - this.padding);
var maxRows:Number = Math.floor(stage.stageHeight - obj.height - 50);
obj = null;
//loop to create as many circles as asked
for (var j:uint = 0; j < nImagesToCreate; j++) {
//place circle in random posistions
obj = new P_Circle( getRandomNumber(maxCols, this.padding), getRandomNumber )
//give it a name
obj.name = 'circle_'+j;
//add it to container for display
this.container.addChild(obj);
obj = null;
// the sprite contaienr changes its size depending on objects which are on stage
trace ('container width: ', container.width);
trace ('container height: ', container.height);
private function getRandomNumber(upperLimit:uint, lowerLimit:uint):uint {
//get random number of circles
var randomNum:Number = Math.floor(Math.random() * (1 + 10 - 5) + 5);
return randomNum;Arent i telling it to just use randomnumber values within these parameters?
private function makeImages(nImagesToCreate:uint):void {
var obj:P_Circle1 = new P_Circle1(1,1);
// this is figures out where circles are placed, keeps them on screen
var maxCols:Number = Math.floor(stage.stageWidth - obj.width - this.padding);
var maxRows:Number = Math.floor(stage.stageHeight - obj.height - 50);
obj = null; -
Pl/sql package won't allow private function
Hello,
I'm trying to make a function in a package private. Oracle gives me this message everytime I load the package.
18/2 PL/SQL: SQL Statement ignored
18/9 PLS-00231: function 'FUN' may not be used in SQL
18/9 PL/SQL: ORA-00904: : invalid identifier
If I move the function declartion into the package specification, everything works. What am I doing wrong?
Here's the (contrived) code:
create or replace package tst_pkg
is
procedure silly;
end; -- end package specification
create or replace package body tst_pkg
is
/* fun: silly function for testing */
function fun( f_num number ) return number
is
ret_val number;
begin
ret_val := f_num;
return ret_val;
end fun;
/* silly: silly procedure to test a function call in a package */
procedure silly
is
t_num number;
begin
select fun( 1 ) into t_num from dual;
end;
end; -- end package body
Thanks,
Davidcreate or replace function f_test_123 (p_num number) return number is
l_value number ;
begin
return p_num ;
end f_test_123;
create or replace package p_test_123 is
procedure p_test (p_num number) ;
end p_test_123;
create or replace package body p_test_123 is
procedure p_test (p_num number) is
l_test number ;
begin
dbms_output.enable (10000) ;
select f_test_123 (p_num) into l_test from dual ;
dbms_output.put_line ('Result = ' || to_char(l_test) ) ;
end p_test ;
end p_test_123;
show err
set serveroutput on
execute p_test_123.p_test (789)
Result = 789
PL/SQL procedure successfully completed.
I think part SQL and part is PLSQL -
Does anyone know what is the scope of the name of a "private" field in a Java class definition?
It's going to have to be the whole class because you can't declare a variable in a method as private (I think).
-
Scope of CRM functional consultant,
Hello Team
I need to know what is the scope of a CRM functional consultant in CRM eCommerce. As I know that I need to create Master data, product catalog and Transaction data.
But other than this for developing this in JAVA environment what is my scope.
What are the inputs to be provided from my side.
Revert if I'm not able to make it clear.
Thanks in advance
KaranHello Sarjit,
The Major Phases are :-
Project Initiation -Mock Demos explaining the real Time situation of SAP
Project Blueprinting Phase-Clientrequirent gathering,Fit gap analysis, Requirment mapping, BPR documentaion,
Realization -FD preparation, discussion with tech team reagrding requirements.,test case Preparation, integration issues
Testing(system Integration testing/user acceptance testing)-test execution, Integration issues , bug fixing
Go Iive
The As- Is analysis is actually done based on what the client wants at thier place and what SAP can offer.
It is mainly done to map requiremnts and find out whioch requiremnst can be done OOTB(SAP standard), configuration , customization and enhancements. It is also donw to know the effort time estimation for the enhancements objects.
The functional conusltant can do the following depending on the entry to the project and his/her exp:-
Business process requirement document
Functional specification.
Requiremnt mapping,
Requiremnt gathering
Effort estimation,.
Prtotyping for requirements.
Testing (major roles)
The major document to be used are Business process requirement documentation/ High level design dosumentation(HLD)
for the initial two phases.
For middle scale projects , the time would be min 1.5 yrs starting from project iniation to go live .It can be fast tracked if the client desires so.But these are actually dependant based on teh number of requirements that will be taken for that phase and thier criticality.
Hope this helps.
Reagrds
Sanjib -
Passing arguments scope from one function to another
Is it possible to pass the arguments structure from one
function to another when it contains unnamed arguments? It doesn't
throw an error but the values and indexes in the arguments scope
get messed up. To see what I mean, compare the two cfdumps below.
CODE
<cfset myComponent = createObject("component",
"MyComponent").init() />
<cfset myComponent.get("TypeName", "KeyA", "ValueA",
"KeyB", "ValueB") />
<cfcomponent>
<cffunction name="get" output="true">
<cfargument name="type" type="string" required="yes"
/>
<b>get() arguments</b><br />
<cfdump var="#arguments#" />
<cfset create(argumentCollection=arguments) />
</cffunction>
<cffunction name="create" output="true">
<cfargument name="type" type="string" required="yes"
/>
<b>create() arguments</b><br />
<cfdump var="#arguments#" />
</cffunction>
</cfcomponent>
CFDUMP OUTPUT
get() arguments
struct
2 KeyA
3 ValueA
4 KeyB
5 ValueB
TYPE TypeName
create() arguments
struct
2 [undefined struct element]
3 TypeName
4 KeyB
5 ValueA
TYPE TypeNamerampalli_aravind wrote:
Thanks a ton for the reply!
Well,
how do i pass the query Results?
Actually i have a database in the server and i am the client.
Client sends the id to the server. Server processes. finds the id and returns the name and other details using SQL statement:
select * from table1 where id="abc";Server should return these details back to the client.
IF no such id exists then server should send the client the following result:
//print that the given id does not exist and these are the ids and names in table1
select * from table1;How can i do it using jdbc odbc driver?
Thank you in anticipation to your reply!
Regardssee my reply to your other post.
write a server side component that opens the connection to the database, loads the ResultSet into a data structure, closes the ResultSet, and returns the data structure to the client.
the client should not be dealing directly with the database.
% -
Hi,
Is it possible scoping a private param?
Function Execute-vctest {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$false)]
[ValidateNotNullorEmpty()]
[string]$private:LogName
execute-vctest -logname "test"
That script is just failing saying it cannot find LogName...All parameters are local to the function or script they are defined in. There is no point to declaring them private. Parameters cannot be scoped.
¯\_(ツ)_/¯ -
Private function / procedure to be used with in a package
Hi All
I wanted to find out how would the definition be for a function which is defined so as to be used/called by the other functions / procedures with in a particular pakage and should not be visible/accessible for any other routine out side the package in which it is defined..
could you please advice me on this? Thanks!
SaratIt is possible: you can nest one function/procedure in another:
SQL>CREATE OR REPLACE FUNCTION sum_squares(
2 p_a IN NUMBER,
3 p_b IN NUMBER)
4 RETURN NUMBER
5 IS
6 FUNCTION square(
7 p_n IN NUMBER)
8 RETURN NUMBER
9 IS
10 BEGIN
11 RETURN p_n * p_n;
12 END square;
13 BEGIN
14 RETURN square(p_a) + square(p_b);
15 END sum_squares;
16 /
Function created.
SQL>SELECT sum_squares(3, 4) FROM dual;
SUM_SQUARES(3,4)
25Urs
Maybe you are looking for
-
Return parameter of a Webservice model in web dynpro
Hii, I have imported one webservice model in my web dynpro application. After execution, when web service returns 'NULL' ( i checked in web service navigator) but at the same time, the response node in web dynpro is NOT NULL and it is showing size 1
-
Tags: PSE6 versus Windows Live Photo Gallery
Hi, I'm a Photoshop Elements 6 user who's mostly please with the program. I've avoided the organizer because tags assigned there don't seem to show up in Windows or Live photo gallery. Does anyone know if this has been fixed for PSE8? I am interested
-
Dreamweaver CS5.5, v11.5, Build 5366 keeps crashing with Mac OS 10.7.5. This started a few weeks ago. Dreamweaver crashes at random time so I cannot pinpoint one thing that causes it. It just crashed as I was trying to adjust margins in a style sh
-
I'm trying to get into my EOM for the first time. Request for host credentials is needed, I have my HOST name but not the password. Also I am getting a message about the enterprise manager not being able to connect to the database instance.. what is
-
Why don't the messages I send in iMessage synchronize across devices?
I've tried to find something about this for a while, but everything seems to be about incoming messages. Why do my outgoing messages not show up across all my devices? I see all my incoming messages without any issues.