Creating VO Dynamically and Copying Attributes
Hi anyone,
I've developed a SimpleSearch with LOVs that result in a multi-selection list.
Once the rows are selected, I want to carry them over and display on the next page.
I'm trying to keep it very simple, using OAFramework wizards an such but I'm struggling to get this accomplished, mostly due to lack of JAVA experience.
I was trying to follow the advice from "How to show selected rows only in tablebean" but I don't know how to create a VO dynamically and am new to JAVA (which is why I tried to keep it simple).
What I need help with desperately is:
1) The correct syntax/code for creating a simple VO dynamically - examples in the OA Dev guide are hard to follow.
2) Correct syntax/code for copying attributes using setAttribute().
3) Does this new VO appear under the BC4J Components directory? If not, how do I attach it to the table's columns?
4) Anything else I should include or watch out for?
Thanks very much.
Hi Ramkumar,
I did create a VO declaratively before but am stuck on syntax again in the AMImpl.
I'm getting the error: oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[10006 ].
Could you look at my code and see what is missing?
public void SelectItemInstance( )
CustibSummaryVOImpl vo = getCustibSummaryVO1();
CustibChangeVOImpl dvo = getCustibChangeVO1();
Row[] sourceRows = vo.getFilteredRows("SelectFlag", "Y");
// getFilteredRows returns a zero-length array if it finds no matches.
if (sourceRows != null && sourceRows.length > 0)
int numRows = sourceRows.length;
for (int i = 0; i < numRows; i++)
// For every row with a selected checkbox, we want call
// the create( ) and insert()wrapper.
Row newRow = dvo.createRow();
newRow.setAttribute("ItemInstance", sourceRows.getAttribute("ItemInstance"));
newRow.setAttribute("Item",sourceRows[i].getAttribute("Item"));
newRow.setAttribute("TagNumber",sourceRows[i].getAttribute("TagNumber"));
newRow.setAttribute("Client",sourceRows[i].getAttribute("Client"));
newRow.setAttribute("Resp",sourceRows[i].getAttribute("Resp"));
newRow.setAttribute("Service",sourceRows[i].getAttribute("Service"));
newRow.setAttribute("Project",sourceRows[i].getAttribute("Project"));
newRow.setAttribute("TCAAccount",sourceRows[i].getAttribute("TCAAccount"));
newRow.setAttribute("OrderId",sourceRows[i].getAttribute("OrderId"));
newRow.setAttribute("PartyId",sourceRows[i].getAttribute("PartyId"));
newRow.setAttribute("AccountId",sourceRows[i].getAttribute("AccountId"));
dvo.insertRow(newRow);
} // end selectItemInstance()
Thanks ever so much.
Similar Messages
-
How to create data transfer and copying requirements
Hi Gurus,
Can you tell me how to create data transfer and copying requirements in copying control for SD?
Thanks,
pAULHi John,
Go to Transaction code - VOFM.
In the menu select Data Transfer and select where you want maintain the copying requirements i.e. at the order level, delivery level etc.
Here, you can either create a new routine or change the existing routine according to your requirement.
Make sure you activate the routine (click on Edit - Activate from menu) once you are done with the routine.
REWARD POINTS IF HELPFUL
Regards
Sai -
Error while creating VO dynamically and assigning it to Table Region
Hi,
I am getting the below exception while running my OAF page
oracle.apps.fnd.framework.OAException: Programming error. Row (oracle.jbo.server.ViewRowImpl@1e) must be of type oracle.apps.fnd.framework.OARow.
I've created a dynamic VO using createViewObjectFromQueryStmt(), and used setViewUsage() on messageStyledTextBean of my table.
Couldn't find anything related to the error on forum.
Any sort of help is appreciated.Check in Corresponding VORowImpl ---
change the Import Statement -- from -
import oracle.jbo.server.ViewRowImpl; // 11i
to
import oracle.apps.fnd.framework.server.OAViewRowImpl; // R12
Hope This will help Out.. -
Create Context dynamicly and map it to ALV-Component
Hey evrybody,
I like to create a context and I want to map it to the component ALV_CONFLICT.
Creating the context is not the problem, but I tried to map the context by using the set_data method of the interface IWCI_SALV_WD_TABLE and when I try to call the view embeded the ALV_CONFLICT component I get the following mistake:
Folgender Fehlertext wurde im System E8D prozessiert: Component Usage ALV_CONFLICT Does Not Have an Active Component
Thanks so far and Kind Regards,
HenningHi,
Instantiate your component using code wizard before calling the set_data method of interface controller.
*Instatiate used controller
data lo_cmp_usage type ref to if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
data lo_interfacecontroller type ref to iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
lo_interfacecontroller->set_data( lo_node ). -
Creating parameters dynamically and calling a procedure but strange issue
Okay I have the following program that is calling a procedure(data_compare_utility)[pasted below] and data_compare_table_setup table definition and data(isert scripts) are pasted below :
DECLARE
--FP_OLD_TABLE VARCHAR2(200);
--FP_NEW_TABLE VARCHAR2(200);
--FP_DATA_COMPARE_ID NUMBER(10) := 1;
--FP_RESTRICTION_CLAUSE VARCHAR2(500) := 'WHERE W_INSERT_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'') OR W_UPDATE_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'')';
--FP_RESTRICTION_CLAUSE_4_INS VARCHAR2(500) := 'WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')';
cursor c_data_compare_table_setup
is
select table_name, old_schema_name, new_schema_name, data_compare_id, restriction_clause, restriction_clause_ins from DATA_COMPARE_TABLE_SETUP;
r_of_data_compare_table_setup c_data_compare_table_setup%rowtype;
Lv_args_4_data_compare_utility varchar2(500);
BEGIN
--FP_OLD_TABLE := 'BIAPPS_11.RAHUL_EMPLOYEES';
--FP_NEW_TABLE := 'RAHULKALRA.RAHUL_EMPLOYEES';
open c_data_compare_table_setup;
Loop
fetch c_data_compare_table_setup into r_of_data_compare_table_setup;
exit when c_data_compare_table_setup%NOTFOUND;
--exec RAHULKALRA.P_COMPARE_DATA_UTILITY
Lv_args_4_data_compare_utility := ''''||r_of_data_compare_table_setup.OLD_SCHEMA_NAME||'.'||r_of_data_compare_table_setup.TABLE_NAME||''','''||r_of_data_compare_table_setup.NEW_SCHEMA_NAME||'.'||r_of_data_compare_table_setup.TABLE_NAME||''','||r_of_data_compare_table_setup.DATA_COMPARE_ID||','''||r_of_data_compare_table_setup.RESTRICTION_CLAUSE||''','''||r_of_data_compare_table_setup.RESTRICTION_CLAUSE_INS||'''';
P_COMPARE_DATA_UTILITY(Lv_args_4_data_compare_utility);
commit;
End Loop;
dbms_output.put_line('rahul');
dbms_output.put_line(''''||r_of_data_compare_table_setup.OLD_SCHEMA_NAME||'.'||r_of_data_compare_table_setup.TABLE_NAME||''','''||r_of_data_compare_table_setup.NEW_SCHEMA_NAME||'.'||r_of_data_compare_table_setup.TABLE_NAME||''','||r_of_data_compare_table_setup.DATA_COMPARE_ID||','''||r_of_data_compare_table_setup.RESTRICTION_CLAUSE||''','''||r_of_data_compare_table_setup.RESTRICTION_CLAUSE_INS||'''');
--P_COMPARE_DATA_UTILITY('BIAPPS_11.RAHUL_EMPLOYEES','RAHULKALRA.RAHUL_EMPLOYEES',1,'WHERE W_INSERT_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'') OR W_UPDATE_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'')','WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')');
--P_COMPARE_DATA_UTILITY('BIAPPS_11.RAHUL_EMPLOYEES','RAHULKALRA.RAHUL_EMPLOYEES',1,'WHERE W_INSERT_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'') OR W_UPDATE_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'')','WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')');
close c_data_compare_table_setup;
END;
Procedure : compare_data_utility:
CREATE OR REPLACE procedure RAHULKALRA.p_compare_data_utility(fp1_old_table in varchar2, fp2_new_table in varchar2, fp3_data_compare_id in number, fp4_restriction_clause in varchar2, fp5_recrtiction_clause_4_ins in varchar2)
as
Lv_common_column_names varchar2(2000);
Lv_primary_column_name varchar2(50);
Lv_insert_data_compare_log varchar2(2000);
--Lv_counter number(10);
Lv_row_id_for_data_compare_log number(10);
Lv_old_table_record_count number(10);
Lv_old_table_rec_cnt_query varchar2(200);
Lv_new_table_record_count number(10);
Lv_new_table_rec_cnt_query varchar2(200);
begin
select max(row_id) into Lv_row_id_for_data_compare_log from data_compare_log;
Lv_old_table_rec_cnt_query := 'Select count(*) from '||fp1_old_table||' '||fp4_restriction_clause;
dbms_output.put_line(Lv_old_table_rec_cnt_query);
execute immediate Lv_old_table_rec_cnt_query into Lv_old_table_record_count;
Lv_new_table_rec_cnt_query := 'Select count(*) from '||fp2_new_table||' '||fp4_restriction_clause;
execute immediate Lv_new_table_rec_cnt_query into Lv_new_table_record_count;
dbms_output.put_line(fp5_recrtiction_clause_4_ins);
if (Lv_row_id_for_data_compare_log is null)
then
Lv_row_id_for_data_compare_log := 1;
else
Lv_row_id_for_data_compare_log := Lv_row_id_for_data_compare_log + 1;
end if;
Lv_insert_data_compare_log := 'insert into data_compare_log values('||Lv_row_id_for_data_compare_log||',''comparing data for '||fp1_old_table||' and '||fp2_new_table||''','''||fp1_old_table||''','''||fp2_new_table||''',TO_DATE('''||to_char(sysdate,'DD-MON-YY HH24:MI:SS')||''',''DD-MON-YY HH24:MI:SS''),'||fp3_data_compare_id||','||Lv_old_table_record_count||','''||'Select count(*) from '||fp1_old_table||' '||fp5_recrtiction_clause_4_ins||''','||Lv_new_table_record_count||','''||'Select count(*) from '||fp2_new_table||' '||fp5_recrtiction_clause_4_ins||''')';
dbms_output.put_line(Lv_insert_data_compare_log);
execute immediate Lv_insert_data_compare_log;
commit;
-- tested : dbms_output.put_line(Lv_insert_data_compare_log);
Lv_common_column_names := f_fetch_common_column_names(fp1_old_table,fp2_new_table,fp3_data_compare_id);
-- tested : dbms_output.put_line(Lv_common_column_names);
Lv_primary_column_name := f_extract_pkey_column_names(fp1_old_table, fp2_new_table);
dbms_output.put_line(Lv_primary_column_name);
p_compare_data(fp1_old_table,fp2_new_table,Lv_common_column_names,Lv_primary_column_name,fp4_restriction_clause,fp3_data_compare_id);
end;
CREATE TABLE RAHULKALRA.DATA_COMPARE_TABLE_SETUP
TABLE_ID NUMBER(10),
TABLE_NAME VARCHAR2(100 BYTE),
OLD_SCHEMA_NAME VARCHAR2(100 BYTE),
NEW_SCHEMA_NAME VARCHAR2(100 BYTE),
RESTRICTION_CLAUSE VARCHAR2(500 BYTE),
RESTRICTION_CLAUSE_INS VARCHAR2(500 BYTE),
DATA_COMPARE_ID NUMBER(10)
Insert into DATA_COMPARE_TABLE_SETUP
(TABLE_NAME, OLD_SCHEMA_NAME, NEW_SCHEMA_NAME, DATA_COMPARE_ID, RESTRICTION_CLAUSE, RESTRICTION_CLAUSE_INS)
Values
('W_CHNL_TYPE_D', 'BIAPPS_11', 'RAHULKALRA', 1, 'WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')', 'WHERE W_INSERT_DT >= TO_DATE(''''''''01/JAN/2012'''''''',''''''''DD/MON/YYYY'''''''') OR W_UPDATE_DT >= TO_DATE(''''''''01/JAN/2012'''''''',''''''''DD/MON/YYYY'''''''')');
Insert into DATA_COMPARE_TABLE_SETUP
(TABLE_NAME, OLD_SCHEMA_NAME, NEW_SCHEMA_NAME, DATA_COMPARE_ID, RESTRICTION_CLAUSE, RESTRICTION_CLAUSE_INS)
Values
('RAHUL_EMPLOYEES', 'BIAPPS_11', 'RAHULKALRA', 1, 'WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')', 'WHERE W_INSERT_DT >= TO_DATE(''''''''01/JAN/2012'''''''',''''''''DD/MON/YYYY'''''''') OR W_UPDATE_DT >= TO_DATE(''''''''01/JAN/2012'''''''',''''''''DD/MON/YYYY'''''''')');
I am facing the following error for this command when I call P_compre_data_utility procedure from my anonymous block:
P_COMPARE_DATA_UTILITY(Lv_args_4_data_compare_utility); -- the error is pasted below
if I do a dbms_output.put_line(Lv_args_4_data_compare_utility) and then copy paste its output and call P_COMPARE_DATA_UTILITY, the procedure is getting executed, here is that command :
P_COMPARE_DATA_UTILITY('BIAPPS_11.RAHUL_EMPLOYEES','RAHULKALRA.RAHUL_EMPLOYEES',1,'WHERE W_INSERT_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'') OR W_UPDATE_DT >= TO_DATE(''01/JAN/2012'',''DD/MON/YYYY'')','WHERE W_INSERT_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''') OR W_UPDATE_DT >= TO_DATE(''''01/JAN/2012'''',''''DD/MON/YYYY'''')');
Error:
ORA-06550: line 27, column 7:
PLS-00306: wrong number or types of arguments in call to 'P_COMPARE_DATA_UTILITY'
ORA-06550: line 27, column 7:
PL/SQL: Statement ignored
Question : just want to know whats wrong with : P_COMPARE_DATA_UTILITY(Lv_args_4_data_compare_utility);
please help me.
Regards
RahulMac_Freak_Rahul wrote:
Hi All,
I am really sorry, my head is so aching since I am not a regular plsql coder and to save my life I need to write this code for data comparison between 2 tables .. further sorry about calling p_data_compare utility stupidly : P_COMPARE_DATA_UTILITY(Lv_args_4_data_compare_utility);
I am calling it now using :
execute immediate 'exec P_COMPARE_DATA_UTILITY('||Lv_args_4_data_compare_utility||')';If you are sure the call works then, exec would not work since it is a SQLPLUS command.
try
execute immediate 'BEGIN P_COMPARE_DATA_UTILITY(''||Lv_args_4_data_compare_utility||''); END;';
PS: I can manually give table names to my utility , just need 60 tables to compare but would be great if I can work it out this eay.
2) I can sound very stupid since my head is aching I am not a regular plsql coder but from now on I would be one, please helpJust for your sake, to Compare 60 tables (Supposing you just want to verify count of records), you are writing an entire procedure; You might have completed this activity by now doing the manual way. By taking this way, you are investing time to generate a correct code (as you just mentioned not being a regular plsql developer) you are stuck with some un-identifiable issues.
As an alternate way, I would suggest you to export the data, after ordering, into a spreadsheet and then validate. Also, since it looks like you are comparing the data in the same database between schemas, you can also use the SQL Navigators Data Compare utility and there are many more readily available in market.
I would wish you the best if you still prefer taking the approach. -
Create buld user and modify attributes
Hi
I just started with powershell and really could need some help regarding creating bulk users accounts.
I need to create new users with the follwing attributes filled in.
GidNumer 65050
loginShell /bin/sh
mssFU30name blblblbl
uid hdfhdfhdh
uidNumber 65555
unixHomeDirectory /home/1245
I cannot find these attributes in Set-aduser.
Is there a way in powershell that I can create new users by cvs and sets the needed attributes?
Kind regards
Rene de VriesHi,
Yes, you can use the -Add (or -Replace) parameter of Set-ADUser to set these values:
http://technet.microsoft.com/en-us/library/ee617215.aspx
If you want to set these values when you create the user with New-ADUser, look into the -OtherAttributes parameter:
http://technet.microsoft.com/en-us/library/ee617253.aspx
Don't retire TechNet! -
(Don't give up yet - 12,950+ strong and growing) -
Howto create a commandLink and param-attribute in a self written renderer?
Hi guys,
I'm currently trying to write a JSF-component for a content-mangement-system.
The goal of the component is to render a HTML-page which lists all elements
of an article (with all things like text-components, pictures, headline etc.)
and provides a link for every article-element which referes the user to a
special JSF-site in which the selected article-component can be edited. For
example: the user sees the site which lists all article-elements and selects
a "edit this text-component button" from one text component. Aftter that he
would be forwarded to a "editTextComponent.jsf"-Site which loads the selected
component into a managed bean. The site "editTextComponent.jsf"-Site itself
would then provide a JSF-form which fields are binded with the managed-bean
properties. To do this I need my own component-renderer to create a special
"command link" with an additional parameter of the selected component ID
(similar to the <h:commandLink />- and <h:f:param />-Tags in a normal
JSF-site). Because I need the ID of the selcted component in the new
JSF-site.
Now I need to know how I can pass such a parameter in a renderer. In a
jsf-site I would simply do something like
<h:commandLink action="myUser.accessRequestEditTextComponent">
<h:outputText value="articleAdminPage.editThisTextComp" />
<h:f:param name="componentID" value="myTextComp.databaseID" />
</h:commandLink>
But how can I do such a thing in a JavaClass??? I already tried a thing like
public void encodeEnd(FacesContext ctx, UIComponent comp)
writer.write(" <form
action=\"../articlecomponents/createnewpiccomp.jsf\" method=\"get\">");
writer.write(" <input type=\"hidden\" name=\"position\" value=\"" +
textComponent.getID() + "\" />");
writer.write(" <input type=\"image\" src=\"" +
myUIArticle.getCreateNewIcon() + " \" />");
writer.write(" </form>");
But this is not working and it is very ugly because the url of the new site is
hard-coded (and not a "action"-attribute which can be used in the
faces-config.xml for navigation), I'm not able to pick out this attribute in
the new jsf-site and the HTML-code is also hard coded.
Can you guys give at least a little hint, a keyword to what I shall look for?
I have defintly no idea and I'm already a little bit despaired.
Greetings,
HendrikOkay, Martin from the myfaces-development-team has just anwsered my question. For all of you who have the same question: such a think that I'm trying to do is done in the "writeLink"-method in the HTMLCalenderRenderer-class of the myfaces-extensions. So take a look at this for an excelent example!
-
How to Create text file and ammend that file in SQL Server 2005
HI All,
I want to upload some Sql query ouput to .txt file. I have tried using the BCP command. I am not able to create the .txt file dynamically by running this query.
First create the bcptest.txt in File System and run the query, then its copying the data.
But I want to create .txt dynamically and wants to append the .txt data instead of overwriting.
EXEC
xp_cmdshell
'bcp "SELECT * FROM sysfiles" queryout "C:\bcptest.txt" -T -c -t,'
Ram MSBI DeveloperHi Sebastian,
I have used the query and it is working fine. but, How could i include the headers of the query also in to the Excel Sheet.
RehaanKhan. M
see the method discussed here
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/10/10/export-to-excel-with-column-names.aspx
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Creating a Dynamic Web Project from existing source?
I don't see this option in OEPE like there is in Workshop for Weblogic. All I can choose from is "Create Dynamic Web Project" which creates a new project from scratch, or "Create Java Project" which has an option in the wizard to import existing source.. however this makes it a vanilla Java project instead of a Dynamic web project.
Did the concept of importing existing code into a project not cross anyone's minds when this plugin was developed? It's as if the expectation was that everyone would use this on their own private projects and there would be no collaborative/parallel development.
What is the recommended way for creating a Dynamic Web project off of existing source code without stomping all over the existing web.xml weblogic.xml?There are many "import" scenarios, so let's break them down and lay out the support expectations:
1. A java ee project created with base Eclipse using Web Tools Platform project types. This scenario includes both the case where the project creator had OEPE installed as well as the case where there was no OEPE installed. In this case, one should use the import existing projects wizard as the project being included already has metadata that can be read directly.
2. A java ee project created with a non-Eclipse IDE or perhaps completely by hand with rudimentary tools such as notepad. Currently, the way this case is supported is by creating new projects and copying application source into them. Advanced users may be able to configure support in place, but we cannot support users with this approach as the possibility of corruption is high. We are currently working on a set of wizards that will help automate this case. These wizards will be available in the release of OEPE that's slated to ship around the end of 2009 or early 2010.
3. A project created with BEA Workshop. This case is not supported as there are a number of technologies in Workshop that have been end-of-lifed (such as Apache Beehive). Users with Workshop applications should stay with Workshop until they are able to remove dependencies on end-of-lifed technologies. At that point moving to OEPE is recommended. Unofficially (this option is not supported but may work), advanced users may be able to migrate a Workshop app to OEPE, by stripping out all Workshop metadata (.project, .classpath, .settings, etc.) and by pretending that this is scenario #2 (import of a non-Eclipse application). Don't try this if your application still have dependencies on end-of-lifed technologies.
- Konstantin -
How to create Links dynamically
Hello,
I've tried for several days to create links dynamically, and
I can't get it work out.
Here is what my application do : in a
viewstack, I create dynamically some
canvas as children of the viewstack. The number of canvas
depend on the number of items in an arraycollection.
Creation of a canvas (included in a "for" loop):
Objet_Courant = Curseur.current;
var canvas_cible:Canvas = new Canvas;
canvas_cible.id = "CN_"+i;
canvas_cible.width = 315;
canvas_cible.height = 160;
ViewStack_cible.addChild(canvas_cible);
I inject content in each canvas the same way :
var newModele:Text = new Text;
newModele.id = "MODELE_"+i;
newModele.text = (Objet_Courant.modele) as String;
canvas_cible.addChild(newModele);
And now my question (at last) : I would like to create links,
for example on the text item. The URL of the link would come from
the arraycollection, as the other datas I use.
Does anyone have a clue for this ?
Thanks in advance.I still get stuck with this problem, even several months
after... I had the same problem with creating links on images, when
I dynamically create Tilelists with images as an ItemRenderer. How
can we associate links with the images ?
Any kind of help would be great :) -
Creating listeners dynamically...
Hi,
I have an external swf that I'm loading into Flash and attempting to make some communication happen between the swf and the parent loader.
In the external swf, I have a series of events being dispatched based on which frame the user is on, i.e.:
dispatchEvent(new Event("1"));
dispatchEvent(new Event("2"));
dispatchEvent(new Event("3"));
I'm trying to create a generic listener function that will add multiple eventListeners to the stage based on an arbitrary number which will in turn listen for the events being dispatched from the external swf, like so:
function ListenForNavFromExternalAsset(sectionLength:int):void
for(var i:int = 0;i<sectionLength;i++)
var screenNum = '"' + i + '"';
stage.addEventListener(screenNum, NavToScreenFromExternalAsset, false, 0, true);
trace(screenNum);
I can see screenNum tracing out, so I know the function is executing.
However, the events are clearly not being added to the stage, as I never see the traces below, even though the external swf is definitely dispatching its events:
function NavToScreenFromExternalAsset(e:Event):void
trace("ADDED_TO_STAGE");
if(e == Event("1"))
trace("NavToScreenFromExternalAsset: ONE");
else if(e == Event("2"))
trace("NavToScreenFromExternalAsset: TWO");
//etc..
There must be a better way to do this that I'm not aware of, I've had much success in the past using dispatchEvent and capturing the event, but I'm not sure how to create listeners dynamically and listen for a dynamic string.
If anyone can suggest a path forward, I would be much oblidged.
Thx for reading,
~ChiplehYou might want to look into using the CustomEvent class. It supports passing arguments with the dispatched event, which in your case could be the numbers you want to identify. That way you could have one listener assigned to the loaded swf after it is loaded, and one event handler that reads the argument passed by the event.
Although I believe that Flash has the class somewhere, here it is...
package
import flash.events.Event;
public class CustomEvent extends Event
public var params:Object;
public function CustomEvent(type:String, params:Object, bubbles:Boolean = false, cancelable:Boolean = false)
super(type, bubbles, cancelable);
this.params = params;
public override function clone():Event
return new CustomEvent(type, params, bubbles, cancelable);
public override function toString():String
return formatToString("CustomEvent", "params", "type", "bubbles", "cancelable", "eventPhase");
Usage:
import CustomEvent;
To dispatch:
dispatchEvent(new CustomEvent("myEvent", {property: "blah", anotherProperty: 456});
To read in event handler:
function eventHandler(e:CustomEvent):void{
trace(e.params.property, e.params.anotherProperty); -
[SOLVED] Use clonezilla, or create new partitions then copy?
I'm migrating my Arch for the first time. What would you recommend for a complete newb in this area, cloning the disk with some tool like clonezilla, or creating partitions manually and copying everything over?
I saw a few threads on how to make partitions and copy stuff over, but they all leave me with uncertainties. Would cloning the hard drive be an easier option?
Last edited by trusktr (2012-04-01 21:50:09)trusktr wrote:
Hey graysky thanks for the answer. Could you also provide some insight into why not using clonezilla?
For a someone doing this for the first time ever (like me), creating the new Linux partitions seems kind of tricky. The only time I've ever created partitions was from the Arch Install CD which made them automatically. I'd imagine that I would create each partition with the same size, except for the putting all the extra space of the new hard drive into the home partition.
Best for learning now. Making a partition is easy to do. Just be sure you carefully keep track of drive letters when doing it. Plus, the last time I looked, clonezilla wasn't updated for several years and didn't support ext4. This may have changed though.
Advice: draw out on paper your partition scheme, sort of like a map. ie
/ 15 GB /dev/sda1
/boot 200 MB /dev/sda2
/var 10 GB /dev/sda3
/home <<rest of drive>> /dev/sda4
Then use a util like fdisk or gptdisk to do the partitioning itself. If using GPT, make sure to have an empty 1 MB partition for the BIOS!
https://wiki.archlinux.org/index.php/GPT
Here is a nice walk through using GPT --> https://wiki.archlinux.org/index.php/SS … DED_METHOD -
How to create Exchange dynamic distribution list using multivalue extension custom attribute
I am trying to create a dynamic distribution list using an ExtensionCustomAttribute. I am in hybrid mode with Exchange 2013. The syntax I have is this:
New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {(ExtensionCustomAttribute2 -eq 'NH')}
This works correctly on-prem. But hosted always results in an empty list. I can see in dirsync the attribute is in the hosted environment, but for whatever reason, the distribution group gets created but always come up null.
If I create a group looking at the single valued attributes, such as CustomAttribute6 -eq 'Y', it works correctly on-prem and hosted.
If anyone has any suggestions I would appreciate it.I don't think I provided enough information about the problem. Let me add some and see if it makes sense.
I have an Exchange 2013 on-premise configured in hybrid mode with Office365. For testing purposes, I have 2 users, Joe and Steve, one with the mailbox on-prem, and the other with the mailbox in the cloud. Each of them has CustomAttribute6 = 'Y'
and ExtensionCustomAttribute2 = 'NH'. Dirsync shows these users and these attributes are synced between on-prem and cloud.
Using on-prem Exchange powershell, I run the following command:
New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (CustomAttribute6 -eq 'Y')}
This correctly finds the 2 users when I query for them as follows:
$DDG = Get-DynamicDistributionGroup DG_NH
Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter | FT alias
So I then delete this DG, and recreate it this time looking at the multi-value attribute ExtensionCustomAttribute2, as follows:
New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (ExtensionCustomAttribute2 -eq 'NH')}
Replaying the query above, I can see this also works fine and finds my two users.
Next I open a new powershell and connect to Office 365 and repeat the process there.
New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (CustomAttribute6 -eq 'Y')}
This correctly finds the 2 users when I query for them.
And then delete the group and recreate it using the multi-value attribute:
New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (ExtensionCustomAttribute2 -eq 'NH')}
When I run the query this time it produces no result. Every test I try results in an empty group if I am using a multi-valued attribute in the search criteria in the cloud. If I use single valued attribute, it works fine.
I really need to be able to get multi-valued DDG's working in the cloud. If anyone has done this and has any suggestions, I would appreciate seeing what you did. And if this is the wrong forum to port this, if you can point me to a more suitable
forum I will report there.
Thanks,
Richard -
Create a dynamic attribute for each user
Hi All,
I request you all to let me know how to give an approach to the following requirement.
REQUIREMENT: I have to create a dynamic attribute in UME for each user and the read the attribute on lead selection of a table having list of Users.
On lead selection, the dynamic attribute value should be either true or false. Based on this value the rest of the application specific operations wil be taken care.
If a particular User does not have the dynamic attribute associated to it, then we need to create the same.
Looking forwarrd for your help.
Regards
Dipendra//@@begin javadoc:UMSavePropertiesByNode()
/** Declared method. */
//@@end
public boolean UMSavePropertiesByNode( )
//@@begin UMSavePropertiesByNode()
try {
if (wdContext.currentUserDataElement().getVaIUserMaint().setAttribute("com.sap.security.core.usermanagement", this.getUMPropertyName(null) + ".TableColumns", this.getPropertiesByNode())) {
wdContext.currentUserDataElement().getVaIUserMaint().save();
wdContext.currentUserDataElement().getVaIUserMaint().commit();
msg.reportMessage(IMessageTableUtilsComponent.UMPROPERTY__SAVE__FIELDS__SUCCESS, null, false);
} catch (UMException ex) {
wdContext.currentUserDataElement().getVaIUserMaint().rollback();
msg.reportMessage(IMessageTableUtilsComponent.UMPROPERTY__SAVE__FIELDS__ERROR, null, false);
return false;
return true;
//@@end
//@@begin javadoc:UMLoadFieldsProperties()
/** Declared method. */
//@@end
public petrobras.com.br.classes.FieldsTable UMLoadFieldsProperties( petrobras.com.br.classes.FieldsTable fields )
//@@begin UMLoadFieldsProperties()
String properties[] = wdContext.currentUserDataElement().getVaIUserMaint().getAttribute("com.sap.security.core.usermanagement", this.getUMPropertyName(null) + ".TableColumns");
if (Compare.getLenght(properties) > 0) {
//msg.reportWarning("[UMLoadFieldsProperties]: properties.length = " + properties.length);
for (int i = 0; i < properties.length; i++) {
int attrPos = Integer.parseInt(properties<i>.substring(properties<i>.indexOf("(") + 1, properties<i>.indexOf(")")));
String attrName = (String) properties<i>.substring(properties<i>.indexOf(")") + 1, properties<i>.indexOf("="));
int attrValue = Integer.parseInt(properties<i>.substring(properties<i>.indexOf("=") + 1, properties<i>.indexOf(";")));
Field item = fields.getField(attrName);
if (item != null) {
item.setPosition(attrPos);
item.setVisibility(WDVisibility.valueOf(attrValue));
fields.removeFieldByName(attrName);
fields.addField(item);
return fields;
//@@end
regards,
Angelo -
Create dinamic nodes and attributes
Hi Forum!
I have created a WDA with 2 views. On the START_VIEW, the user can input details from an installation. I want to display an error on the START_VIEW when a condition is false.
How I can create a node with an attribute dinamically to display this error if the message Text View is not defined on the view?
Could you give me a any sample of code, please?
Thank you very mucha and regards,
Manuel.Hi Manuel,
Pleaes try this out. This is how to create an attribute dynamically.
DATA: attribute TYPE wdr_context_attribute_info.
DATA: main_node TYPE REF TO if_wd_context_node_info.
"get main node
main_node = wd_context->get_node_info( ).
"set name for this attribute
attribute-name = 'SOME_NAME_4_ATTR'.
"set data type for this attribute
attribute-type_name = 'SOME_DATA_TYPE'.
"add attribute into context node
main_node->add_attribute( attribute_info = attribute ).
Thanks.
Regards,
Georgy Norkin
Maybe you are looking for
-
When I get a text while the phone is locked it doesn't make the designated alert sound, but it does if the phone is unlocked and in use.
-
Max no# of threads in a single session
Hi all, I have a scenario wherein I have connected to SAP from JAVA using XBP interfaces. I want to call BAPI_JOB_DEFINITION_GET concurrently in a single session using sync threads. The problem what I am facing here is, I am able to handle 15 to 20 c
-
Dear SAP Gurus, If vendor sends me the invoice with same number (against same PO) then system should give message. For this I made a tick in vendor master record - Check double invoice, but still invoices with same number (for same PO) are allowed. I
-
Do objects created in MainMenu.nib ever get dealloc'ed?
If my MainMenu.nib contains an instance of one of my classes... for example a "MyController" object... and I give that class a dealloc method... what, if anything, would cause dealloc to get called? For example, it seems like when the NSApp is quitti
-
Help with a program. GUI involved
Ok I have a homework assignment to create two combo boxes which basically will add the two combo boxes together. Each combo box has 4 different choices that are in a string array but will equal a certain amount of money. I have made constants to dete