Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Navigation throuth other page note occur

Hi

 

i don't know why navigation to other screen is working stop. actually please help

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>First Group</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<link href="style/scrollpanel.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="script/actb.js"></script>
<script language="javascript" type="text/javascript" src="script/actb2.js"></script>
<script type="text/javascript" src="script/common.js"></script>
<script type="text/javascript" src="script/soapclient.js"></script>
<script type="text/javascript" src="script/cordova-1.9.0.js"></script>
<script type="text/javascript">

     //document.addEventListener("deviceready", onDeviceReady, false);

	    //Cordova is loaded and it is now safe to make calls Cordova methods
	    
	    function onDeviceReady() 
	    {
		  
	        checkConnection();
	       // navigator.splashscreen.hide();
	    }

        function checkConnection() 
	    {
	        var networkState = navigator.network.connection.type;
	
	        var states = {};
	        states[Connection.UNKNOWN]  = 'Unknown connection';
	        states[Connection.ETHERNET] = 'Ethernet connection';
	        states[Connection.WIFI]     = 'WiFi connection';
	        states[Connection.CELL_2G]  = 'Cell 2G connection';
	        states[Connection.CELL_3G]  = 'Cell 3G connection';
	        states[Connection.CELL_4G]  = 'Cell 4G connection';
	        states[Connection.NONE]     = 'No network connection';
	       	//alert('Connection type: ' + states[networkState]);
			if(states[networkState]=="No network connection")
			{
	  			alert("No Connection Available ");
				navigator.app.exitApp();
			}	
		}
        var stationList = new Array;	
        
          
   		function GetStationCodes()
  		{    
	  		
	  		document.getElementById('loadingImg').style.visibility = "visible"; 
	  		
		     var pl = new SOAPClientParameters();
		     var parameter1 = "";
		     var parameter2 = "";
		     pl.add("parameter1", parameter1);
		     pl.add("parameter2", parameter2);
		     SOAPClient.invoke(WSDLURL, "stationSearch", pl, true, GetStationCodes_callBack);
		}

		function GetStationCodes_callBack(r)
 		{ 
	 		
	 		document.getElementById('loadingImg').style.visibility = "hidden";
	 		document.getElementById('submitBtn1').removeAttribute('disabled');
			document.getElementById('submitBtn2').removeAttribute('disabled');
			document.getElementById('submitBtn3').removeAttribute('disabled');
			document.getElementById('getStationDesc').removeAttribute('disabled');
			for (var i = 0; i < r.length-1; i++)
          	{
	          	stationList[i] = r[i].stationCode + " - " + r[i].stationName;
	          	// window.localStorage.setItem(i,stationList[i]);
          	}
          	
		}
        function SetAction(flag)
		{
			
			if(flag==1)
			{
				alert("Hii");
*************Why it is not working alert is coming*****************
				 document.frmIndex.action="arrival.html";
			}
			else
			{
				 document.frmIndex.action="departure.html";
			}
		}



</script>


</head>
<body onload="GetStationCodes()">
<div id="wrapper">
<div class="departure_cont">
<div class="home_icon"><a href="#"><img src="images/home-icon.png" alt="Home" title="Home" /></a></div>
<h1 class="fr">Departures</h1>
<div class="cl"></div>
<div class="cl"></div>
<div class="departure_cont"><h2><input id="stationName" name="getStationDesc" type="text" class="log_txtfield1" /></h2></div>

<ul style="margin-left:-8%; width:100%;">
<li> <input id="submitBtn1" class="submitBtn1" type=submit   style="margin-top:20px; margin-left:2%" value="Get date" onclick="FillValues();SetAction(1)" disabled="disabled"/></li>
<li> <input id="submitBtn2" type=submit  class="submitBtn1"  style="margin-top:20px; margin-left:2%" value="Next train" onclick="FillValues();SetAction(1)" disabled="disabled"/> </li>
<li><input id="submitBtn3" class="submitBtn1" type=submit   style="margin-top:20px;  margin-left:7%" value="All today" onclick="FillValues();SetAction(1) " disabled="disabled"/></li>
</ul>
<h3 style="text-align:left; float:left; margin-left:3%;">Change Location</h3>

	<div class="cl"></div>
			<form name="frmIndex" type=get>
				<div class="log_cont">
					<input id="getStationDesc" name="getStationDesc" type="text" class="log_txtfield" disabled="disabled"/>
					<script>
					
						var obj = actb(document.getElementById('getStationDesc'),stationList);
						//$("#index").trigger("pagecreate");
						//setTimeout(function(){obj.actb_keywords = custom2;},10000);
						
						this.actb_timeOut = -1;
						// Number of elements autocomplete can show (-1: no limit)
						this.actb_lim = 10;
						// should the auto complete be limited to the beginning of keyword?
						this.actb_firstText = true;
						// Enable Mouse Support
						this.actb_mouse = true;
						// Delimiter for multiple autocomplete.
						// Set it to empty array for single autocomplete
						this.actb_delimiter = new Array(' ',',');
						// Show widget only after this number of characters is typed in.
						this.actb_startcheck = 1;
						
						this.actb_bgColor = '#dbe3ec';
						this.actb_textColor = '#00256a';
						this.actb_hColor = '#dbe3ec';
						this.actb_fFamily = 'arial';
						this.actb_fSize = '16px';	
						this.actb_hStyle = 'text-decoration:underline;font-weight="bold;";text-align="left"';
						
						function FillValues()
						{
							
							document.getElementById('getStationCode').value = document.getElementById('getStationDesc').value.substring(0,3);	
							alert(document.getElementById('getStationCode').value);			
						}
					</script>
					</div>
					<div>
  
      <img src="images/ajax-loader.gif" id="loadingImg" visible =true style="margin:auto; position: absolute; left:50%; top:50%;"/>
  
</div>
					<input id="getStationCode" name="getStationCode" type="hidden" /></div>

</div>
</div>
</body>
</html>

 

Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Navigation throuth other page note occur

Is there any issue in actually First time my file name is index.html but now i changed name select station.html

Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Navigation throuth other page note occur

If this file was named "index.html" it simple gets broken since the "index.html" in most cases is your main screen to be loaded after the app was startet, so this shouldn't be renamed or you need to rename in your config.xml (or any other configuration file for mobile OS's you are using).


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Navigation throuth other page note occur

<li><input id="submitBtn3" class="submitBtn1" type=submit   style="margin-top:20px;  margin-left:7%" value="All today" onclick="FillValues();SetAction(1) " disabled="disabled"/></li>




function SetAction(flag)
		{
			
			if(flag==1)
			{
				alert("Hii");
*************Why it is not working alert is coming*****************
				 document.frmIndex.action="arrival.html";
			}
			else
			{
				 document.frmIndex.action="departure.html";
			}
		}



alert is also coming but
 document.frmIndex.action="arrival.html";  is not working
Highlighted
Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Navigation throuth other page note occur

I do not really understand what

 

 document.frmIndex.action="arrival.html";  is not working

is doing or you want to do with it, but I asume you want to go to this .html page, isn't it? Never seen such things but I also asume something is missing since searching the web leads me to this example:

 

window.document.FrmIndex.action="recursiveSearch.asp"
window.document.FrmIndex.submit()

Writing dynamic, client-side apps I never used a <form>-element and I also do not use such things above but it might work.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.