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
New Developer
Posts: 1
Registered: ‎02-03-2010
My Device: Bold 9700
My Carrier: AT&T

Blackberry Browser Java Issue

Can anyone help me with this?  Instead of purchasing an add-in module to mobilize our existing CRM software I am trying to access it via the Blackberry web browser.  Our sales team is tasked with filling out call reports for every customer encounter.  The form is web enabled but they do not always take their laptops, or have internet access to fill out the form.  I am able to get to the form via the Blackberry Browser, but when I try to submit it to add it does nothing.  I have pulled the source file and found that the save button is invoking a javascript command. 

 

<a href="javascript&colon;void(0);" onclick="ValidateActivity();return false;">
          <img src="../../../library/images/icon_save.gif" alt="Save Activity" align="absmiddle" class="imgBtn" />&nbsp;Save Activity</a> 

 

I am not really a developer but to me it looks as if it is goign through and checking each field in the form to make sure it meets the parameters and then submitting the form.  When I click the save button on the blackberry it does nothing.  I dont get the progress bar, it does not send any data, nor does it refresh the page. 

Any ideas on what I can do?  Our CRM webpage is not open to the outside internet and is only accessible internally which makes the blackberry great since it is able to get to it via the BES.  Are there any other browsers available other than Blackberry that can access internal websites via the BES?  I had looked at Opera Mini but it cannot get to our internal stuff.

Any help would be greatly appreciated. 

 

 

 

 here is part of what validate activity looks like

 

function ValidateActivity() 
    {           

       //new customer
        if ((mode == "E") && ("047531" == "NON-DBS"))
        {
            if (document.all.txtNewCustomer2.value == "") {
                alert("Customer Name must be informed.");
                document.all.txtNewCustomer2.focus();
                return false;
            }
        }    
       
         //new customer
          if (document.all.customerType_2.checked)
        {
            if (document.all.txtNewCustomer.value == "") {
                alert("Customer Name must be informed.");
                document.all.txtNewCustomer.focus();
                return false;
            }
        }
   
        //Subject
        if (document.all.txtActivityDesc.value == "") {
            alert("Subject must be informed.");
            document.all.txtActivityDesc.focus();              
            return false;
        }
       
   
        //Owner
        if (document.all.hdOwnerActivityXUId.value == "-1") {
            alert("Owner must be chosen.");               
            return false;
        }
   
        //Status Completed
        if ( (document.all.drpActivityStatus.selectedIndex == 1) && (document.all.EnterCallDate.value == "") )
        {
           alert("Activity Date must be chosen.");
           document.all.EnterCallDate.focus();
           return false;
        }
       
        //Status Outstanding
        var dtOut = new Date(document.all.EnterCallDate.value);
        var MM = "0" + (dtOut.getMonth() + 1);
        MM = MM.substring(MM.length-2, MM.length);        
        var DD = "0" + dtOut.getDate();
        DD = DD.substring(DD.length-2, DD.length); 
        dtOut = dtOut.getYear() + "" + MM + "" + DD;                       
        if (document.all.drpActivityStatus.selectedIndex == 0) //outstanding status
        {
            if ((document.all.EnterCallDate.value != "") &&  (dtOut<dtToday))
            {           
               alert("Invalid date for Outstanding Activity. Please choose a date in the future or change the status to \"Completed\".");
               document.all.EnterCallDate.focus();
               return false;
            }      
        }
       
        //Status Completed.
         if (document.all.drpActivityStatus.selectedIndex == 1) //completed status
        {
            if ((document.all.EnterCallDate.value != "") &&  (dtOut>dtToday))
            {           
               alert("Invalid date for Completed Activity. Please choose a date in the past or change the status to \"Outstanding\".");
               document.all.EnterCallDate.focus();
               return fa

 //new customer
        if ((mode == "E") && ("047531" == "NON-DBS"))
        {        
            document.all.customerType_2.checked = true;//check new customer
            document.all.txtNewCustomer.value = document.all.txtNewCustomer2.value;
            AddCallForm.action ="default.asp?SID=%7B551CB19E%2DDF2B%2D4670%2D9584%2D14DEB6E63C29%7D&MP=%2E%2E%2Fslcommon%2Fmodules%2Fcustomer%2Fcalls%2FCustomer%5FAddCall%5F2SQL%2Easp&TT=1&CallId=0&POPUP=&sAction=AddUpdate" + "&DV=" + document.all.hdDivision.value;  //##Ticket3872 JunMa May 29, 2009
        } else
        {      
            if ((document.all.customerType_1.checked == true) && (document.all.hdCustomerNo.value == ""))
            {
                alert("Existing customer must be chosen.");          
                return false;  
            }           
           
            
                 AddCallForm.action ="default.asp?SID=%7B551CB19E%2DDF2B%2D4670%2D9584%2D14DEB6E63C29%7D&MP=%2E%2E%2Fslcommon%2Fmodules%2Fcustomer%2Fcalls%2FCustomer%5FAddCall%5F2SQL%2Easp&TT=1&CustomerNumber=xxxxxx&CustomerName=xxxx%20xxxx%20xxxxxx%20%26%20%20%20%20%20%20%20%20%20%20%20CONSTRUCTION%20CO%20INC&CallId=0&POPUP=&sAction=AddUpdate" + "&DV=" + document.all.hdDivision.value;        //##Ticket3872 JunMa May 29, 2009
            
        }               
       
        //add new influencer yes or no
        document.all.HiddenValue.value = 0       
        if (document.getElementById("InfluencerFlagActivity").checked == true)
        {
            if ((document.all.customerType_1.checked == true) || (("047531" != "") && ("047531" != "NON-DBS")))            {
                if (document.all.ContactActivityTxt.value == "")
                {
                    alert("Please inform new contact name.");
                    document.all.ContactActivityTxt.focus();
                    return false;
                }
                else
                {
                        if(newConfirm("Add Influencer Confirmation Request","After submitting this activity, would you\nlike to add this new contact as an influencer?",1,1,0))     
                   document.all.HiddenValue.value = 1 
        }
            }     
  }    
 
     //Get Contact  
     //LBranco 2009-09-29: Rewrote Contact logic:BEGIN
     if (document.getElementById("InfluencerFlagActivity").checked == true)
         document.all.hdContact.value = document.getElementById("ContactActivityTxt").value;
     else
         document.all.hdContact.value = document.getElementById("ContactActivity").value;
    
     if (document.getElementById("InfluencerFlagActivityFU").checked == true)
         document.all.hdContactFU.value = document.getElementById("ContactActivityFUTxt").value;
     else
         document.all.hdContactFU.value = document.getElementById("ContactActivityFU").value;       
     //LBranco 2009-09-29: Rewrote Contact logic:END
    
        AddCallForm.submit();               
       
        return true;
 }

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Blackberry Browser Java Issue

Hi Cory,

 

From the description of the form behaviour when you submit, it sounds like JavaScript is disabled.  The form save button is invoking a JavaScript command, and if this has been disabled, the user experience would be exactly as you have described.  Can you ensure the "Support JavaScript" checkbox is selected (found in Browser Options -> Browser Configuration).

 

Also, a quick review of the JavaScript code you have provided shows that it tries to modify the page's Document Object Model (DOM).  This capability is only supported for BlackBerry Smartphones running Device Software version 4.6 and higher (Bold, 8900, Storm, etc).  If you need to support older device models, I'd recommend making changes to the ValidateActivity function provides read-only support for the current page.

 

Sincerely,

Adam

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.