Record and display data

What I would like to do is: display a data point every 1 sec but record the a data point every 10 sec.
I have been playing with the event case and loops to achive these but no mather what I get one or the other; I either record and display every sec or every 10 sec.
Thanks...

Guru,
why doesn't it stop?
The timeout is connected with 1000ms so it will stop after 1 sec, doesn't it?
roddy,
it's right that the event-structure does not execute if you connect the control directly (as you did).
Try to connect the control using a property node and its property value (changed).
This will trigger the event-structure.
(Maybe you should use the LabVIEW help. I'm pretty much sure there is an example in it how to programatically trigger event structures)
IMHO it's not a smart solution anyways. The idea of a event structure is to capture user events (i.e. the frontpanel activities).
In your case it'maybe better to use a timed loop with 1000ms loop time,  replace the event-structure with a case-structure, take the Rest from your modulo division and connect "Sine2" inside the case "0" of the case-structure.
When the Rest of your modulo division is != 0 then nothing happens.
Best regards,
Rainer
Message Edited by Balze on 12-18-2009 03:43 AM

Similar Messages

  • Reading the record and displaying when u select it using checkbox

    hi,
           how to read the particilar record and display it in a popup screen when u select it using checkbox and then press 'DISP' button in alv(normal alv not with oops concepts).
    like i select a row which is checked (checkbox) it and i have to read that particular record and display (value of keyfield say vbeln) details in a popup screen.

    hi,
    go through the faloowing code.
    this for normal popup.
    *& Report  ZGS_ALV_POPUP_2_SELECT
    REPORT  ZGS_ALV_POPUP_2_SELECT.
    TYPE-POOLS: slis.
    PARAMETERS: p_title TYPE sy-title default 'Sales Document:item data'.
    DATA: itab TYPE vbap OCCURS 0 WITH HEADER LINE,
          selfield TYPE slis_selfield.
    START-OF-SELECTION.
      SELECT *
        FROM vbap
        INTO TABLE itab
        UP TO 20 ROWS.
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
           EXPORTING
                i_title                 = p_title
    *           I_SELECTION             = 'X'
               I_ZEBRA                 = 'X '
    *           I_SCREEN_START_COLUMN   = 0
    *           I_SCREEN_START_LINE     = 0
    *           I_SCREEN_END_COLUMN     = 0
    *           I_SCREEN_END_LINE       = 0
    *           I_CHECKBOX_FIELDNAME    =
    *           I_LINEMARK_FIELDNAME    =
    *           I_SCROLL_TO_SEL_LINE    = 'X'
                i_tabname               = 'ITAB'
                i_structure_name        = 'VBAP'
    *           IT_FIELDCAT             =
    *           IT_EXCLUDING            =
    *           I_CALLBACK_PROGRAM      =
    *           I_CALLBACK_USER_COMMAND =
    *            is_private              =
         IMPORTING
                es_selfield             = selfield
    *            e_exit                  =
           TABLES
                t_outtab                = itab
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE i000(8I) WITH sy-subrc.
      ENDIF.
      WRITE:
             /  'Table Index : ', 20 selfield-tabindex,
            /  'Table Name  : ', 15 selfield-tabname,
            /  'Field Name  : ', 15 selfield-fieldname,
            /  'Table-Field : ', 15 selfield-sel_tab_field,
            /  'Field Value : ', 15 selfield-value.
    the falowing code is for how to put checkbox and how to display the selected recods.you combine both codes.
    *& Report  ZRP_SALES
    REPORT  ZRP_SALES NO STANDARD PAGE HEADING.
    DATA: TEMP_DATE_STR TYPE STRING.
    *DATA: TEMP_NETP LIKE VBAK-NETWR.
    DATA: TEMP_NETWR(10).
    *DATA: TEMP_VBELN LIKE VBAK-VBELN.
    DATA: CHECK TYPE C VALUE ' '.
    *DATA: WA_VBELN LIKE VBAK-VBELN.
    DATA: TEMP_DATE LIKE VBAK-ERDAT.
    *DATA: TEMP_NETP_STR TYPE STRING.
    DATA:FNAM(20), FVAL(20).
    TYPES: BEGIN OF MY_VBAK,
           VTWEG TYPE VTWEG,
           VKORG TYPE VKORG,
           SPART TYPE SPART,
           NETWR TYPE NETWR_AK,
           VBELN TYPE VBELN_VA,
           ERDAT TYPE ERDAT,
           END OF MY_VBAK.
    DATA: IT_VBAK TYPE MY_VBAK OCCURS 0 WITH HEADER LINE.
    DATA: WA_VBAK TYPE MY_VBAK.
    DATA: V_VBELN TYPE VBELN,
          V_ERDAT TYPE ERDAT.
    SELECT-OPTIONS:S_VBELN FOR V_VBELN,
                   S_ERDAT FOR V_ERDAT.
    AT SELECTION-SCREEN.
    *Check for Sales Order number to be non-initial.
      IF  S_VBELN IS INITIAL.
    *Checking for Date to be non-nitial.
        IF  S_ERDAT IS INITIAL.
          MESSAGE E003(ZRP_MSG). " Please enter either SO number or Date.
        ELSE.
    *Validating the right low values for Date select option
          SELECT SINGLE ERDAT
                 FROM VBAK INTO TEMP_DATE
                 WHERE VBELN EQ S_VBELN-LOW OR ERDAT EQ S_ERDAT-LOW.
          IF SY-SUBRC NE 0.
            MESSAGE E004(ZRP_MSG).
          ENDIF.
    *Validating the right high values for Date select option
          SELECT SINGLE ERDAT
                  FROM VBAK INTO TEMP_DATE
                  WHERE ERDAT EQ S_ERDAT-HIGH OR VBELN EQ S_VBELN-HIGH.
          IF SY-SUBRC NE 0.
            MESSAGE E005(ZRP_MSG).
          ENDIF.
        ENDIF.
      ELSE.
    *Checking for Date to be non-nitial.
        IF  S_ERDAT IS NOT INITIAL.
          MESSAGE E003(ZRP_MSG). " Please enter either SO number or Date.
        ENDIF.
    *Validating the right low values
        SELECT SINGLE VBELN
               FROM VBAK INTO S_VBELN
               WHERE VBELN EQ S_VBELN-LOW.
        IF SY-SUBRC NE 0.
          MESSAGE E001(ZRP_MSG).
        ENDIF.
    *Validating the right high values
        IF S_VBELN-HIGH IS NOT INITIAL.
          SELECT SINGLE VBELN
                  FROM VBAK INTO S_VBELN
                  WHERE VBELN EQ S_VBELN-HIGH.
          IF SY-SUBRC NE 0.
            MESSAGE E002(ZRP_MSG).
          ENDIF.
        ENDIF.
      ENDIF.
    START-OF-SELECTION.
    *First Screen.
      SET PF-STATUS 'DISP'.
      IF S_VBELN IS NOT INITIAL.
        SELECT   VTWEG VKORG SPART NETWR VBELN ERDAT
               FROM VBAK
               INTO TABLE IT_VBAK
               WHERE VBELN IN S_VBELN.
      ENDIF.
      IF S_ERDAT IS NOT INITIAL.
        SELECT  VTWEG VKORG SPART NETWR VBELN ERDAT
               FROM VBAK
               INTO TABLE IT_VBAK
               WHERE ERDAT IN S_ERDAT.
      ENDIF.
      SORT IT_VBAK BY VKORG VTWEG SPART.
    END-OF-SELECTION.
      LOOP AT IT_VBAK.
        MOVE IT_VBAK-NETWR TO TEMP_NETWR.
        MOVE IT_VBAK-ERDAT TO TEMP_DATE.
        WRITE:/6 CHECK AS CHECKBOX.
        FORMAT COLOR 1.
        WRITE: IT_VBAK-VBELN UNDER 'SALES ORDER NO.' .
        WRITE: IT_VBAK-ERDAT UNDER 'DATE'.
        FORMAT COLOR OFF.
        FORMAT COLOR 2.
        WRITE: TEMP_NETWR UNDER 'NET PRICE'.
        FORMAT COLOR OFF."TEMP_NETWR,
        FORMAT COLOR 3.
        WRITE:IT_VBAK-VKORG UNDER 'SALES ORG',
              IT_VBAK-VTWEG UNDER 'DIST CHANNEL',
              IT_VBAK-SPART UNDER 'DIVISION'.
        FORMAT COLOR OFF.
        SKIP 1.
    *FOR SUBTOTALS
        AT END OF SPART.
          SUM.
          FORMAT COLOR 5.
          WRITE:/6 'SUB TOTOAL OF NET PRICE IS :  '.
          WRITE: 32 IT_VBAK-NETWR CURRENCY 'INR'.
          FORMAT COLOR OFF.
          SKIP 2.
        ENDAT.
    *FOR GRAND TOTALS
        AT LAST.
          SUM.
          FORMAT COLOR 6.
          WRITE:/6 'GRAND TOTOAL OF NET PRICE IS :  ',
          32 IT_VBAK-NETWR CURRENCY 'INR'.
          FORMAT COLOR 6.
        ENDAT.
      ENDLOOP.
    TOP-OF-PAGE.
      FORMAT COLOR  6.
      WRITE:/8    'SALES ORDER NO.',
           27   'DATE',
           42   'NET PRICE',
           57   'SALES ORG',
           70   'DIST CHANNEL',
           87   'DIVISION'.
      FORMAT COLOR OFF.
      SKIP 1.
    *WHEN SALES ORDER IS SELECTED
    AT LINE-SELECTION.
      CASE :SY-LSIND.
        WHEN '2'.
          GET CURSOR FIELD FNAM VALUE FVAL.
          IF FNAM <> 'WA_VBAK-VBELN'.
            MESSAGE E006(ZRP_MSG).
          ELSE.
            SET PARAMETER ID 'MAT' FIELD FVAL.
            CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
      ENDIF.
        ENDCASE.
    *WHEN CLICKED ON PUSH BUTTON IN THE APPLICATION BAR
    AT USER-COMMAND.
      CASE:SY-UCOMM.
        WHEN 'DISP'.
          DO.
            CLEAR CHECK.
            CLEAR: WA_VBAK,TEMP_DATE_STR.
            READ LINE SY-INDEX FIELD VALUE CHECK
               IT_VBAK-VTWEG INTO WA_VBAK-VTWEG
    *           IT_VBAK-NETWR INTO TEMP_NETP_STR
               IT_VBAK-VBELN INTO WA_VBAK-VBELN
               IT_VBAK-ERDAT INTO TEMP_DATE_STR
               IT_VBAK-VKORG INTO WA_VBAK-VKORG
               IT_VBAK-SPART INTO WA_VBAK-SPART.
            IF SY-SUBRC <> 0.
              EXIT.
            ELSEIF CHECK = 'X'.
              FORMAT COLOR 1.
              WRITE: 8 WA_VBAK-VBELN HOTSPOT. "UNDER 'SALES ORDER NO'
              WRITE: 25 TEMP_DATE_STR." UNDER 'DATE'.
              FORMAT COLOR OFF.
    *       FORMAT COLOR 2.
    *                   WRITE: 44 TEMP_NETP_STR." UNDER 'NET PRICE'.
    *       FORMAT COLOR OFF.
              FORMAT COLOR 3.
              WRITE:44 WA_VBAK-VKORG," UNDER 'SALES ORG',
             59 WA_VBAK-VTWEG," UNDER 'DIST CHANNEL',
             72  WA_VBAK-SPART." UNDER 'DIVISION'.
              FORMAT COLOR OFF.
              SKIP 1.
            ENDIF.
          ENDDO.
      ENDCASE.
    TOP-OF-PAGE DURING LINE-SELECTION.
      CASE:SY-LSIND.
        WHEN 1.
          FORMAT COLOR  6.
          WRITE:/8    'SALES ORDER NO.',
                 25   'DATE',
    *       44   'NET PRICE',
                 44   'SALES ORG',
                 58   'DIST CHANNEL',
                 72   'DIVISION'.
          SKIP 1.
          FORMAT COLOR  OFF.
    <b>if helpful reward some points.</b>
    Message was edited by:
            suredarreddy pulimamidi

  • Re: [SunONE-JATO] Re: Using an object to store and display data

    Personally, I think there is little or no value to creating a "domain"
    object that itself relies on a JATO QueryModel internally, but hides that
    fact and requires use of BeanAdapterModel.
    It would be more appropriate (and much less work, and more scalable) to just
    derive a QueryModel subclass and add the domain-specific behavior to the
    model. In other words, what's the point of creating an object that hides
    JATO inside it when you're running in JATO to begin with? Now if the domain
    object were doing plain JDBC, and thus trying to be JATO independent, that
    would be different. However, you could still implement the Model interface
    on the object (or use BeanAdapterModel) to integrate it seamlessly with the
    View tier.
    Todd
    ----- Original Message -----
    From: "grschroeder" <grschroeder@y...>
    Sent: Wednesday, July 31, 2002 12:00 PM
    Subject: [SunONE-JATO] Re: Using an object to store and display data
    Craig,
    I think it all finally makes sense. First, your assumption is
    correct regarding the process flow. The ViewBean will interact with
    a custom Javabean which will then in turn interact with a SQL Model
    to access the database. So now let me make sure I understand what I
    need to do. Basically the custom Javabean will have a method to get
    the SQLModel. I would then invoke the setValue method on the
    SQLModel and call the appropriate execute method( e.g.,
    executeUpdate, etc. ) just like I would do from a ViewBean. Does
    this sound correct?
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    Greg,
    see below...
    grschroeder wrote:
    Thanks for the help Craig. I looked at the sample code that makes
    use of the BeanAdapterModel. Basically it looks like it allows a
    view to interact with a bean the same way it would interact with
    any
    other model. That part I think I understand.
    This is correct.
    The part I'm a little
    unclear on still is how to interface this BeanAdapterModel( which
    is
    a very basic model ) that I now have with a query model toactually
    interact with the database.
    Not sure what you mean by "interface this BeanAdapterModel ... witha
    query model". Does this mean that you have a ViewBean the interactswith
    a custom JavaBean via the BeanAdpterModel wrapper, and from the
    JavaBean you are interacting with the SQL Model?
    So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)
    SQL Model > RDBMS
    That's what I am reading anyway. Please explain this to me.
    Would I need to make direct JDBC calls
    from my custom model instead of letting JATO dynamically create
    the
    calls for me?
    If my assumptions above are correct, then the custom JavaBean cansimply
    use the SQL Model in exactly the same manner as the ViewBean,otherwise,
    if no SQL Model is involved, then yes, you need to handle JDBCdirectly,
    which is fine, if you do it "right" (connection pooling, result set
    handling, etc.).
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    I think the best approach would be to treat your Domain Objects
    (DO) as
    the Database (the enterprise tier) from JATO's perspective. You
    could
    create custom models that interface with our DO's and then the
    JATO
    Views could easily bind to the custom DO models just like anyother
    model. This should eliminate the need for pushing data/objectsfrom
    >
    view
    to model to database.
    There is a JATO class called BeanAdapterModel that might be just
    what
    you need, however, I am not experienced with using it. Maybe
    someone
    else on my team or in the community could better explain how to
    use
    >
    this
    class.
    craig
    grschroeder wrote:
    Venki,
    Thanks for the response. Actually, I'm not sure if I can answer
    all
    of your questions because those are some of the same questions
    that
    we're trying to answer ourselves. Basically, what we're trying
    to
    >do
    is incorporate our domain object model into the JATO framework.
    My
    thinking was that one way we could accomplish this was by
    storing
    >a
    Javabean object in the HTTPSession to represent an object in the
    domain model, and that the Viewbean and JATO Model could get and
    set
    data from there. If you have a better suggestion of how to
    accomplish this, I'm definitely open to hearing it.
    Thanks,
    Greg
    --- In SunONE-JATO@y..., Venki <heyvenki@y...> wrote:
    OK grschroeder , first let me get this straight:
    0. Are you going to pass this object to the model, or are u
    going
    >
    to pass the session object to the model?
    1. Is there any specific reason for this approach you are
    taking?
    2. Will there be a notification from the object u havementioned
    >to
    have the model persist the data?
    3. What about the reverse case, when the model refreshes the
    data,
    how are you going to refresh you object?
    4. The JavaBean Object that u are talking about, is it your own
    object or is it implementation of an existing JATO interface?
    ~Venki
    grschroeder wrote:I'm fairly new to JATO, but I think I now
    have
    >a
    basic understanding
    of how Viewbeans and Models interact. However, I want to
    incorporate
    the use of a Javabean object that will be stored in the HTTP
    session
    and will act as the connection between the Viewbean and Model
    instead
    of having the Viewbean and Model interact directly with each
    other.
    Basically I would like to have the Model set data in the object
    stored in the session so that the Viewbean can pull it out to
    display
    it. And vice versa, once the user modifies the data and is
    ready
    >
    to
    persist it, I would like to have the Viewbean set data in the
    object
    stored in the session so that the Model can pull it out to
    store
    >it
    in the database. I'm not sure what the best approach would be
    to
    accomplish this. Any help you could give would be greatly
    appreciated.
    Thanks,
    Greg
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    Service.
    Venki
    IT Solutions
    #6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006
    91-44-4925740(Home) 91-44-8212877(Work)
    * Luck is what happens when Preparation meets Opportunity.
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    Personally, I think there is little or no value to creating a "domain"
    object that itself relies on a JATO QueryModel internally, but hides that
    fact and requires use of BeanAdapterModel.
    It would be more appropriate (and much less work, and more scalable) to just
    derive a QueryModel subclass and add the domain-specific behavior to the
    model. In other words, what's the point of creating an object that hides
    JATO inside it when you're running in JATO to begin with? Now if the domain
    object were doing plain JDBC, and thus trying to be JATO independent, that
    would be different. However, you could still implement the Model interface
    on the object (or use BeanAdapterModel) to integrate it seamlessly with the
    View tier.
    Todd
    ----- Original Message -----
    From: "grschroeder" <grschroeder@y...>
    Sent: Wednesday, July 31, 2002 12:00 PM
    Subject: [SunONE-JATO] Re: Using an object to store and display data
    Craig,
    I think it all finally makes sense. First, your assumption is
    correct regarding the process flow. The ViewBean will interact with
    a custom Javabean which will then in turn interact with a SQL Model
    to access the database. So now let me make sure I understand what I
    need to do. Basically the custom Javabean will have a method to get
    the SQLModel. I would then invoke the setValue method on the
    SQLModel and call the appropriate execute method( e.g.,
    executeUpdate, etc. ) just like I would do from a ViewBean. Does
    this sound correct?
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    Greg,
    see below...
    grschroeder wrote:
    Thanks for the help Craig. I looked at the sample code that makes
    use of the BeanAdapterModel. Basically it looks like it allows a
    view to interact with a bean the same way it would interact with
    any
    other model. That part I think I understand.
    This is correct.
    The part I'm a little
    unclear on still is how to interface this BeanAdapterModel( which
    is
    a very basic model ) that I now have with a query model toactually
    interact with the database.
    Not sure what you mean by "interface this BeanAdapterModel ... witha
    query model". Does this mean that you have a ViewBean the interactswith
    a custom JavaBean via the BeanAdpterModel wrapper, and from the
    JavaBean you are interacting with the SQL Model?
    So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)
    SQL Model > RDBMS
    That's what I am reading anyway. Please explain this to me.
    Would I need to make direct JDBC calls
    from my custom model instead of letting JATO dynamically create
    the
    calls for me?
    If my assumptions above are correct, then the custom JavaBean cansimply
    use the SQL Model in exactly the same manner as the ViewBean,otherwise,
    if no SQL Model is involved, then yes, you need to handle JDBCdirectly,
    which is fine, if you do it "right" (connection pooling, result set
    handling, etc.).
    Thanks,
    Greg
    --- In SunONE-JATO@y..., "Craig V. Conover" <craig.conover@s...>
    wrote:
    I think the best approach would be to treat your Domain Objects
    (DO) as
    the Database (the enterprise tier) from JATO's perspective. You
    could
    create custom models that interface with our DO's and then the
    JATO
    Views could easily bind to the custom DO models just like anyother
    model. This should eliminate the need for pushing data/objectsfrom
    >
    view
    to model to database.
    There is a JATO class called BeanAdapterModel that might be just
    what
    you need, however, I am not experienced with using it. Maybe
    someone
    else on my team or in the community could better explain how to
    use
    >
    this
    class.
    craig
    grschroeder wrote:
    Venki,
    Thanks for the response. Actually, I'm not sure if I can answer
    all
    of your questions because those are some of the same questions
    that
    we're trying to answer ourselves. Basically, what we're trying
    to
    >do
    is incorporate our domain object model into the JATO framework.
    My
    thinking was that one way we could accomplish this was by
    storing
    >a
    Javabean object in the HTTPSession to represent an object in the
    domain model, and that the Viewbean and JATO Model could get and
    set
    data from there. If you have a better suggestion of how to
    accomplish this, I'm definitely open to hearing it.
    Thanks,
    Greg
    --- In SunONE-JATO@y..., Venki <heyvenki@y...> wrote:
    OK grschroeder , first let me get this straight:
    0. Are you going to pass this object to the model, or are u
    going
    >
    to pass the session object to the model?
    1. Is there any specific reason for this approach you are
    taking?
    2. Will there be a notification from the object u havementioned
    >to
    have the model persist the data?
    3. What about the reverse case, when the model refreshes the
    data,
    how are you going to refresh you object?
    4. The JavaBean Object that u are talking about, is it your own
    object or is it implementation of an existing JATO interface?
    ~Venki
    grschroeder wrote:I'm fairly new to JATO, but I think I now
    have
    >a
    basic understanding
    of how Viewbeans and Models interact. However, I want to
    incorporate
    the use of a Javabean object that will be stored in the HTTP
    session
    and will act as the connection between the Viewbean and Model
    instead
    of having the Viewbean and Model interact directly with each
    other.
    Basically I would like to have the Model set data in the object
    stored in the session so that the Viewbean can pull it out to
    display
    it. And vice versa, once the user modifies the data and is
    ready
    >
    to
    persist it, I would like to have the Viewbean set data in the
    object
    stored in the session so that the Model can pull it out to
    store
    >it
    in the database. I'm not sure what the best approach would be
    to
    accomplish this. Any help you could give would be greatly
    appreciated.
    Thanks,
    Greg
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    Service.
    Venki
    IT Solutions
    #6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006
    91-44-4925740(Home) 91-44-8212877(Work)
    * Luck is what happens when Preparation meets Opportunity.
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    >To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    To download the latest version of JATO, please visit:
    http://www.sun.com/software/download/developer/5102.html
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

  • How to acces and display datas storaged in cache for a SUP 2.0 workflow?

    HI to all.
    I have an application with a item menu which obtains data thought a online request. the result is shown is a listview.
    My problem is when my BlackBerry has no conection ( offline scenario). When I select the menu item, I obtain an error.
    How to acces and display datas storaged in cache for my MBO? I have read that I can use getMessageValueCollection in custom.js to access to my datas but once I get the datas, How can associate those datas to a Listview like a online request?? Do i have to develop my own screen in html or how?
    Thanks.

    I'm not entirely clear on what you mean by "cache" in this context.  I'm going to assume that what you are really referring to is the contents of the workflow message, so correct me if I'm wrong.  There is, in later releases, the ability to set an device-side request cache time so that if you issue an online request it'll store the results in an on-device cache and if you subsequently reissue the same online request with the same parameter values within that timeout period it'll get the data from the cache rather than going to the server, but my gut instinct is that this is not what you are referring to.
    To access the data in the workflow message, you are correct, you would call getMessageValueCollection().  It will return an object hierarchy with objects defined in WorkflowMessage.js.  Note that if your online request fails, the data won't magically appear in your workflow message.
    To use the data in the workflow message to update a listview, feel free to examine the code in the listview widgets and in API.js.  You can also create a custom listview as follows:
    function customBeforeNavigateForward(screenKey, destScreenKey) {
         // In this example, we only want to replace the listview on the "My Approvals" screen    
         if (destScreenKey == 'My_Approvals'){
              // First, we get the MessageValueCollection that we are currently operating on
              var message = getCurrentMessageValueCollection();
              // Next, we'll get the list MessageValue from that MessageValueCollection
              var itemList = message.getData("LeaveApprovalItem3");
              // Because its a list, the Value of the MessageValue will be an array
              var items = itemList.getValue();
              // Figure out how many items are in the list
              var numOfItems = items.length;
              // Iterate through the results and build our list
              var i = 0;
              var htmlOutput = '<div><ul data-role="listview" data-theme="k" data-filter="true">';
              var firstChar = '';
              while ( i < numOfItems ){
                   // Get the current item. This will be a MessageValueCollection.
                   var currItem= items<i>;
                   // Get the properties of the current item.
                   var owner = currItem.getData("LeaveApprovalItem_owner_attribKey").getValue();
                   var type = currItem.getData("LeaveApprovalItem_itemType_attribKey").getValue();
                   var status = currItem.getData("LeaveApprovalItem_itemStatus_attribKey").getValue();
                   var startDate = currItem.getData("LeaveApprovalItem_startDate_attribKey").getValue();
                   var endDate = currItem.getData("LeaveApprovalItem_endDate_attribKey").getValue();
                   // Format the data in a specific presentation
                   var formatStartDate = Date.parse(startDate).toString('MMM/d/yyyy');
                   var formatEndDate = Date.parse(endDate).toString('MMM/d/yyyy');
                   // Decide which thumbnail image to use
                   var imageToUse = ''
                        if (status == 'Pending'){
                             imageToUse = 'pending.png';
                        else if (status == 'Rejected'){
                             imageToUse = 'rejected.png';
                        else {
                             imageToUse = 'approved.png';
                   // Add a new line to the listview for this item
                   htmlOutput += '<li><a id ="' + currItem.getKey() + '" class="listClick">';
                   htmlOutput += '<img src="./images/' + imageToUse + '" class="ui-li-thumb">';
                   htmlOutput += '<h3 class = "listTitle">' + type;
                   htmlOutput +=  ' ( ' + owner + ' ) ';
                   htmlOutput += '</h3>';
                   htmlOutput += '<p>' + formatStartDate + ' : ' + formatEndDate + '</p>';
                   htmlOutput += '</a></li>';
                   i++;
              htmlOutput += '</ul></div>';
              // Remove the old listview and add in the new one.  Note: this is suboptimal and should be fixed if you want to use it in production.
              $('#My_ApprovalsForm').children().eq(2).hide();
              $('#My_ApprovalsForm').children().eq(1).after(htmlOutput);
              // Add in a handler so that when a line is clicked on, it'll go to the right details screen
              $(".listClick").click(function(){
                   currListDivID = $(this).parent().parent();
                   $(this).parent().parent().addClass("ui-btn-active");
                   navigateForward("Request_Details",  this.id );
                   if (isBlackBerry()) {
                        return;
         // All done.
         return true;

  • How can I read and display data with OR without recording at the same time?

    Hi all,
      This forum has been of much help to me, but I have a rather specific question I can't seem to find an answer to.  I am new to LabView, educating myself with tutorials, trial and error, and this forum. 
      Attached is what I have so far.  I would like to read data (three voltages) and write it to an excel file.  As written below, it will do nothing until I click the "Record" button, when it then takes data, displays it on the gauges and waveform chart, and writes it to a file.  What I would like it to do is display the data at all times, and record when I click the record button (while still displaying data being read).  I have tried to do this by moving the DAQ Assistant VI, gauges, and waveform graph outside of the loops, but when I do this, it will read until I press record, and then it simply records whatever value it's stuck on.  Sorry for the long post, thanks for any help. 
      --Nathan
    Attachments:
    Record and Write to File 2.vi ‏332 KB

    Sorry, I don't have any DAQ installed, so I won't comment on the DAQ parts.
    First of all, Your VI will do nothing until you (1) first set the record button to ON  and (2) press the start button in the tool bar. It almost seems that you are using the "continuous run" button. (Don't! That's not its purpose. Basically, it automatically restarts the program whenever it finishes). A toplevel VI should never stop during normal operation, so place a big while loop around all code and create a wait state that does nothing until you tell it to acquire.
    You don't need the inner while loop, simply place your code inside the big while loop (and accumulate your array data in an initialized shift register if really needed. Currently you do at the inner loop boundary for some reason). You have a big problem that the array can grow without bounds unless you clear the accumulated data once in a while or place it in a FIFO buffer of limited size. If you let ot grow forever like you do now, the program might run out of resources at one point in the future.
    Since you are appending to your file, maybe yo don't need any shift register, just use the data points of the current iteration. Place your save operations in a case structure and keep appending the new data to your file only if the case is true.
    It is also very inefficient to use highlevel file IO here,because each instance opens and closes the file. I recommend to open the file once outside the loop, then use low level IO to append, and close the file once the big loop is done.
    LabVIEW Champion . Do more with less code and in less time .

  • Problem in the code while fetching records and displaying in the screen

    Hi,
       I have developed a screen which is having various fields, all the records are stored in a ztable,when i enter the records into various i/o fields and press submit pushbutton they are stored in the table now, what i wont is when i enter one record the (primary one) and press enter the corresponding records of that record should be shown in the i/o fields means they should be fetched back from the d/b table and displayed on the screen. For this i Have written a code please see it once.
    TABLES : ZFISALDT.
    DATA ITAB LIKE ZFISALDT OCCURS 0 WITH HEADER LINE.
    ZFISALDT-BILLINGDOCU = ITAB-BILLINGDOCU.
    ZFISALDT-SALESDOCU = ITAB-SALESDOCU.
    ZFISALDT-FORM402 = ITAB-FORM402.
    ZFISALDT-SALESTAXFORM = ITAB-SALESTAXFORM.
    ZFISALDT-FREIGHTDOCNO = ITAB-FREIGHTDOCNO.
    ZFISALDT-FPARTYNAME = ITAB-FPARTYNAME.
    *&      Module  STATUS_5555  OUTPUT
          text
    MODULE STATUS_5555 OUTPUT.
      SET PF-STATUS 'SALALL'.
      SET TITLEBAR 'SAL'.
    ENDMODULE.                 " STATUS_5555  OUTPUT
    *&      Module  USER_COMMAND_5555  INPUT
          text
    MODULE USER_COMMAND_5555 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'SUB'.
    IF ZFISALDT-BILLINGDOCU = ' '
    OR ZFISALDT-SALESDOCU = ' '.
    MESSAGE 'PLEASE FIRST SUBMIT THE BILLING DOCUMENT NO AND SALES DOCUMENT NO' TYPE 'E'.
    ENDIF.
    ZFISALDT-BILLINGDOCU = ZFISALDT-BILLINGDOCU.
    ZFISALDT-SALESDOCU = ZFISALDT-SALESDOCU.
    ZFISALDT-FORM402 = ZFISALDT-FORM402.
    ZFISALDT-SALESTAXFORM = ZFISALDT-SALESTAXFORM.
    *ZFISALDT-FREIGHTDOCNO = ZFISALDT-FREIGHTDOCNO.
    *ZFISALDT-FPARTYNAME = ZFISALDT-FPARTYNAME.
    *SUBMIT ITAB.
    WHEN ' '.   (THIS THE PART OF CODE WHICH IS NOT WORKING)
    SELECT * FROM ZFISALDT INTO corresponding fields of TABLE ITAB WHERE BILLINGDOCU = ZFISALDT-BILLINGDOCU.
    ITAB-BILLINGDOCU = ZFISALDT-BILLINGDOCU.
    ITAB-SALESDOCU = ZFISALDT-SALESDOCU.
    ITAB-FORM402 = ZFISALDT-FORM402.
    *ZFISALDT-BILLINGDOCU = ITAB-BILLINGDOCU.
    *ZFISALDT-BILLINGDOCU = ITAB-BILLINGDOCU.
    *ZFISALDT-SALESDOCU = ITAB-SALESDOCU.
    *ZFISALDT-FORM402 = ITAB-FORM402.
    *ZFISALDT-SALESTAXFORM = ITAB-SALESTAXFORM.
    append ITAB.                                                      (ALSO USED INSERT BUT NOT WORKING)
    WHEN 'ENTER'.
    IF ZFISALDT-BILLINGDOCU = ' '
    OR ZFISALDT-SALESDOCU = ' '.
    MESSAGE 'PLEASE FIRST SUBMIT THE BILLING DOCUMENT NO AND SALES DOCUMENT NO' TYPE 'E'.
    ENDIF.
    ZFISALDT-FREIGHTDOCNO = ZFISALDT-FREIGHTDOCNO.
    ZFISALDT-FPARTYNAME = ZFISALDT-FPARTYNAME.
    ZFISALDT-FREIGHTBILLNO = ZFISALDT-FREIGHTBILLNO.
    ZFISALDT-FREIGHTDATE = ZFISALDT-FREIGHTDATE.
    ZFISALDT-TRUCKNO = ZFISALDT-TRUCKNO.
    ZFISALDT-FREIGHTAMOUNT = ZFISALDT-FREIGHTAMOUNT.
    ZFISALDT-COMNAGBILL = ZFISALDT-COMNAGBILL.
    ZFISALDT-AGENTNAME = ZFISALDT-AGENTNAME.
    ZFISALDT-CAGDATE = ZFISALDT-CAGDATE.
    ZFISALDT-CMNAGAMOUNT = ZFISALDT-CMNAGAMOUNT.
    ZFISALDT-SHIPMENTNAME = ZFISALDT-SHIPMENTNAME.
    ZFISALDT-SHIPDOCUNO = ZFISALDT-SHIPDOCUNO.
    ZFISALDT-SHIPBILLNO = ZFISALDT-SHIPBILLNO.
    ZFISALDT-SHIPBILLDATE = ZFISALDT-SHIPBILLDATE.
    ZFISALDT-BLNOGOV = ZFISALDT-BLNOGOV.
    ZFISALDT-CHAAGENTNAME = ZFISALDT-CHAAGENTNAME.
    ZFISALDT-CHABILL = ZFISALDT-CHABILL.
    ZFISALDT-CHADATE = ZFISALDT-CHADATE.
    ZFISALDT-CHAAMOUNT = ZFISALDT-CHAAMOUNT.
    ZFISALDT-B_L_NO = ZFISALDT-B_L_NO.
    ZFISALDT-B_L_NODATE = ZFISALDT-B_L_NODATE.
    ZFISALDT-DEPBLICNO = ZFISALDT-DEPBLICNO.
    ZFISALDT-LICENCE_DATE = ZFISALDT-LICENCE_DATE.
    ZFISALDT-FOC_VALUE = ZFISALDT-FOC_VALUE.
    ZFISALDT-DEPB_VALUE = ZFISALDT-DEPB_VALUE.
    INSERT ZFISALDT.
    CLEAR ZFISALDT.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_5555  INPUT
    This is the code please check it once.
    Thanks in advance.

    Hi Sumeet.
    WHEN ' '.  " (THIS THE PART OF CODE WHICH IS NOT WORKING)
    SELECT * FROM ZFISALDT INTO corresponding fields of TABLE ITAB WHERE BILLINGDOCU = ZFISALDT-BILLINGDOCU.     
    " here in where condition u r checking with ZFISALDT-BILLINGDOCU, i guess there is no value in that, Once check in debugging mode and proceed further.
    Regards,
    Aby

  • How to acquire and display data from labview to excel simultaneo​usly

    hello,
    I am using the NI-DAQ to measure the falling edges of a clock and display them into a table. What I need is to display these data in a table in excel while the program is running. In addition, when I receive a pulse from an external clock, for which I have created a digital channell, the data must be logged in a different column. In other words, every time I receive a pulse the data must be stored in the adjacent column in excel.

    Hello Evangelos,
    As far as I know and have experienced, it is not possible to access a spreadsheet file (or any file, for that matter) by two programs at the same time, you will get an error.
    Also, a couple of observations on your code:
    A constant wired to a case selector of a case structure makes no sense as the false case will never be executed.
    Move the DAQmx Read from your Digital Input task into the while loop, as the DAQmx Read will only read once and the wire won’t get information in or out of a while loop as long as the while loop is iterating.
    Regards,
    Daniel REDS
    RF Systems Engineer
    Help us grow.
    If a post solves your question, mark it as The Solution.
    If a post helps, give Kudos to it.

  • Binding and displaying data to table in webdynpro java

    hi all,
    i want to know how to bind the output values to table in webdynpro java.
    i know how to bind values in context to table,but if we want to display the values from database(back end ) and display in table present in the view.
    eg: i have table in view and want to get values from backend(SQL server) and display it in that table.
    plz help me to know ..
    thanks
    sirisha

    Hi Saisirisha,
    Try this.
    1> Take a Value Node(Employee) cardinality 0..n.
    Employee Structure
    Employee
    |------Surname(Attribute)
    |------FirstName(Attribute)
    |------Category(Attribute)
    2> Bind this value node(Employee) in the View datasource of table.
    3> Try the code inside wdDoInit method.
    try {
         // Load the JDBC-ODBC bridge
         Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
         // specify the ODBC data source's URL
         String url = "jdbc:odbc:SSPer";
         // connect
         Connection con = DriverManager.getConnection(url,"North","Ken");
         // create and execute a SELECT
         Statement stmt = con.createStatement();
         ResultSet rs = stmt.executeQuery
         ("SELECT Surname,FirstName,Category FROM Per");
         while (rs.next()) {
         // get current row values
         String Surname = rs.getString(1);
         String FirstName = rs.getString(2);
         int Category = rs.getInt(3);
         //create table row and add the value in the table
         IPrivate<Put View Name>.IEmployeeElement empElm = wdContext.createEmployeeElement();
            empElm.setSurname(Surname);
         empElm.setFirstName(FirstName);
         empElm.setCategory(Category);
         wdContext.nodeEmployee().addElement(empElm);
         // close statement and connection
         stmt.close();
         con.close();
    } catch (java.lang.Exception ex) {
         wdComponentAPI.getMessageManager().reportException("Exception : "ex.getMessage()+,true);
    http://www.developer.com/java/data/article.php/3417381
    Regards,
    Mithu

  • A MDM Scenario Regarding accessing and displaying data

    Hi All,
    If there is a scenario such that there is a Manufacturer field from Main table[ Products ], has some vaues say A, B, C, etc. A suppose belongs to India, B to USA, C to UK, etc respectively. Then how can we do this that if a user is assigned to Manufacturer A, then that user should be able to see all the values even from B and C manufacturers also, But User should be able to modify the data which belongs to manufacturer A only.
    Can Anybody please help me in this regard As to how can I achieve it in MDM.
    Edited by: Gaurav Kumar Sharma on Mar 10, 2010 11:41 AM

    Hi All,
    Is it possible??
    Create a role  that have only read access to all records and create each another roleN that have read write access to corresponding manufacture like for each manufacture there is a read write role for corresponding records(we can achieve by namedsearch).
    Finally assing user for manufacture A to both  role A and  read role
    user for manufacture B to both  roleb and read role
    (i think it take the union of both roles).
    I will try on my system tomorrow and update u on same sp for a mean time if u get cahnce please try it if it looks good,
    Please suggest something better if possible.
    Thanks,
    Sudhanshu

  • "I want to acquire and display data from 89C51 micro controller using RS 232 port"

    I am using 89c52 for data acquisition and control for photo diode array. I would like to do the same using RS-232 and micro-controller 89c52. I would like to generate two different control pulses (clock and trigger) and I am digitizing my analog data using on-board ADC, the data for which I would like to read using Labview and store it in a file also display the waveform of acquired data. Please reply.

    Nice project, we do that all day long here. What is your problem exactly?
    The 89C52 has a UART you can use to write commands and read data. It is fairly straightforward to write a command processor for the uC and implement a command set. Is it the computer or the uC that generates the control pulses?
    LabVIEW, C'est LabVIEW

  • Send Email & Save and Display Data

    I've got a simple process with a Set Value and Assign User activities and one variable to read the contents of an XDP form. The assigned user the reviews the form. This much I know works.
    From this point on, I am adding to routes to the last task: the reviewer may accept or reject the form. If it is accepted, I want the form to be saved in PDF form and displayed for the user to read and type some of that data somewhere else (I may automate this at another time). If it is rejected, I want Workspace to send an email to the process creator (the person who filled out the form--not the reviewer) indicating that there are errors or omissions to correct. Then, the form is reassigned to the process creator, who works on it and resubmits it for review.
    My questions are as follows:
    1- I'm thinking of using a Send Email service to send a short, very specific message, but I don't know how to capture the process creator's email address to use in this service. Would you any other way of doing this?
    2- I can't figure out what service to use to save the PDF and to display it for the reviewer to copy data manually into another application.
    I'm still new at this and find the available information a little cryptic. I probably don't know where to find it too. I'd appreciate any help that you can provide.
    Thank you!

    We are using JBoss but MSSQL, not MySQL.
    I also decided to change the process slightly to avoid unnecessary steps and, perhaps, this query step altogether.
    So this is what I have so far: A Set Value task to fill the form, and an Assign User to assign the form for review. Upon acceptance by the Reviewer, the form should be saved and/or printed, as selected by the Reviewer. Upon reject, it should be reassigned to the Process Creator for correction/completion. When this is done, the form should be resubmitted for review.
    The form is filled, but the Reviewer gets nothing in his queue (To Do list), even thought he's assigned in the process. The email notifications are not working correctly yet, but it should still be assigned to the Reviewer, correct? He's the Specific User in the Initial User Selection property.
    I'd appreciate any help that you can provide.
    Thanks!

  • Lookout 6.0 and Citadel 5 Slow to Connect and Display Data

    Wondering if anyone else is seeing this.
    We had a Lookout 5.1 Citadel 4 database running about 75-100 data points. We use hypertrends for viewing the trended data. In the old version, the hypertrends and historical data would be presented on the screen nearly instantaneously. We recently upgraded to Lookout 6.0 and Citadel 5. The hypertrends now take minutes to display and often times come in choppy. This is VERY inconvenient, especially when we try to connect other clients over our T1 WAN connection.....display time is VERY long.
    I don't want to update our other Lookout system to 6.0 until this issue is resolved, our other system has a database that has somewhere in the realm of 3000+ data points it is tracking, and we can't afford to lose the speed for the trending displays.
    Thanks for any input in advance.

    I complained to ni about the fact that nicitdl5 is using a lot of processor resources on the computer running the server process. As an answer I received the same bla bla ... more robust ... bla bla. The thing is that it is happening only when the client is accessing the server from the network. When they are on the same computer every thing is fine. I think it is more of a communication problem. You can use the performance monitor to graph the network activity of nicitdl5 to see that it is receiving a lot of packets while sending almost nothing. That leads me to the hypothesis that the client is making a lot of useless request (buggy hyper.cbx?) to the citadel server.
    Still, I'm reassured to see that I'm not alone facing that performance issue but I think that we'll have to wait for 6.1!

  • HELP! retrieving and displaying data with JavaBean but Page is Blank!!

    Please help. I am trying to display data for user by appending the userid as parameter in the URL but I get a blank page and nothing displays in my jsp page.
    //info.java
    package database;
    public class Info{
    private String user;
    public Info(){
    public void setuser(String user)
        this.user = user;
      public String getuser()
        return user;
       public Collection getInfo() throws NamingException, SQLException {
                    ArrayList list = new ArrayList();
                    InitialContext initCtx = new InitialContext();
                    //OTHER CONNECTION STATEMENTS
    String sql = "SELECT ADDR FROM TABLENAME WHERE user=' ?'";
                    try {
                            conn = ds.getConnection();
    pstmt = conn.prepareStatement(sql);
    pstmt.setString(1, this.user);
    rs = pstmt.executeQuery();
    while(rs.next()) {
            InfoBean tsel = new InfoBean(rs.getString("addr"), this.user);
    list.add(tsel);
          //catch SQLexception
    } finally {
    try{
               if (initCtx != null)  initCtx.close();
            if (rs != null)  rs.close();
            if (pstmt != null) pstmt.close();
            if (conn != null) conn.close();
    //catch SQLException statment
          return list;
    //InfoBean.java
    package database;
    public class infoBean
    private String user;
    private String addr;
    public infoBean(){
    public infoBean(String addr, String user)
    this.user = user;
    this.addr = addr;
    public String getaddr()
    return addr;
    public String getuser(){
    return user;
    public void setaddr(String addr){
    this.addr = addr;
    public void setuser(String user){
    this.user = user;
    //index.jsp
    <jsp:useBean id="row" class="database.Info" scope="request">
    <jsp:setProperty name="row" property="user" param="user"/>
    </jsp:useBean>
    <c:if test=${!empty param.user}">
    <c:forEach items="${row.info}" var="t1">
    <td>${t1.addr}</td<>
    </c:forEach>
    </c:if>

    OK, before we all go rummaging through your code--does your SQL statement return values when you execute it as a stand alone adhoc query?

  • Retrieve All records and display in Report using CAML query in Report Builder if Parameter value is blank

    Hello Experts,
    i have created a report where i have one parameter field where user will pass parameter(e.g. EmpId). As per parameter record will fetched to report if no parameter is passed then it will display all records. I have done it by taking SqlServer Database as datasource.
    by using Following method
    Now i would like to do it by taking Sharepoint List as Datasource. For that what would be the CAML Query.
    Here is my existing CAML query.
    <RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ListName>Employees</ListName>
      <ViewFields>
        <FieldRef Name="Title" />
        <FieldRef Name="FirstName" />
        <FieldRef Name="LastName" />
        <FieldRef Name="FullName" />
        <FieldRef Name="UserName" />
        <FieldRef Name="Company" />
      </ViewFields>
      <Query>
        <Where>  
    <Eq> 
        <FieldRef Name="Title" />
      <Value Type="Text">    
       <Parameter Name="EmployeeId"/>    
    </Value>
    </Eq>                  
        </Where>
      </Query>
    </RSSharePointList>
    The above code is working if i am passing an employeeId to Parameter. If nothing is passed, it is Not retrieving any record.
    Please suggest
    Thank you
    saroj
    saroj

    Your problem follows the well-established pattern of using an "All" parameter filter in SSRS. There are a few approaches depending on the size of your data. The easiest one is to return all data from CAML and then filter it within SSRS, the following thread
    provides some examples,
    http://stackoverflow.com/questions/18203317/show-all-records-some-records-based-on-parameter-value.
    Other options include passing all of the possible values within the CAML query when "All" is selected, using multiple Report Files to distinguish between both CAML queries, or to use multiple datasets with some logic to show/hide the correct one.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Calculating and Displaying Dates in Javascript

    Hello,
    I'm working on a flowchart form for my work, and am having issues getting a date to a) add correctly and b) display only certain portions of the date.
    I have four fields:
    CurrentDate - Displays the Current Date in MM/DD/YYYY format
    DropDownList1 - Contains a list of projects end users can choose from
    TextField1 - Displays text that tells the end user how many days the proejct will take
    DateField1 - Should add the CurrentDate + the Number of days the project will take and return a new date in the same MM/DD/YYYY format
    *Disclaimer* - I am not very experienced with scripting, and chose to go with JavaScript as I do have some previous past experience.
    Here is what I have for my code right now:
    if (DropDownList1.rawValue == 1){
    TextField1.rawValue = "2 Days";
    var AddDate = (Date.valueOf(CurrentDate) + (2*1000*60*60*24));
    DateField1.formattedValue = Date(AddDate);
    else if (DropDownList1.rawValue == 2){
    TextField1.rawValue = "1 Day";
    else if (DropDownList1.rawValue == 3){
    TextField1.rawValue = "2 Days";
    else if (DropDownList1.rawValue == 4){
    TextField1.rawValue = "2 Days";
    else if (DropDownList1.rawValue == 5){
    TextField1.rawValue = "4 Days";
    else if (DropDownList1.rawValue == 6){
    TextField1.rawValue = "5 Days";
    else if (DropDownList1.rawValue == 7){
    TextField1.rawValue = "4 Day";
    The end result is that the TextField1 displays the correct day, but the DateField1 displays a long string of the exact time and date of... well, the time - so no adding takes place. What I need is for the date to be displayed as MM/DD/YYYY. What am I doing wrong? I've only added the calculation to the first "if" statement, and will continue on to the rest once it is functioning.

    The following code will work in a LiveCycle Designer button using the "JavaScript" language option:
    var oNow = new Date(); // get date time object
    console.show(); // oepn and clear the JavaScript console
    console.clear();
    console.println("oNow = " + oNow);
    console.println("oNow.getFullYear() = " + oNow.getFullYear());
    console.println("oNow.getMonth() = " + oNow.getMonth());
    console.println("oNow.getDate() = " + oNow.getDate());
    console.println("oNow.getDay() = " + oNow.getDay());
    console.println("oNow.getHours() = " + oNow.getHours());
    console.println("oNow.getMinutes() = " + oNow.getMinutes());
    console.println("oNow.getSeconds() = " + oNow.getSeconds());
    console.println("oNow.getTimezoneOffset() = " + oNow.getTimezoneOffset());
    The following script uses FormCalc and can be used with a button for testing:
    var oDate = Date() // get today's date
    var Year = Num2Date(oDate, "YYYY") // get year four digits
    var Month = Num2Date(oDate, "MM") // get month 2 digits with leading zero
    var Date = Num2Date(oDate, "D") // get date without leading zero
    xfa.host.messageBox( Concat("oDate: ", oDate, " Year: ", Year, " Month: ", Month, " Date: ", Date) )
    var MyDate = "Feb 23, 2008" // a string data
    var Year = Num2Date( Date2Num(MyDate, "MMM D, YYYY"), "YY" ) // 2 digit year
    var Month = Num2Date( Date2Num(MyDate, "MMM D, YYYY"), "M" ) // month without leading zero
    var Date = Num2Date( Date2Num(MyDate, "MMM D, YYYY"), "DD" ) // day with leading zero
    xfa.host.messageBox( Concat("MyDate: ", MyDate, " Year: ", Year, " Month: ", Month, " Date: ", Date) )

Maybe you are looking for

  • Zen Xtra froze..stuck in Rescue M

    I was playing a song, and my mpe player started skipping and finally froze. So I tried to reboot it, but it wouldn't shut off. So I took the battery out and it rebooted. But now, I can't get passed the Rescue Mode screen (v.3). I tried "Clean Up", bu

  • How do I reinstall previous version of Pages, Numbers & Keynote

    How do I reinstall previous versions of Pages, Numbers and Keynote on my iPhone 4 using iOS 7.0.3. I use Time Machine. I want to keep old Data Files on the iPhone.

  • PDF error: a start doc printer call was issued. PDF on Ne11.

    adobe version. 6.0 pro when converting any doc to PDF it comes up with error. you file could not be printed due to an error on Adobe PDF on Ne11. -i tried to resinstall the app no luck. -tried in Word, excel, Autocad noluck. - i have several other ma

  • Selective Migration to new MacBook Pro?

    Hey all, I poked around the discussion boards and didn't see this specific issue addressed. I just bought a new MacBook Pro (NMBP) to replace an older MacBook Pro (OMBP). The old one has been having issues that have gotten progressively worse but it'

  • IPhoto won't work after installing iLife '11

    I installed iLife on both my work computer which is a '11 iMac and my personal computer is a '12 MacBook Pro. After installing I can't run iPhoto on either computer? When I try to open it on my computer it gives me a window that says "You can't open