function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HarryHHHarryHH 

Firebug doesn't sets breakpoints

Hello,

 

I'm new to javascript and Firebug. I have a VFpage with javascript functions.

 

<apex:page standardController="Auftragsposition__c" extensions="Auftr_pos_controller_extension">

<script>
function changeMgges ( mg_tg )
{
  var mg_tg = mg_tg.value;
  alert (" Mg Tg " + mg_tg);  
  var mg_ges = mg_tg * 30;
  alert (" Mg ges " + mg_ges);  
  document.getElementById('{!$Component.edit_form.edit_block.edit_section.MgGes}').value = mg_ges;                

}
</script>

 

If I now start Firebug and set a breakpoint by clicking on the scriptline, the alerts are shown but the script does not stop. If I try to enter debug(changeMgges) in the consoles commandline it responds:

 

>>> debug(changeMgges)
Can anyone help me?
Thanks
Harry
AvromAvrom

Can you be a bit more specific about where you're setting the script line? If I set it on the line starting "var mg_tg = ..." the script stops there for me.

 

I'm also not able to reproduce your other problem--debug(changeMgges) works fine for me.

 

As a possible debugging idea, try looking at the actual generated source of the Javascript function--is it as expected?

 

HarryHHHarryHH

Hello Avrom,

 

I'm using Firfox V3.6.10 and Firebug V1.6X.0b1. With Firebug V1.5.4 it was the same problem.

Here is my complete VFpage:

 

<apex:page standardController="Auftragsposition__c" extensions="Auftr_pos_controller_extension">
<script>
    var newWin=null;
    function openLookupPopup(name, id)
    {
        var url="/apex/Artikelsuche?namefield=" + name + "&idfield=" + id;
        newWin=window.open(url, 'Popup','height=500,width=800,left=700,top=400,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus)
        {
            newWin.focus();
        }
            
        return false;
    }
                  
    function closeLookupPopup()
    {
       if (null!=newWin)
       {
          newWin.close();
       }  
    }
</script>    
<script>
function changeMgges ( mg_tg )
{
  var mg_tg = mg_tg.value;
  alert (" Mg Tg " + mg_tg);  
  var mg_ges = mg_tg * 30;
  alert (" Mg ges " + mg_ges);  
  document.getElementById('{!$Component.edit_form.edit_block.edit_section.MgGes}').value = mg_ges;                

}
</script>
    <apex:sectionHeader title="{!$ObjectType.Auftragsposition__c.label}" subtitle="{!Auftragsposition__c.Kunde__r.Vorname__c} {!Auftragsposition__c.Kunde__r.Name__c}"/>
    <apex:form ID="edit_form">
    <apex:pageBlock id="edit_block" title="{!$ObjectType.Auftragsposition__c.label} Detail" mode="edit">
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Speichern"/>
            <apex:commandButton action="{!delete}" value="Löschen"/>
            <apex:commandButton action="{!URLFOR($Action.Auftragsposition__c.Clone,Auftragsposition__c.id)}" value="Duplizieren"/>
       </apex:pageBlockButtons>
        <apex:outputpanel >
        <apex:pageBlockSection ID="edit_section" showHeader="false" columns="3" >
            <apex:inputhidden value="{!Auftragsposition__c.Artikel__r.Positionsnummer_PZN__c}"/>
            <apex:inputtext size="40" value="{!Auftragsposition__c.Artikel__r.Name}" id="targetName" onFocus="this.blur()" >
                       <apex:actionSupport event="onchange" rerender="edit_section"
                              status="status"/>
            </apex:inputtext>
            <a href="#" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}'); return false">Artikel suchen</a>
            <apex:inputField ID="MgTg" value="{!Auftragsposition__c.Gen_Menge_Stk_Tag__c}"  onchange="changeMgges (this)">
                      <apex:actionSupport event="onchange" rerender="edit_section"
                              status="status"/>
            </apex:inputfield>
            <apex:inputField ID="Mgges" value="{!Auftragsposition__c.Gen_Menge_ges__c}"  onchange="changeMgges(this)">
            </apex:inputfield>
            <apex:inputField value="{!Auftragsposition__c.Genehmigungsstatus__c}"/>
            <apex:inputField ID="ab" value="{!Auftragsposition__c.genehmigt_ab__c}" />
            <apex:inputField ID="bis" value="{!Auftragsposition__c.genehmigt_bis__c}" />
            <apex:inputField ID="zu_tg" value="{!Auftragsposition__c.zus_tzliche_Tage__c}" />
            <apex:inputhidden value="{!Auftragsposition__c.Artikel__c}" id="targetId" />
        </apex:pageBlockSection>
        </apex:outputpanel>
   </apex:pageBlock>
   </apex:form>  
 </apex:page>

 

Thanks

Harry