How to hide table with empty content using Javascript?

Hello!
I'm using Adobe LiveCylce Desinger integrated in SAP. I have a task to hide a database-table, if the table empty is.
Normmaly we can do following to check, whether the content empty is.
if (this.REMARK_TEXT.rawValue == null )
this.presence = "hidden";
else
this.presence = "visible";
The question is, how to check in Javascript, if a table empty is.
Many thanks in advance!
regards
longholiday

could try something like this:
function showOrHideTable(table){
     var isVisible = false;
    // gets the count of instance managers, event_initialize and row objects
    var rowCount = table.nodes.length;
    for(var i=0; i<rowCount; i++)
        //get the class name
        var myTestNode = table.nodes.item(i).className;
        //ignores the instance managers and event_init
        if(myTestNode == "subform")
            var innerCells = table.nodes.item(i).nodes;
            for(var j=0; j<innerCells.length; j++){
                //ignores non-input boxes
                if(innerCells.item(j).className == "field")
                    //check value
                    if(innerCells.item(j).rawValue != ""))
                        isVisible = true;
                    else
                        //hide the row
                        table.nodes.item(i).presence = "hidden";
    //if any row has a value specified
    if(isVisible)
        table.presence = "visible";
    //no value specified
    else
        table.presence = "hidden";

Similar Messages

  • How to hide a table row in pdf  using javascript?

    How to hide a table row in pdf  using javascript?

    This is only possible with LiveCycle Designer forms, not PDF forms created
    in Acrobat.

  • Error inserting a row into a table with identity column using cfgrid on change

    I got an error on trying to insert a row into a table with identity column using cfgrid on change see below
    also i would like to use cfstoreproc instead of cfquery but which argument i need to pass and how to use it usually i use stored procedure
    update table (xxx,xxx,xxx)
    values (uu,uuu,uu)
         My component
    <!--- Edit a Media Type  --->
        <cffunction name="cfn_MediaType_Update" access="remote">
            <cfargument name="gridaction" type="string" required="yes">
            <cfargument name="gridrow" type="struct" required="yes">
            <cfargument name="gridchanged" type="struct" required="yes">
            <!--- Local variables --->
            <cfset var colname="">
            <cfset var value="">
            <!--- Process gridaction --->
            <cfswitch expression="#ARGUMENTS.gridaction#">
                <!--- Process updates --->
                <cfcase value="U">
                    <!--- Get column name and value --->
                    <cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
                    <cfset value=ARGUMENTS.gridchanged[colname]>
                    <!--- Perform actual update --->
                    <cfquery datasource="#application.dsn#">
                    UPDATE SP.MediaType
                    SET #colname# = '#value#'
                    WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
                    </cfquery>
                </cfcase>
                <!--- Process deletes --->
                <cfcase value="D">
                    <!--- Perform actual delete --->
                    <cfquery datasource="#application.dsn#">
                    update SP.MediaType
                    set Deleted=1
                    WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
                    </cfquery>
                </cfcase>
                <cfcase value="I">
                    <!--- Get column name and value --->
                    <cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
                    <cfset value=ARGUMENTS.gridchanged[colname]>
                    <!--- Perform actual update --->
                   <cfquery datasource="#application.dsn#">
                    insert into  SP.MediaType (#colname#)
                    Values ('#value#')              
                    </cfquery>
                </cfcase>
            </cfswitch>
        </cffunction>
    my table
    mediatype:
    mediatypeid primary key,identity
    mediatypename
    my code is
    <cfform method="post" name="GridExampleForm">
            <cfgrid format="html" name="grid_Tables2" pagesize="3"  selectmode="edit" width="800px" 
            delete="yes"
            insert="yes"
                  bind="cfc:sp3.testing.MediaType.cfn_MediaType_All
                                                                ({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"
                  onchange="cfc:sp3.testing.MediaType.cfn_MediaType_Update({cfgridaction},
                                                {cfgridrow},
                                                {cfgridchanged})">
                <cfgridcolumn name="MediaTypeID" header="ID"  display="no"/>
                <cfgridcolumn name="MediaTypeName" header="Media Type" />
            </cfgrid>
    </cfform>
    on insert I get the following error message ajax logging error message
    http: Error invoking xxxxxxx/MediaType.cfc : Element '' is undefined in a CFML structure referenced as part of an expression.
    {"gridaction":"I","gridrow":{"MEDIATYPEID":"","MEDIATYPENAME":"uuuuuu","CFGRIDROWINDEX":4} ,"gridchanged":{}}
    Thanks

    Is this with the Travel database or another database?
    If it's another database then make sure your columns
    allow nulls. To check this in the Server Navigator, expand
    your DataSource down to the column.
    Select the column and view the Is Nullable property
    in the Property Sheet
    If still no luck, check out a tutorial, like Performing Inserts, ...
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
    John

  • How to display string with XML content in 4.6?

    Hi,
    I`d like to know how to display string with XML content in it for 4.6.
    4.6 has not method parse_string.
    And example like this is not helpful:
      DATA: lo_mxml    TYPE REF TO cl_xml_document.
      CREATE OBJECT lo_mxml.
      CALL METHOD lo_mxml->parse_string
        EXPORTING
          stream = gv_xml_string.
      CALL METHOD lo_mxml->display.
    Thank you.

    Hi,
    May be you can use fm SAP_CONVERT_TO_XML_FORMAT. But it have some issues with memory usage, the program consumed tons of memory during convert.

  • How to hide table control in a screen

    Hi, Gems,
    I want to hide the table control.Using "loop at screen" I am able to hide all other components except table control.
    Can anyone tell me how to hide table control in a screen?
    Any help will be appreciated.
    -Thanks
    Surajit.

    Hi,
    In the PBO (in a module outside to the LOOP...ENDLOOP), use this
    MODULE status_0100 OUTPUT.
    IF sy-ucomm EQ space.   "Give the function code on which you want to make your table control go invisible
                                              "Give a space if you want your table control to remail invisible on display of the screen
        CLEAR: t_header[].
        LOOP AT tabcontrol1-cols[] INTO wa_control1.
          wa_control1-invisible = '1'.
          MODIFY tabcontrol1-cols[] FROM wa_control1 INDEX sy-tabix.
        ENDLOOP.
    ENDMODULE. 

  • How can scan directly with webcenter content

    how can directly scan with webcenter content without other software for scanner
    tnx

    Hi,
    If you are referring to not using ODC/ODDC kind of software which has drivers to connect to Webcenter Content then following is what I can think of:
    1. Have your scanner drop the scanned images to a shared folder
    2. Have a standalone Java program to checkin the scanned images to Webcenter Content using RIDC API calls
    3. Access what set of metadata you want to set on the content, advice you set most of the general metadata on the folder so the content inherits them
    4. If the metadata is available in a database then you could use the Java program to look up to this DB for metadata which performing the checkin
    Regards,
    - Anand

  • How to create table with row type in smart forms

    How to create table with row type in smart forms with out line type
    please explain me the procedure

    HI,
    A table type describes the structure and functional attributes of an internal table in ABAP. In ABAP programs you can reference a table type TTYP defined in the ABAP Dictionary with the command DATA <inttab> TYPE TTYP. An internal table <inttab> is created in the program with the attributes defined for TTYP in the ABAP Dictionary.
    A table type is defined by:
    its line type, that defines the structure and data type attributes of a line of the internal table
    the options for managing and accessing the data ( access mode) in the internal table
    the key ( key definition and key category) of the internal table
    The row type is defined by directly entering the data type, length and number of decimal places or by referencing a data element, structured type ( structure, table or view) or other table type. Or the row type can be a reference type.
    <b>for more info :</b> http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm
    Internal table
    Regards
    Sudheer

  • How to open a pdf from pdf target with page no using javascript

    Hi
    How to open a pdf from pdf target with page no using javascript
    Thanks in Advance.

    Hello,
    <p>Web.show_document calling .htm files saved on disk.....</p>
    Francois

  • How to connetct macair with windows laptop using wifi

    how to connetct macair with windows laptop using wifi

    m8,
    You might need to download the latest driver for your Dell Latitude(D600). PAN(personal Area Networking or Piconet) is just one of the profiles(device support/services) of bluetooth(SIG). Blue Soleil are only for that blutooth that uses that chips, like that of widcomm. Toshiba/HP laptops have updates for their bluetooth I can't see why Dell wouldn't have also. And check if the driver,is one that is known to work with Nokia phones.
    Good luck.
    Message Edited by android on 25-Feb-2008 12:52 PM
    Knowledge not shared is knowledge wasted!
    If you find it helpfull, it's not hard to click the STAR..

  • How do I register with iTunes without using a credit card it's not giving me a none option???

    How can I register with iTunes without using a credit card it's not giving me a none option!!

    Did you follow these instructions? You have to. Also, you have to use an email addresss that you have not used with Apple before, it has to be a new acciount.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • How to create table with resizable row ?

    how to create table with resizable row ?

    I'd suggest you start here:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • Associating two events with submit button using  javascript in jsp

    Hi
    How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up window

    Have something like :
    <input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
    You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky.

  • How to get inputtext's inputvalue by using javascript

    how to get inputtext's inputvalue by using javascript?
    and how to judge whether its be filled or empty string

    Why do you want to use javascript..? Why not action listener..? You can check whether its an empty string by checking
    if(str != null && !str.equals("")) {..}
    where str is the variable for inputText value.
    If this is not helpful, do provide more details on which version of JDev you are using and what are you trying (your usecase).
    regards,
    ~Krithika

  • How to validate an text field item using javascript for numbers only.

    hi,
    how to validate an text field item using javascript for numbers only.please help me on this urgent
    please mail me solun if posible on [email protected]

    Hi,
    Page HTML header
    <script>
    function onlyNum(evt) {
      // Usage: onKeyPress="return onlyNum(event)"
      evt = (evt) ? evt : window.event;
      var charCode = (evt.which) ? evt.which : evt.keyCode;
      if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        var status = 'This field accepts numbers only!';
        alert(status);
        return false;
      var status = '';
      return true;
    </script>Item HTML Form Element Attributes
    onKeyPress="return onlyNum(event)"Br,Jari

  • Any way to communicate with Serial PORT using JavaScript

    is there any way to communicate with Serial PORT using JavaScript ??
    Dont tell me to do it in java because I need to this on client side not on server side.
    such as when client pressed the button, a javascript function will be called and in that function I need to communicate with the serial port of that client... That action will not go to server side.

    Is there any way to send a string of bytes to the serial port from the client side ?
    Just a button on the web page that sends out stuff to the comport.
    I was hoping to do this using java script also ..

Maybe you are looking for

  • BlackBerry 10.2 OS Begins Roll Out, for the Q10

    Read more here: BlackBerry 10.2 OS Begins Roll Out 1. If any post helps you please click the below the post(s) that helped you. 2. Please resolve your thread by marking the post "Solution?" which solved it for you! 3. Install free BlackBerry Protect

  • IPad stolen.  don't remember if I turned off 'find my iphone' or not

    Please help. I've researched a bunch but have not been able to find an answer to this situation. My iPad air was recently lost/believed stolen (I left it in the library and nobody recovered it) Here are the stats as best I can remember them. *     It

  • How can I automatically insert a date in Pages for my Ipad

    Is there any way to automatically insert the current date in a letter using Pages for the IPad?  If so how?

  • Help me ffs please!

    ive done the lastest software update and since then my iphone messed up but got it all back to work apart from the music it will not sync, When i click sync it syncs the videos i've got all them but once it says the music is on my phone I go on my ph

  • Error installing Mavericks on Macbook.

    I have downloaded the Mavericks installer and prepared my Mac by removing TM backups, turning off TM and rebooting.  I have a qualifying macbook running 10.6.8.  When I try to activate the installer, I get a error saying that the drive is used for Ti