You need to sign in to do that
Don't have an account?
kamal3883
opening search page in subtab in service console
Hi,
I want to open serach page in subtab of service console. below is some part of code. can somebody help me figuring out error.
<apex:page Controller="searchp" tabStyle="Asset__c" showHeader="true" sidebar="false"> <style> .pageBlockStyle{ border-style: solid; border-width: 2px; } </style> <apex:includeScript value="/soap/ajax/26.0/connection.js"/> <apex:includeScript value="/support/console/26.0/integration.js"/> <script type="text/javascript"> var openSubtabTimer = null; function openAssetSubtab() { // Use the results primary tab id and open a new subtab var openSubtab = function(result) { sforce.console.openSubtab(primaryTabId , '/' + assettab.Id, false, assettab.Name, null, null); clearTimeout(openSubtabTimer); }; // Get the enclosing primary tab id. The openSubtab method is set as the callback sforce.console.getEnclosingPrimaryTabId(openSubtab); } var previousOnload = window.onload; window.onload = function() { if (previousOnload) { previousOnload(); } openSubtabTimer = setTimeout('openAssetSubtab()', '500'); } </script> <apex:form > <apex:pageBlock id="pblock" > <apex:pageblocksection title="Search Hardwareasset" columns="1" > <!-- <apex:panelGrid columns="1" cellspacing="15%" > --> <apex:pageBlockSection columns="4"> <apex:pageBlockSectionItem > <apex:outputLabel >Search</apex:outputLabel> <apex:inputText value="{!searchString}" id="idSearch" /> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection columns="2" > <apex:commandButton value="Search" action="{!Search}" reRender="pblock" status="status" /> <apex:actionStatus startText="Searching... " id="searching"/> </apex:pageBlockSection> </apex:pageBlockSection> <br /> <div style="border-top:#EAC117 2px solid;"></div> <apex:actionStatus id="status" startText="Please wait while we are getting the results..." style="color:red" /> <br /> <apex:pageMessages /> <br /> <apex:pageblocksection title="Search Result" columns="1" id="pbs" rendered="{!(pageNumber>0)}" > <apex:panelGrid columns="2" > <apex:outputpanel > Page #: <apex:outputLabel value="{!pageNumber}"/> out of <apex:outputLabel value="{!totalPageNumber}"/> <apex:commandButton value="Previous" action="{!previousBtnClick}" disabled="{!previousButtonEnabled}" reRender="pbs"></apex:commandButton> <apex:commandButton value="Next" action="{!nextBtnClick}" reRender="pbs" disabled="{!nextButtonDisabled}" ></apex:commandButton> <apex:outputLabel >Show Record Per Page </apex:outputLabel> <apex:selectList value="{!recordPerPage}" size="1" multiselect="false" > <apex:selectOption itemValue="5" itemLabel="5"/> <apex:selectOption itemValue="10" itemLabel="10"/> <apex:selectOption itemValue="25" itemLabel="25"/> <apex:actionSupport event="onchange" action="{!resetPgSize}" status="pagesizereset" rerender="pbs" /> </apex:selectList> <apex:actionStatus id="pagesizereset" startText="Loading..."/> </apex:outputpanel> </apex:panelGrid> <body onLoad="Init()"/> <apex:pageBlockTable value="{!assetListToShow}" var="var" id="idDataTableasset" border="1" styleClass="pageBlockStyle" > <apex:column id="idColIsPublish" headerValue="Asset Name" headerClass="pageBlockStyle"> <apex:outputlink value="#" onclick="window.open('/{!var.id}')">{!var.Name}</apex:outputlink> </apex:column> <apex:column id="idColasset" headerValue="Serial number" headerClass="pageBlockStyle"> <apex:outputField value="{!var.Serial_Number__c}" /> </apex:column> <apex:column id="idColCreated" headerValue="Created Date" headerClass="pageBlockStyle" > <apex:outputField value="{!var.createdDate}" /> </apex:column> </apex:pageBlockTable> </apex:pageblocksection> </apex:pageblock> </apex:form> </apex:page>