Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    To access a Smart-Client component of one jsp in another jsp

    There is a Tabset present in jsp-0.On clicking a tab,respective jsp will open
    (say jsp2 and jsp3). I have a dynamic-form in jsp-1 which wil get displayed in tab-1.I want to submit this form and move to tab-2 simultaneously.

    Please suggest me with ideas to do both the actions simeltaneously.

    Thanks in advance

    #2
    Hi Apooja,

    Sorry, what is preventing you from doing both actions simultaneously? It's a series of JavaScript calls, right? So call one method, then the other.

    Comment


      #3
      But both js are present in different jsps and i m trying to call the one method and smart-client component object of js present in jsp1 from jsp2.

      Comment


        #4
        Still not making much sense.. I don't think it's going to be possible for anyone to help you until you show some samples of your code.

        Comment


          #5
          // JSP1 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
          <%@ taglib uri="/WEB-INF/iscTaglib.xml" prefix="isomorphic" %>
          <%@ taglib prefix="s" uri="/struts-tags" %>
          <HTML>
          <isomorphic:loadISC skin="isomorphic"/>
          <HEAD>

          </HEAD>

          <% System.out.println("POOJA :: TESTING :: admin_score_createTab .JSP "); %>
          <BODY bgcolor="#2A6393">

          <SCRIPT>

          var context = "<%=request.getContextPath()%>";
          isc.HTMLPane.create({
          ID:"adminGeneralHtmlPane",
          autoDraw:false,
          width:"50%",
          height:"30%",
          contentsType:"page",
          dynamicContents:true,
          httpMethod:"get"
          })
          isc.HTMLPane.create({
          ID:"adminBFTabHtmlPane",
          autoDraw:false,
          width:"50%",
          height:"30%",
          contentsType:"page",
          dynamicContents:true,
          httpMethod:"get"
          })
          isc.TabSet.create({
          ID: "scoreCardCreationTab",
          top:50,
          width: "100%",
          height: "70%",
          tabs: [
          {
          id: "scoreCardGeneral",
          title: "General",
          icon: isc.Page.getAppImgDir() + "/line.jpg", iconWidth: 3,iconHeight:20,
          pane: adminScoreCardTabHtmlPane,
          click:function(){
          alert("%%%%%%%%%%%%%%%% TESTING");
          ButtonAction(0);
          }
          },
          {
          id: "businessFunction",
          title: "Business&nbsp;Functions",
          icon: isc.Page.getAppImgDir() + "/line.jpg", iconWidth: 3,iconHeight:20,
          pane: adminBFTabHtmlPane,
          click:function(){
          ButtonAction(1);

          }
          }
          }]

          });
          function ButtonAction(tabNo)
          {
          alert("TRANSFER FROM GENERAL"+tabNo);
          scoreCardCreationTab.selectTab(tabNo);
          if(tabNo=="0"){

          adminGeneralHtmlPane.setContentsURL(context + "/screens/scoreCard/scoreCardGeneral.action");
          }else if(tabNo=="1")
          {


          adminBFHtmlPane.setContentsURL(context + "/screens/scoreCard/scoreCardBF.action");
          }
          else{
          alert("Pooja testing ::: previousButton.show:: " );

          }
          }
          </SCRIPT>
          </BODY>
          </HTML>




          // JSP2 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

          <%@ taglib uri="/WEB-INF/iscTaglib.xml" prefix="isomorphic" %>
          <%@ page import="java.util.ArrayList,com.infosys.analytics.util.SmartClientUtil" %>
          <%@ taglib prefix="s" uri="/struts-tags" %>

          <HTML>
          <HEAD>
          <isomorphic:loadISC skin="SmartClient"/>
          <% %>
          </HEAD>

          <BODY bgcolor="#95C6D7">

          <script>
          var context = "<%=request.getContextPath()%>";
          var startDt = null;
          isc.DynamicForm.create({
          ID: "GeneralForm",
          top:"13%",
          left:"5%",
          autoDraw:true,
          width: "80%",
          action:context+"/screens/scoreCard/scoreCardBF.action",
          fields: [
          {name: "name",
          wrapTitle:false,
          title: "Template Name",
          type: "text",
          required: true
          },
          {name: "description",
          wrapTitle:false,
          title: "Description",
          type: "TextAreaItem"
          },
          {name: "endDt",
          wrapTitle:false,
          useTextField:"true",
          required: true,
          title: "End Date",
          type: "DateItem"
          }
          ]
          });

          isc.Button.create({
          title:"Next",
          showDisabled:false,
          showShadow:true,
          top:"40%",
          left:"5%",
          backgroundColor:"#2A6393",
          ID:"nextGeneralButton",
          click: function(){
          GeneralForm.submitForm();
          // scoreCardCreationTab.selectTab(scoreCardCreationTab.selectedTab()+1); //NOT WORKING
          //scoreCardCreateTabWindow.parent.scoreCardCreationTab.selectTab(1);//NOT WORKING
          }
          });
          </script>
          </BODY>
          </HTML>

          Above, some sample code are mentioned, it contains JSP1.jsp and JSP2.jsp files having tabSet and dynamicForm respectively. I want to access the tabset component of JSP1.jsp from JSP2.jsp.

          Comment


            #6
            Hi Apooja,

            Take a look at the docs for htmlFlow/htmlPane.contentsType - note the prominent warning about never using contentsType:"page" to load SmartClient components. You've started off on the wrong architecture - take a look at the SmartClient Architecture topic to understand the right approach.

            Comment

            Working...
            X