When to Call setNewRowState(Row.STATUS_NEW)

JDev 10.1.3.2 ADFBC
This should be simple but I can't figure out the when to call setNewRowState(Row.STATUS_NEW). I have a CreateInsert action in my page databinding and I add a new row when the page is rendered. However, I want my row to be New rather than Initialized. I tried overriding the createRow and insertRow in my VO and setting the row status there. But BC is making one more call to the setNewRowState method and setting the row to Initialized.
So, on my ViewRow, I am overriding the setNewRowState method and I am changing the status to New if Initialized is sent.
I'm sure I'm missing somthing here.
Thanks,
Tom

Hi,
if you create the row from ADF (e.g. using a button in JSF) you could get access to the current row through the binding and then set the new row state.
Frank

Similar Messages

  • Generate a surregate key only when insert a new row - (SCD1)

    Hi all,
    I´m starting with OWB (10gR2) and I'm creating a simple template dimension with SDC type 1 with one source, one target and a sequence do generate the surrogate key.
    The main properties configurations are:
    - Target property: Loading type = INSERT/UPDATE.
    - Only match the natural key between source and target.
    - Only use the sequence.nextval when inserting a new row.
    - Mapping: Set based.
    The generated code was something like this:
    {color:#000080}+MERGE INTO DIM_DEFAULT+{color}
    {color:#000080}+USING SCR_TABLE+{color}
    {color:#000080}+ON(SCR_TABLE.NATURALKEY=DIM_DEFAULT.NATURALKEY)+{color}
    {color:#000080}+WHEN MATCHED THEN+{color}
    {color:#000080}+UPDATE SET NAME=SCR_TABLE.NAME+{color}
    {color:#000080}+WHEN NOT MATCHED THEN+{color}
    {color:#000080}+INSERT(SK_DEFAULT,NATURALKEY,NAME)+ {color}
    {color:#000080}+VALUES(SQ_DIM_DEFAULT.NEXTVAL,SCR_TABLE.NATURALKEY,SCR_TABLE.NAME)+{color}
    Ok, it works fine! But the merge statement generates a new SK for each merged row even if the action is update! What I want is a new SK only when the process inserts a new row. Hard-coding, I possible solve this problem creating a function to return the nextval from a sequence and put it on the insert clause like this:
    {color:#000080}+MERGE INTO DIM_DEFAULT+{color}
    {color:#000080}+USING SCR_TABLE+{color}
    {color:#000080}+ON(SCR_TABLE.NATURALKEY=DIM_DEFAULT.NATURALKEY)+{color}
    {color:#000080}+WHEN MATCHED THEN+{color}
    {color:#000080}+UPDATE SET NAME=SCR_TABLE.NAME+{color}
    {color:#000080}+WHEN NOT MATCHED THEN+{color}
    {color:#000080}+INSERT(SK_DEFAULT,NATURALKEY,NAME)+ {color}
    {color:#000080}+VALUES(FN_SQC_NEXTVAL('SQ_DIM_DEFAULT'),SCR_TABLE.NATURALKEY,SCR_TABLE.NAME)+{color}
    Hard-coded it works fine as I need and that´s the point that I want to know:
    It´s possible perform this solution using OWB?
    I tried to use Constants but this solution doesn´t work then I tried an expression calling my sequence.nextval function but the result was:
    {color:#000080}+MERGE INTO DIM_DEFAULT+{color}
    {color:#000080}+USING (SELECT FN_SQC_NEXTVAL('SQ_DIM_DEFAULT') AS SK_DEFAULT_0,NATURALKEY,NAME FROM SCR_TABLE) AS SCR_TABLE+{color}
    {color:#000080}+ON(SCR_TABLE.NATURALKEY=DIM_DEFAULT.NATURALKEY)+{color}
    {color:#000080}+WHEN MATCHED THEN+{color}
    {color:#000080}+UPDATE SET NAME=SCR_TABLE.NAME+{color}
    {color:#000080}+WHEN NOT MATCHED THEN+{color}
    {color:#000080}+INSERT(SK_DEFAULT,NATURALKEY,NAME)+ {color}
    {color:#000080}+VALUES(SK_DEFAULT_0,SCR_TABLE.NATURALKEY,SCR_TABLE.NAME)+{color}
    It´s the same of merge the row using the SEQUENCE.NEXTVAL direct.
    Does anyone have a workaround to solve this situation?

    Hi,
    Perhaps this comes a bit late but...
    Have you tried to change attribute properties in the mapping? For simple example you have a source table in sa-stage which have to fields: code (varchar2(2), natural key) and description (varchar2(50)). You want to map those fields to target table where you have 3 fields: id (NUMBER(10), surrogate id, nextval from sequence when new row inserted), code (as from the source, natural key, the field to determine if the coming row is new or one to be merged) and description as in source table. Fields and datatypes are just for an example.
    When you have source and target tables in your mapping (and fields mapped), drag the sequence operator to the mapping and map the nextval to target table's surrogate id field.
    - Change target table operator properties:
    * loading type = UPDATE/INSERT
    * Match by constraint = no constraint
    - Change target table attribute properties for:
    * surrogate id field: Load column when updating row = no; match column when updating row = no; load column when inserting row = yes
    * natural key field(s): Load column when updating row = no; match column when updating row = yes; load column when inserting row = yes
    * all the regular fields: Load column when updating row = yes; match column when updating row = no; load column when inserting row = yes
    - change the deleting rules as you want them to be
    - Validate your mapping. If the green light is shown, the settings in field properties are suitable for merge.
    Hope this is what you wanted to get. I think this kind of solution works fine. Trigger in the table that holds and where one inserts millions of rows sounds scary...
    Regards,
    jk
    Added text: sorry about false alarm. I think that was what you did. The solution above steals the nextvals from sequence. Perhaps no-native-english-reader should be more careful when reading questions ;-)
    Edited by: jkoski on 5.11.2008 1:30

  • ExtendToolscript opens when I call script from photoshop

    Hey,
    I asked this question over in general discussions by mistake so I though I would re-ask it here.
    I have a Javascript that I have written that builds a interface of buttons in organised groups based on the contents of certain folders. Everything works fine but when you call it from photoshop and extendtoolscript isn't running it always opens it up. I have written a lot of scripts with interfaces and I have never had this problem. Its not a huge problem for me as I usually have this program open anyway but I intend to have a team of people using this script so if I could stop it somehow it would be much better.
    Has anyone experienced this before? Or perhaps knows of functions that cause extendscript to open?
    I can't see anything unusual in the script...
    Any help would be appreciated!
    Thanks,
    Mark
    var strtRulerUnits = app.preferences.rulerUnits;
    var strtTypeUnits = app.preferences.typeUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.PIXELS;
    var templatepath = "~/Desktop/BANNERS/";
    var bannerfile = ""
    var docRef = app.activeDocument;
    var fileArray = new Array();
                    var sourceFolder = Folder (templatepath + "MAIN/");
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArray.push(doc);
                var w = new Window ("dialog", "Choose a Banner");
                w.preferredSize = [400, 100];
                w.orientation = 'row';
                w.alignChildren = "left"
                w.alignChildren = [ "fill", "fill"];
                w.btnPnl = w.add('panel', undefined, 'MAIN');
                w.btnPnl.btn = w.add ("group");
                w.btnPnl.btn.alignChildren = "left"
                var buttonarray = new Array ();
                var key = {};
                for (var i = 0; i < fileArray.length ; i++) {
                    var delimeter = '/';
                    var string = String (fileArray[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");   
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    var counter = (counter + 1);
                if (fileArray.length > 6){
                        var divider = 2
                    else{
                        var divider = 1
                    var remainder = (i % divider);
                    if (remainder == 0){ 
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    key = (String (fileArray[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername );
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    function button_pressed (e)
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");   
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    var counter = (counter + 1);
                    bannerfile = new File (templatepath + "MAIN/" + buttonname + '.png');
    var fileArrayneon = new Array();
                    var sourceFolder = Folder (templatepath + "NEON/");
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArrayneon.push(doc);
                w.btnPnl = w.add('panel', undefined, 'NEON');
                w.btnPnl.btn = w.add ("group");
                var buttonarray = new Array ();
                var key = {};
                for (var i = 0; i < fileArrayneon.length ; i++) {
                    var delimeter = '/';
                    var string = String (fileArrayneon[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");   
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    var counter = (counter + 1);
                if (fileArrayneon.length > 6){
                        var divider = 2
                    else{
                        var divider = 1
                    var remainder = (i % divider);
                    if (remainder == 0){ 
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    key = (String (fileArrayneon[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername );
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    function button_pressed (e)
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");   
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    var counter = (counter + 1);
                    bannerfile = new File (templatepath + "NEON/" + buttonname + '.png');
    var fileArray180 = new Array();
                    var sourceFolder = Folder (templatepath + "180/");
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArray180.push(doc);
                w.btnPnl = w.add('panel', undefined, '180');
                w.btnPnl.btn = w.add ("group");
                var buttonarray = new Array ();
                var key = {};
                for (var i = 0; i < fileArray180.length ; i++) {
                    var delimeter = '/';
                    var string = String (fileArray180[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");   
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    var counter = (counter + 1);
                   if (fileArray180.length > 6){
                        var divider = 2
                    else{
                        var divider = 1
                    var remainder = (i % divider);
                    if (remainder == 0){ 
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    key = (String (fileArray180[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername );
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    function button_pressed (e)
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");   
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    var counter = (counter + 1);
                    bannerfile = new File (templatepath + "180/" + buttonname + '.png');
    var fileArraymisc = new Array();
                    var sourceFolder = Folder (templatepath + "MISC/");
                    var extRE = /\.(?:png|gif|jpg|bmp|tif|psd)$/i;
                    // get all files in source folder
                    var docs = sourceFolder.getFiles();
                    var len = docs.length;
                    for (var i = 0; i < len; i++) {
                                    var doc = docs[i];
                                    // only match files (not folders)
                                    if (doc instanceof File) {
                                                    // store all recognized files into an array
                                                    var docName = doc.name;
                                                    if (docName.match(extRE)) {
                                                                    fileArraymisc.push(doc);
                w.btnPnl = w.add('panel', undefined, 'MISC');
                w.btnPnl.btn = w.add ("group");
                var buttonarray = new Array ();
                var key = {};
                for (var i = 0; i < fileArraymisc.length ; i++) {
                    var delimeter = '/';
                    var string = String (fileArraymisc[i]);
                    var splitted = string.split(delimeter);
                    var thelength = ((splitted.length) - 1);
                    var bannername = splitted[thelength];
                    var delimeter = '.';
                    var splitted = bannername.split(delimeter);
                    var bannername = splitted[0];
                    var checkdelim = "%20";
                    var checkthat =  bannername.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = '%20';
                    var splitted = bannername.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var bannername = (splitted[counter] + " ");   
                    else if (counter == ((splitted.length) - 1)){
                    var bannername = (bannername + splitted[counter]);
                    else{
                    var bannername = (bannername + splitted[counter] + " ");
                    var counter = (counter + 1);
                    if (fileArraymisc.length > 6){
                        var divider = 2
                    else{
                        var divider = 1
                    var remainder = (i % divider);
                    if (remainder == 0){ 
                    w.btnPnl.btn = w.btnPnl.add ("group");
                    w.btnPnl.btn.alignChildren = "left"
                    } else {
                    //x is not a multiple of y
                    key = (String (fileArraymisc[i]));
                    w[key] = w.btnPnl.btn.add("button", undefined ,bannername );
                    w[key].alignment = 'left';
                    buttonarray.push(w[key]);
                    w.btnPnl.btn.addEventListener('click', button_pressed);
                    function button_pressed (e)
                   if (e.target.type == "button")
                    $.writeln (e.target.text + " from panel " + e.target.parent.text);
                    w.close()
                    var buttonname = e.target.text;
                    var checkdelim = " ";
                    var checkthat = buttonname.indexOf(checkdelim);
                    if (checkthat == "-1") {}
                    else {
                    var delimeter = ' ';
                    var splitted = buttonname.split(delimeter);
                    var counter = 0;
                    while (counter < splitted.length){
                    if (counter == 0){
                    var buttonname = (splitted[counter] + "%20");   
                    else if (counter == ((splitted.length) - 1)){
                    var buttonname = (buttonname + splitted[counter]);
                    else{
                    var buttonname = (buttonname + splitted[counter] + "%20");
                    var counter = (counter + 1);
                    bannerfile = new File (templatepath + "MISC/" + buttonname + '.png');
    w.show();
    if (bannerfile == ""){}
    else{
    var targetDocumentName =  docRef.name;
    var tempfile = app.open (bannerfile);
    var sourceDocumentName = app.activeDocument.name;
    var thewidth = tempfile.width;
    var theheight  = tempfile.height;
    app.activeDocument = docRef;
    docRef.resizeImage (null, theheight, null, ResampleMethod.BICUBIC);
    if ((String(thewidth)) == (String(docRef.width))){
    var thelayer = docRef.activeLayer;
    copyLayers(sourceDocumentName, targetDocumentName );
    docRef.activeLayer = thelayer;
    else {
    alert ("Document width Incorrect")  
    docRef.activeLayer.name = "main";
    var thelayer = docRef.activeLayer;
    docRef.resizeCanvas (thewidth, null, AnchorPosition.BOTTOMCENTER);
    copyLayers(sourceDocumentName, targetDocumentName );
    docRef.activeLayer = thelayer;
      imageView ("FtOn");
    function copyLayers(sourceDocumentName, targetDocumentName) {
      var sourceDoc = app.documents[sourceDocumentName];
      var targetDoc = app.documents[targetDocumentName];
      var sourceLayer, targetLayer, sourceGroup;
      if (app.activeDocument != sourceDoc) {
        app.activeDocument = sourceDoc;
    var thelayer = tempfile.layers[0];
    var layersToCopy = thelayer.name;
      if ( typeof layersToCopy === 'string' ) {
        sourceGroup = tempfile.layers[0];
        targetLayer = sourceGroup.duplicate( targetDoc, ElementPlacement.PLACEATBEGINNING )
      else if ( Object.prototype.toString.call( layersToCopy ) === '[object Array]' ) {
        for (var i = 0; i < layersToCopy.length; i++) {
          sourceLayer = sourceDoc.artLayers.getByName( layersToCopy[i] );
          targetLayer = sourceLayer.duplicate( targetDoc, ElementPlacement.PLACEATBEGINNING );
    tempfile.close(SaveOptions.DONOTSAVECHANGES);
    function imageView (view) {
        desc= new ActionDescriptor();
            ref = new ActionReference();
          if (view.length < 5){
             var viewID = charIDToTypeID( view );
          }else{
             var viewID = stringIDToTypeID( view );
          ref.putEnumerated( charIDToTypeID( "Mn  " ), charIDToTypeID( "MnIt" ), viewID );
        desc.putReference( charIDToTypeID( "null" ), ref );
       executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );

    $.writeln ( ) writes the specified text to the JavaScript Console in ExtendScript Toolkit.
    You probably need to comment out the 4 occurences of the following line, apparently used for debugging purposes:
    $.writeln (e.target.text + " from panel " + e.target.parent.text);

  • Unable to refresh page when insert the first row in viewobject

    I am using JDeveloper 10g to develop a JSP page, DataAction, AppModule and ViewObject. But when I am trying to use the following code to insert the first row, the page is not getting refresh. The quite weird thing is when I insert the second row, it returns me the first row as well as the second row. And it works well when I am trying to insert the third row, forth row....
    //code in AppModule
    ViewObject vo= this.getSampleView();
    vo.insertRow(newRow);
    vo.setNewRowState(Row.STATUS_INITIALIZED);
    vo.setAttribute("STR1", str1);
    vo.setAttribute("NUMBER1",new NUMBER(1));
    vo.setAttribute("STR2", str2);
    getTransaction().postChanges();
    getTransaction().commit();
    //Note: SampleView is a simply view created from a EnityObject mapping to a single table.
    Anybody could help me? Thanks very much!

    //The following code is the method in AppModule, which is invoked when clicks on the Add Remarks button on web page.
    public void addRemarks(String strCustCode,String strRemarks,String strUserID)
    ViewObject voRemarks1 = this.getCrmCustomerRemarksView();
    ViewObject voRemarks2 = this.getCrmCustomerRemarksView();
    NUMBER newSeq = new NUMBER();
    try
    voRemarks1.setWhereClause(" CRM_CUST_CODE ='" + strCustCode + "'");
    voRemarks1.setOrderByClause(" CRM_SEQ_NO DESC");
    voRemarks1.executeQuery();
    if (voRemarks1.getEstimatedRowCount()<1)
    newSeq = new NUMBER(1);
    else
    Row row = voRemarks1.first();
    NUMBER seq = (NUMBER)row.getAttribute("CrmSeqNo");
    newSeq = seq.add(new NUMBER(1));
    SimpleDateFormat tmpLocalFormat = new SimpleDateFormat();
    Date tmpDate = new Date();
    tmpDate = Calendar.getInstance().getTime();
    tmpLocalFormat.applyPattern("yyyy-MM-dd");
    System.out.println("NGNCM003 add Remarks with " + strCustCode + "," strRemarks "," + strUserID);
    Row newRow = voRemarks2.createRow();
    voRemarks2.insertRow(newRow);
    newRow.setNewRowState(Row.STATUS_INITIALIZED);
    newRow.setAttribute("CrmCustCode", strCustCode);
    newRow.setAttribute("CrmSeqNo",newSeq);
    newRow.setAttribute("CrmCreatedBy", strUserID);
    newRow.setAttribute("CrmRemarks", strRemarks);
    newRow.setAttribute("CrmLastModifiedBy", strUserID);
    newRow.setAttribute("CrmCreationTimestamp",tmpLocalFormat.format(tmpDate));
    newRow.setAttribute("CrmLastModificationTime",tmpLocalFormat.format(tmpDate));
    getTransaction().postChanges();
    getTransaction().commit();
    catch (Exception ex)
    throw new RuntimeException("Invalid Sequence No.");
    }

  • DLL Wrapper works when functions called out of main(), not from elsewhere?

    Hello all,
    I am currently trying the JSAsio wrapper out ( http://sourceforge.net/projects/jsasio )
    Support on this project is nearly unexisting and a lot of people seem to complain that it doesn't work well.
    It works very nicely here, I wrote a few test classes which called some functions (like playing a sound or recording it) and had no problems whatsoever.
    These test classes were all static functions and ran straight out of the main() method and printed some results to the console.
         public static void main(String[] args)
              boolean result = callFunction();
              .. end..
         public static boolean callFunction()
              initASIO();
              openASIOLine();
              return true;
         }The results were all great!
    Then I tried to implement these test classes into my swing-based applications. So I want to call these same functions, as in the test classes, as a result of any user action (for example, selecting the asio driver in a combobox) But then these asio driver functions just stop to work. I get errors saying that the ASIO driver is not available. (meaning that the dll wrapper loads the wrong asio driver or can't load one at all)
    The library path and classpath are all set correctly, exactly the same as the test classes. Even copied the test code word for word in to my swing applications but it still will not work. I am calling these functions in a new Thread, and even put them in a static methods to try and get that working. When calling these asio methods from the main() method AFTER I set up my components gives me the desired results as well. But as soon as I call these same methods (which are in the same class) from a swing event, it fails;
    public class ASIOTest
         public static void main(String[] args)
              ASIOTest test = new ASIOTest();
              test.callFunction(); // <-- WORKS
         public ASIOTest()
              initializeComponents();
         private void initializeComponents()
              frame = new JFrame();
              choices = new JComboBox();
              choices.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event)
                     // user made selection
                    new Thread(
                            new Runnable() {
                                public void run() {
                                    try
                                         callFunction(); // <-- DOES NOT WORK
                                    catch (Exception e)
                                        e.printStackTrace();
                            }).start();
         public void callFunction()
              initASIO();
              openASIOLine();
    }Is there something fundamental I am missing here?
    For what reasons can an application which uses JNI functions go wrong when working in a swing enviroment? (and out of a static context, although this does not seem to make any difference, eg. when calling these functions from static methods inside another class, inside a new thread when the user has generated an event)
    I am hoping someone could point me in the right direction :-)
    Thank you in advance,
    Steven
    Edited by: dekoffie on Apr 21, 2009 11:11 AM
    Edited by: dekoffie on Apr 21, 2009 11:16 AM

    jschell wrote:
    Two applications.
    And you probably run them two different ways.
    The environment is different so one works and the other doesn't.Thank you for your fast reply!
    Well, I am running the "updated" version from the same environment; I copied the jframe, and a jcombobox into my original test class which only ran in the java console. Consider my second code example in my original post as the "updated" version of the first code example. And as I pointed out, it works fine when I call the jni functions in the main method, but not when I call it from inside the ActionListener.
    Or am I again missing something essential by what you mean with a different environment? The classpath and the working directory is exactly the same, as is the Djava.library.path option. :-)
    Thanks again!

  • Help needed! Just want to cancel my year subscription. No answer from support via mail, noone answers when I call, support chat don't work.

    Help needed! Just want to cancel my year subscription. No answer from support via mail, noone answers when I call, support chat don't work.

    Hi there
    I'll pass your details to our Russian team and they'll contact you to assist further.
    Kind regards
    Bev

  • Why does my 3G iPhone no longer rings nor vibrates when receiving calls and text messages?

    Why does my 3G iPhone no longer rings nor vibrates when receiving calls and text messages?
    During a two weeks process, little by little I notice my phoe doesn't ring when I get a phone call.  So Far I have missed 22 calls that I am aware of.  Moreover, the phone does not alert me when I get a text message.  Sometimes I receive notice the next day that I received a call or a text message. 

    Follow the basic troubleshooting steps outlined in the user guide... reset, restore from backup, restore as new.

  • HT1414 Can anyone shed some light on my problem with iPhone 5 please? I am 'stuck' in recovery mode and do EVERYTHING that's been suggested online. (Even Apple at Bondi said 'Oh...um...oh that' doesn't sound too good.') when I called them for help.

    To say that I am livid would be the greatest understatement EVER made in the ENTIRE history of the planet. Last night my iPhone 5 decided it would go into Recovery Mode. (That is.....a Black screen showing the iTunes logo, a white 'up' arrow and with the white cable/plug at the bottom of the screen).
    (Hold onto your Samsung Galaxys people - do NOT throw/give them away when you 'update (yeh right) to an iPhone).
    So I turned it off and left it off all of last night. I arrived at work this morning to 'sync/restore' it with my computer where it asked me to install the latest version of 'whatever it is the latest version of.' HOWEVER, as I do not have the administrative rights to do such things on my work computer, I was unable to do so and now I have been riding the 'Apple Merry-Go-Round' since 0630hrs (WAST). It comes up with the following message in a window on the screen:-
    'The iPhone "iPhone" could not be restored. An unknown error occurred (14).'
    Gee - thanks for that - I'd never have known unless I saw that little window!!!! The fact that my screen has frozen and I am unable to install, sync or restore anything kind of gives it away!!!
    'Just go to the nearest Apple Store' I hear you say. That is a 'tad' hard as I work in The Pilbara Region of North West, Western Australia (for 4+ weeks at any one time) and won't be back in 'civilisation' until next Monday week (10th of Feb, 2014)........Talk about being held to ransom by technology!! I have asked other people at work (who ALL have iPhones) and when I showed them the screen (& the whole ridiculous process) they screwed their faces up as they had never seen such a thing. Some people NEVER get asked to update/install anything on their phones.....So, I have to wonder why mine 'asks me'.......constantly.
    I fear that my 'Apple' is not an apple but that it is actually a 'Lemon.'
    Hey 'Apple' - don't let me get a hold of you!!
    Oh yeh - the opening hours actually say Sun 10:00am til 4:00pm or even 6:00pm in some places.......how convenient - when you call (them on their landline FROM a landline) you get the engaged signal!

    Thanks for that 'sberman' - because my iPhone is backed-up to my work computer (only at this stage) I have had to call our IT Department in Adleaide. (4 times this morning). The last guy managed to get the phone into 'DFU Mode' - no more recovery mode screen - (kind of 'asleep' perhaps) from my understanding of same. I am awaiting a call again from IT so they can get my computer to actually recognise my iPhone on the C Drive. This also happened to  one of my colleagues in Newman (WA). She got so frustrated with the whole process that she bought another phone the next time she was in 'civilisation.' She hasn't had any problems since. (Cross fingers).
    Thanks again, Sandra2474.

  • I just downloaded the latest version of firefox (5.0). Can I delete all the older versions that are still on my drive? 2) When I call up some web sites sometimes the web site comes up 3 or 4 times...how do I stop this from happening?

    I just downloaded the latest version of firefox (5.0). Can I delete all the older versions that are still on my drive?
    When I call up some web sites sometimes the web site comes up 3 or 4 times...how do I stop this from happening? For example if I click on a link the exact same link comes up 3 or 4 times and I have to manually delete all of them but one.

    Do you organise your email into separate folders, or do you just let it accumulate in the Inbox?
    I would strongly advise you not to let it sit in the Inbox.
    When you see this happening, try right-click on the affected folder, select '''Properties''' then '''Repair Folder'''.
    Large folders (actually, a folder in Thunderbird is stored as a file, so it is sensitive to file size limits set by the underlying file system) can be problematic. This is one reason not to let messages collect in one folder. I use Thunderbird's Archive folders so that accumulated mails over several years can happily coexist because they are effectively stored in many small folders. No single mail store folder then exceeds the 2GB or 4GB sizes that have been known to stress the OS. I appreciate that current builds of Thunderbird and a modern 64-bit OS should be able to cope, but practically I find it slows down when given huge files, so I err towards a pragmatic solution; a large number of not very big files.
    Archives are searchable, and a Saved Search folder can give you a virtual composite folder allowing access to the entire Archive.

  • Why is it that when I call my MIL with FaceTime I end up calling another person?

    When I call my mother in law with FaceTime, I end up calling a total stranger. I use her number from my contacts and it is the right number, it works just fine if I make a regular phone call. Today, I called her and talked to her for some time and after a while we decided to switch to FaceTime. While on the phone with her, I pushed the FaceTime button on my screen, the call ended, FaceTime started and instead of my MIL it was a complete stranger that answered the call. What can I do to fix this problem?

    Check to see if you have an old phone number associated with this person in your address book. When you call someone on Facetime it calls ALL numbers/emails associated with that persons contact sheet! This was my problem, this stranger has my husband's old phone number!

  • Why is it that when someone calls my dad's phone, the incoming call shows up on both our screens?

    Whenever someone is calling my dad, we both get the call. It only happens when we are close. It only happens when the calls are for him. It happens even when the other person is not doing a multiple call. Does it have something to do with us having the same Wi-Fi? He has an iPhone 5 with iOS 8 and I have an iPhone 5c with iOS 8.

    It has to do with you and him sharing an Apple ID. This is not a good practice. Create a new Apple ID: http://appleid.apple.com.
    You could also go to Settings > FaceTime > iPhone Cellular Calls and turn if off, but ultimately you'll probably run into other problems down the road by sharing an ID.

  • How can I activate an old version of Photoshop that I've loaded on my new tablet? The web activation doesn't work, and when I call the number, it says it's not being used anymore. Meanwhile, I'm down to 13 days till it stops working due to not being activ

    How can I activate an old version of Photoshop that I've loaded on my new tablet? The web activation doesn't work, and when I call the number, it says it's not being used anymore. Meanwhile, I'm down to 13 days till it stops working due to not being activated. HELP?  I really need to continue using this product for my home business.It works fine not activated but the threat is that it will stop working in 13 more days if I don't get it activated, and none of the activation methods they list seem to work.

    The new serial number is to the right of your chosen download.

  • I got problem when trying to contact my iphone 4 using facetime,it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.

    i got problem when trying to call my iphone 4 using facetime with my Macbook Pro 13',it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.Help!! thank you in advance

    i got problem when trying to call my iphone 4 using facetime with my Macbook Pro 13',it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.Help!! thank you in advance

  • I cannot log onto the App Store, the page appears when I call it from the dock or the Apple menu. I can call the log-in box from the menu bar, but on signing in the spinning icon just keeps spinning,(not the beachball). Any suggestions? Using 10.6.7 and u

    I cannot log onto the App Store, the page appears when I call it from the dock or the Apple menu and I can call the log-in box from the menu bar, but on signing in the spinning icon just keeps spinning,(not the beachball).  Using 10.6.7 and up-to-date on all software. Any suggestions?

    Could be a third party app preventing you from being able to login.
    Mac App Store: Sign in sheet does not appear, or does not accept typed text
    If it's not a third party issue, follow the instructions here.
    Quit the MAS if it's open.
    Open a Finder window. Select your Home folder in the Sidebar on the left then open the Library folder then the Caches folder.
    Move the com.apple.appstore and the com.apple.storeagent files from the Caches folder to the Trash
    From the same Library folder open the Preferences folder.
    Move these files Preferences folder to the Trash: com.apple.appstore.plist and com.apple.storeagent.plist
    Same Library folder open the Cookies folder. Move the com.apple.appstore.plist file from the Cookies folder to the Trash.
    Relaunch the MAS.

  • Is anyone having problems with iPhone 5 not vibrating properly when receiving calls? It seems to vibrate once and stops?

    When receiving a call, my phone only vibrates once even if its on silent or not. I have checked all the settings and all appears ok. It works sometimes and doesn't other times. Does anyone know how this can be fixed?
    Thanks

    Maybe your buzzer gets stuck when it vibrates? Try playing it by creating a custom vibration. Does it keep working properly then?
    If that works, try setting up another vibration that should be played when someone calls you.

Maybe you are looking for

  • Can Connect to PC AIM Users and Have Audio but No Video, But Worked Before!

    Hi all, I know this has been answered a thousand times in a thousand ways, but I still can't make it work. I purchased a MacBook with built-in iSight using OS X 10.4.11. For the first three months of use, I logged into AIM through iChat and was able

  • Cannot print PDF with selectable text from Chrome

    Hi All Fairly recently (since the last chrome update?) I cannot select text in my PDFs printed from Chrome (on my windows 7 machine). Previously, I had discovered the workaround (print using printer dialog) that is outlined here Google Chrome | Canno

  • Help With Tools & Highlighting in new Adobe Reader

    Can anyone help me find the tool menu and highlight function in he new Adobe Reader.  When I bring up an online document it no longer has the tool menu option.  There also used to be the adobe logo that you could click on to bring up the tool menu. 

  • MacBook Pro unable to recognise installed driver for Huawei E1762 USB Modem

    Model Name: MacBook Pro / Model Identifier: MacBookPro8,2  / Processor Name: Intel Core i7 running Max OS X 10.6.6 I have installed the driver for the Huawei E1762 USB Mobile Broadband Modem into my 15 inch Mac successfully.  However, the Network in

  • CATS approval through BWSP

    Hi, In EP 7 when a CATS Overtime entry is approved it gets updated immediately to the infotype. On the Workplace setup this is not happening thus the user would run CAT6 to transfer the approved entries. Is this the standard behavior of EP in terms o