Tuesday, December 30, 2014

scriplet use and bodyContent declare

jsp page : 
<!-- Body Part Start here -->     
        <div class="page">
            <%
            String bodyConLink=request.getParameter("bodyContent");
            //System.out.println(bodyConLink);
            %>
            <jsp:include page="<%= bodyConLink%>" flush="true"></jsp:include>
        </div>
      <!-- Body Part End  here -->




struts:
 <action name="*Load" class="allClass.action.LoadPageAction" method="{1}">
            <result name="indexPage">template/basicFrame.jsp?bodyContent=../WellCome.jsp</result>
            <result name="entryworklist">template/basicFrame.jsp?bodyContent=../resultentryworklist.jsp</result>
</action>

Saturday, December 27, 2014

Dynamic table ( js ) call using bootstrap From E_HIS project

Find Source for following Location :
..............................................................
gmail/subject :: Dynamic table ( js ) call using bootstrap From E_HIS project
js attachment as Notepad name is :: jqueryDOTdataTablesDOTminDOTjs

Dynamic table call using bootstrap From E_HIS project

<script>
    function draftRadfunction(){
    alert("modal page : Radiology Draft");
        var ajaxURL = "draftRadPageLoad.do";
        $.ajax({
            url : ajaxURL,
            success : function(result) {
                $("#pageModal_RDraft_azax").html(result);
            }           
        });
       
    }
 </script>




Now Edit Below process :
.........................................
<!--  ********** Start Modal azax page AND iNiTialize Process **********   -->
 <!--  ********** Start Modal azax page AND iNiTialize Process **********   -->
 <!--  * Radiology Draft *   -->
     <script>
    function draftRadfunction(){
    alert("modal page : Radiology Draft");
        var ajaxURL = "draftRadPageLoad.do";
        $.ajax({
            url : ajaxURL,
            success : function(result) {
                $("#pageModal_RDraft_azax").html(result);
            },
            complete : function() {
                dataTableInitializationRadDraftPAT1();
            }
           
        });
       
    }
 </script>




 <script>
function dataTableInitializationRadDraftPAT1() {
        var asInitVals = new Array();
        var oTable = $('#patDataTableDraft_1').dataTable({
            /*"oLanguage": {
                "sSearch": "Search all: "
            }*/
            "bDestroy" : true,
            "autoWidth" : false,
            "bScrollCollapse" : true,
            "bProcessing" : true,
            "bJQueryUI" : true

        });

        $("thead input").keyup(function() {
            /* Filter on the column (the index) of this element */
            oTable.fnFilter(this.value,$("thead input").index(this));
        });

        /*
         * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
         * the footer
         */
         $("thead input").each(function(i) {
            asInitVals[i] = this.value;
        });

         $("thead input").focus(function() {
            if (this.className == "search_init") {
                this.className = "";
                this.value = "";
            }
        });

         $("thead input").blur(function(i) {
            if (this.value == "") {
                this.className = "search_init";
                this.value = asInitVals[$("thead input").index(this)];
            }
        });
    }
  </script>
 





AND USE THIS js : jquery.dataTables.min.js
/**
 * @summary     DataTables
 * @description Paginate, search and sort HTML tables
 * @version     1.9.4
 * @file        jquery.dataTables.js
 * @author      Allan Jardine (www.sprymedia.co.uk)
 * @contact     www.sprymedia.co.uk/contact
 *
 * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved.
 *
 * This source file is free software, under either the GPL v2 license or a
 * BSD style license, available at:
 *   http://datatables.net/license_gpl2
 *   http://datatables.net/license_bsd
 *
 * This source file is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
 *
 * For details please refer to: http://www.datatables.net
 */

/*jslint evil: true, undef: true, browser: true */
/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns*/

(/** @lends <global> */function( window, document, undefined ) {

(function( factory ) {
    "use strict";

    // Define as an AMD module if possible
    if ( typeof define === 'function' && define.amd )
    {
        define( ['jquery'], factory );
    }
    /* Define using browser globals otherwise
     * Prevent multiple instantiations if the script is loaded twice
     */
    else if ( jQuery && !jQuery.fn.dataTable )
    {
        factory( jQuery );
    }
}
(/** @lends <global> */function( $ ) {
    "use strict";
    /**
     * DataTables is a plug-in for the jQuery Javascript library. It is a
     * highly flexible tool, based upon the foundations of progressive
     * enhancement, which will add advanced interaction controls to any
     * HTML table. For a full list of features please refer to
     * <a href="http://datatables.net">DataTables.net</a>.
     *
     * Note that the <i>DataTable</i> object is not a global variable but is
     * aliased to <i>jQuery.fn.DataTable</i> and <i>jQuery.fn.dataTable</i> through which
     * it may be  accessed.
     *
     *  @class
     *  @param {object} [oInit={}] Configuration object for DataTables. Options
     *    are defined by {@link DataTable.defaults}
     *  @requires jQuery 1.3+
     *
     *  @example
     *    // Basic initialisation
     *    $(document).ready( function {
     *      $('#example').dataTable();
     *    } );
     * 

 



















/// DIRECT TABLE   id   iNiTiAliZE  in jsp page :
   <script type="text/javascript">
     $(document).ready(function (){
       dataTableInitializationPatientViewPAT();
     }); 






function dataTableInitializationPatientViewPAT() {
        var asInitVals = new Array();
        var oTable = $('#patViewDataTable3').dataTable({
            /*"oLanguage": {
                "sSearch": "Search all: "
            }*/
            "bDestroy" : true,
            "autoWidth" : false,
            "bScrollCollapse" : true,
            "bProcessing" : true,
            "bJQueryUI" : true

        });

        $("thead input").keyup(function() {
            /* Filter on the column (the index) of this element */
            oTable.fnFilter(this.value,$("thead input").index(this));
        });

        /*
         * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
         * the footer
         */
         $("thead input").each(function(i) {
            asInitVals[i] = this.value;
        });

         $("thead input").focus(function() {
            if (this.className == "search_init") {
                this.className = "";
                this.value = "";
            }
        });

         $("thead input").blur(function(i) {
            if (this.value == "") {
                this.className = "search_init";
                this.value = asInitVals[$("thead input").index(this)];
            }
        });
    }

</script> 

Ten

ten ten ten

Nine

 nine

Eight

eight eight eight

Seven

seven seven

Six

 six six

Color code with name

http://www.w3schools.com/htmL/html_colornames.asp

Javascript for Bootstrap : See it



http://teko.co.in/demo
http://www.tricedesigns.com/portfolio/docs/javascript.html

modal call using id as azax page in script



 <script>
    function modalFunction(val){
    var userValue =    document.getElementById(val).innerHTML;
        alert(userValue);
        var ajaxURL = "patientViewModalLoad.do";
        $.ajax({
            /* async:false, */
            url : ajaxURL,
            success : function(result) {
                $("#patView_modalcall").html(result);
            },
            complete:function(){
                /* $("#PGSCCModal").modal({
                    backdrop:'static',
                    show:true
                }); */
                $("#PGSCCModal").modal('show');
                dataTableInitializationPatientViewPAT();
            }
           
        });
    }
 </script>




  /* async:false, */ need for more data load at a time pop up open


   /* $("#PGSCCModal").modal({
                    backdrop:'static',
                    show:true
                }); */   need when click outside then pop up close


SO,


  <script>
    function modalFunction(val){
    var userValue =    document.getElementById(val).innerHTML;
        alert(userValue);
        var ajaxURL = "patientViewModalLoad.do";
        $.ajax({
            async:false,
            url : ajaxURL,
            success : function(result) {
                $("#patView_modalcall").html(result);
            },
            complete:function(){
                $("#PGSCCModal").modal({
                    backdrop:'static',
                    show:true
                });
                dataTableInitializationPatientViewPAT();
            }
           
        });
    }
 </script>  














Jsp page :
<div id="PGSCCModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 <div class="modal-dialog">
    <div id="patView_modalcall" class="modal-content">
           here include modal contain(head, body and footer) thats means azax page
    </div>
  </div>
</div>

here include modal contain(head, body and footer) thats means azax page :
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>


  <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;  </button>
                        <h4 class="modal-title" id="myModalLabel">Patient View List</h4>
                      </div>
                      <div class="modal-body">
                    <!-- START PAGE CONTENT-->   
                          <!-- BEGIN EXAMPLE TABLE widget-->
                <div class="widget red">
                    <div class="widget-title">
                        <h4><i class="icon-reorder"></i> Data Table</h4>
                            <!--span class="tools">
                                <a href="javascript:;" class="icon-chevron-down"></a>
                                <a href="javascript:;" class="icon-remove"></a>
                            </span-->
                    </div>
                    <div class="widget-body">
                        <table class="table table-striped table-bordered"  id="patViewDataTable3">
                            <thead>
                            <tr>
                                <th style="text-align:center;">HN Number</th>
                                <th style="text-align:center;">Patient Name</th>
                                <th style="text-align:center;">Age </th>
                                <th style="text-align:center;">Current Problem</th>
                                <th style="text-align:center;">Last Visit</th>
                                <th style="text-align:center;">Details</th>
                                <th style="text-align:center;">Preview</th>
                            </tr>
                            </thead>
                            <tbody>
                            <s:iterator value="patientViewList"  status="rowstatus">
                            <tr class="odd gradeX">
                                <td><s:property value='reg_no'/></td>
                                <td><s:property value='full_name'/></td>
                                <td><s:property value='patient'/></td>
                                <td><s:property value='pname'/></td>
                                <td><s:property value='kkk'/></td>
                                <td><s:property value='kkk'/></td>
                                <td style="text-align:center;"><a href="#" ><i class="icon-print"></i></a></td>
                            </tr>
                            </s:iterator>
                            </tbody>
                        </table>
                     </div>
                </div>
                <!-- END EXAMPLE TABLE widget-->

<!-- END PAGE CONTENT-->
   
                       
                      </div>
                      <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                        <button type="button" class="btn btn-primary">Save changes</button>
                      </div>
                     
                     





dataTableInitializationPatientViewPAT(); is use for table initialize

 <script type="text/javascript">
    // $(document).ready(function (){
     //  dataTableInitializationPatientViewPAT();
    // });

function dataTableInitializationPatientViewPAT() {
        var asInitVals = new Array();
        var oTable = $('#patViewDataTable3').dataTable({
            /*"oLanguage": {
                "sSearch": "Search all: "
            }*/
            "bDestroy" : true,
            "autoWidth" : false,
            "bScrollCollapse" : true,
            "bProcessing" : true,
            "bJQueryUI" : true

        });

        $("thead input").keyup(function() {
            /* Filter on the column (the index) of this element */
            oTable.fnFilter(this.value,$("thead input").index(this));
        });

        /*
         * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
         * the footer
         */
         $("thead input").each(function(i) {
            asInitVals[i] = this.value;
        });

         $("thead input").focus(function() {
            if (this.className == "search_init") {
                this.className = "";
                this.value = "";
            }
        });

         $("thead input").blur(function(i) {
            if (this.value == "") {
                this.className = "search_init";
                this.value = asInitVals[$("thead input").index(this)];
            }
        });
    }
  </script>


Dynamic table call using bootstrap

  <script>
    function draftRadfunction(){
    alert("modal page : Radiology Draft");
        var ajaxURL = "draftRadPageLoad.do";
        $.ajax({
            url : ajaxURL,
            success : function(result) {
                $("#pageModal_RDraft_azax").html(result);
            }           
        });
       
    }
 </script>




Now Edit Below process :
.........................................
<!--  ********** Start Modal azax page AND iNiTialize Process **********   -->
 <!--  ********** Start Modal azax page AND iNiTialize Process **********   -->
 <!--  * Radiology Draft *   -->
     <script>
    function draftRadfunction(){
    alert("modal page : Radiology Draft");
        var ajaxURL = "draftRadPageLoad.do";
        $.ajax({
            url : ajaxURL,
            success : function(result) {
                $("#pageModal_RDraft_azax").html(result);
            },
            complete : function() {
                dataTableInitializationRadDraftPAT1();
            }
           
        });
       
    }
 </script>




 <script>
function dataTableInitializationRadDraftPAT1() {
        var asInitVals = new Array();
        var oTable = $('#patDataTableDraft_1').dataTable({
            /*"oLanguage": {
                "sSearch": "Search all: "
            }*/
            "bDestroy" : true,
            "autoWidth" : false,
            "bScrollCollapse" : true,
            "bProcessing" : true,
            "bJQueryUI" : true

        });

        $("thead input").keyup(function() {
            /* Filter on the column (the index) of this element */
            oTable.fnFilter(this.value,$("thead input").index(this));
        });

        /*
         * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
         * the footer
         */
         $("thead input").each(function(i) {
            asInitVals[i] = this.value;
        });

         $("thead input").focus(function() {
            if (this.className == "search_init") {
                this.className = "";
                this.value = "";
            }
        });

         $("thead input").blur(function(i) {
            if (this.value == "") {
                this.className = "search_init";
                this.value = asInitVals[$("thead input").index(this)];
            }
        });
    }
  </script>
 





AND USE THIS js : jquery.dataTables.min.js
/**
 * @summary     DataTables
 * @description Paginate, search and sort HTML tables
 * @version     1.9.4
 * @file        jquery.dataTables.js
 * @author      Allan Jardine (www.sprymedia.co.uk)
 * @contact     www.sprymedia.co.uk/contact
 *
 * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved.
 *
 * This source file is free software, under either the GPL v2 license or a
 * BSD style license, available at:
 *   http://datatables.net/license_gpl2
 *   http://datatables.net/license_bsd
 *
 * This source file is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
 *
 * For details please refer to: http://www.datatables.net
 */

/*jslint evil: true, undef: true, browser: true */
/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns*/

(/** @lends <global> */function( window, document, undefined ) {

(function( factory ) {
    "use strict";

    // Define as an AMD module if possible
    if ( typeof define === 'function' && define.amd )
    {
        define( ['jquery'], factory );
    }
    /* Define using browser globals otherwise
     * Prevent multiple instantiations if the script is loaded twice
     */
    else if ( jQuery && !jQuery.fn.dataTable )
    {
        factory( jQuery );
    }
}
(/** @lends <global> */function( $ ) {
    "use strict";
    /**
     * DataTables is a plug-in for the jQuery Javascript library. It is a
     * highly flexible tool, based upon the foundations of progressive
     * enhancement, which will add advanced interaction controls to any
     * HTML table. For a full list of features please refer to
     * <a href="http://datatables.net">DataTables.net</a>.
     *
     * Note that the <i>DataTable</i> object is not a global variable but is
     * aliased to <i>jQuery.fn.DataTable</i> and <i>jQuery.fn.dataTable</i> through which
     * it may be  accessed.
     *
     *  @class
     *  @param {object} [oInit={}] Configuration object for DataTables. Options
     *    are defined by {@link DataTable.defaults}
     *  @requires jQuery 1.3+
     *
     *  @example
     *    // Basic initialisation
     *    $(document).ready( function {
     *      $('#example').dataTable();
     *    } );
     * 

 



















/// DIRECT TABLE   id   iNiTiAliZE  in jsp page :
   <script type="text/javascript">
     $(document).ready(function (){
       dataTableInitializationPatientViewPAT();
     }); 






function dataTableInitializationPatientViewPAT() {
        var asInitVals = new Array();
        var oTable = $('#patViewDataTable3').dataTable({
            /*"oLanguage": {
                "sSearch": "Search all: "
            }*/
            "bDestroy" : true,
            "autoWidth" : false,
            "bScrollCollapse" : true,
            "bProcessing" : true,
            "bJQueryUI" : true

        });

        $("thead input").keyup(function() {
            /* Filter on the column (the index) of this element */
            oTable.fnFilter(this.value,$("thead input").index(this));
        });

        /*
         * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
         * the footer
         */
         $("thead input").each(function(i) {
            asInitVals[i] = this.value;
        });

         $("thead input").focus(function() {
            if (this.className == "search_init") {
                this.className = "";
                this.value = "";
            }
        });

         $("thead input").blur(function(i) {
            if (this.value == "") {
                this.className = "search_init";
                this.value = asInitVals[$("thead input").index(this)];
            }
        });
    }

</script>