• Antonio Mendez Padilla Zayas
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

Hello, i've been trying to get this table to work and i'm at the end of my rope here, still kinda new to salesforce...

I need to be able to change the quantity and that be reflected in the total, the problem is that i am unable to get the id value for the field and if i try to use $Component i cant get the quantity value either (i've tried every route combination possible).

Any idea how i should do this? thanks.

 

CODE: 

<apex:page sidebar="false" showHeader="false" controller="TheCont">

<apex:form id="frm">        

    <apex:dataTable value="{!prchck}" var="p" id="tbl" rowClasses="odd,even" styleClass="tableClass">
        
        <b><apex:facet name="caption">Please make sure the information is correct.</apex:facet></b>
        
        <apex:column headerValue="Store">            
            <apex:outputfield value="{!p.name}"/>
        </apex:column>

        <apex:column headerValue="Item">            
            <apex:outputfield value="{!p.tempitemname__c}"/>
        </apex:column>

        <apex:column headerValue="Price">            
            <apex:outputfield value="{!p.tempitemprice__c}"/>
        </apex:column>

        <apex:column id="clm" headerValue="Quantity">            
            <apex:inputfield id="quant" value="{!p.tempitemquantity__c}" onkeypress="decrease()" style="width:25px"/>
            <apex:param value="{!p.id}" name="itemId" />
        </apex:column>

        <apex:column headerValue="Total">  
            <apex:outputfield id="ttl" value="{!p.tempitemtotal__c}"/>
        </apex:column>

    </apex:datatable>

<apex:inputhidden id="hdnselid" value="{!hiddnid}"/>   <-- i can alert this but is blank no matter where in the code i put this

</apex:form>

<script>

    function decrease()
   
    {
        alert('hi'); <-- shows up
        
        var cor = document.getElementById("{!$Component.frm.tbl.clm.quant}").value;
        alert(cor); <--doesnt show up
        
    }

</script>

I'm trying to copy records from one object to another, but, i only want to copy those that had a field modified by the user

as in: i have a list of one object with one field that is editable, the rest are just displaying as a normal table, once the user modifies that field that row(record) is updated with the new information for that field

now, whay i need is to get that row to be copied to another list for another object

as i said, i'm still getting used to this thing and what i've tried has given me errors like "System.NullPointerException: Attempt to de-reference a null object" or the row just wont get copied

ANY help will be greatly appreciated, thank you

I'm trying to copy records from one object to another, but, i only want to copy those that had a field modified by the user

as in: i have a list of one object with one field that is editable, the rest are just displaying as a normal table, once the user modifies that field that row(record) is updated with the new information for that field

now, whay i need is to get that row to be copied to another list for another object

as i said, i'm still getting used to this thing and what i've tried has given me errors like "System.NullPointerException: Attempt to de-reference a null object" or the row just wont get copied

ANY help will be greatly appreciated, thank you