• guyr1981
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hi,

 

Getting really frustrated trying to solve a problem that is not allowing me to proceed for 2 days now.

If anyone can help, please do...

 

 

Have an Object Table_Account__c which has a few fields (lets say for simplicity):

test1__c

test2__c

test3__c

total__c

 

Also have a dataTable that presents instances of this object as inputFields on the table.

 

This is my getter for the table that is displayed later:

 

    public List<Table_Account__c> getTabAccounts() {

        this.TabAccount = [SELECT name, id, account_name__c, test1__c, test2__c, test3__c,

         Total__c from Table_Account__c];

        System.debug(Logginglevel.DEBUG, '##### I am in Get ##############################################');

        return this.TabAccount;

    }

 

The dataTable attribute creation code is:

 

<apex:page standardStylesheets="false" sidebar="false" Controller="MyController" tabStyle="Account">

....
....
....

<apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">

     <apex:dataTable value="{!TabAccounts}" id="outputTable" var="pitem" columns="10" cellPadding="6">

          <apex:column headerValue="Test1">

          <apex:inputField value="{!pitem.test1__c}" style="width: 80px"/>

           </apex:column>

          <apex:column headerValue="Test2">

          <apex:inputField value="{!pitem.test2__c}" style="width: 80px"/>

          </apex:column>

 <apex:column headerValue="Test3">

          <apex:inputField value="{!pitem.test3__c}" style="width: 80px"/>

          </apex:column>

 

  <apex:column headerValue="Total">

          <apex:inputField value="{!pitem.total__c}" style="width: 80px"/>

          </apex:column>

 

...

...

...

 

after user is changing the values in some of the dataTable input boxes and press a button which is connected to {!quicksave}.

The dataTable updates back to the original values instead of the new ones just saved.

 

Does anyone has an explanation.

 

The only explanation that I might have is that maybe my getter is called before the setter so it updates the table back with the DB values, then the setter is called after the values are already the old ones hence no change in the DB and then the quicksave. later when the getter rebuilds the dataTable again it builds it with the DB values which are the same as the old values.      Could that be it?

(I can see in the Debug that the getter is called twice, one of which is before the quicksave but is it also before the setter updates the DB?)

If that is the case, what can I do?

 

Hi,

 

I have the following dataTable:

 

 

<apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">
          <apex:dataTable value="{!TabAccounts}" id="outputTable" var="pitem" columns="10" cellPadding="6">
          <apex:column headerValue="Account" >
          <apex:outputText value="{!pitem.name}" style="width: 80px"/> 
          </apex:column>
          <apex:column headerValue="Jan">
          <apex:inputField value="{!pitem.Jan__c}" style="width: 80px"/> 
          </apex:column>
          <apex:column headerValue="Feb">
          <apex:inputField value="{!pitem.Feb__c}" style="width: 80px"/>
          </apex:column>

 

<apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">

     <apex:dataTable value="{!TabAccounts}" id="outputTable" var="pitem" columns="10" cellPadding="6">

          <apex:column headerValue="Test1">

          <apex:inputField value="{!pitem.test1__c}" style="width: 80px"/>

           </apex:column>

          <apex:column headerValue="Test2">

          <apex:inputField value="{!pitem.test2__c}" style="width: 80px"/>

          </apex:column>

..........

..........

..........

 

          <apex:column headerValue="Test10">

          <apex:inputField value="{!pitem.test10__c}" style="width: 80px"/>

          </apex:column>

..........

..........

..........

 

 

On the controller I have the getTabAccounts that returns a list of my Table_Account__c objects (from which the dataTable is being built).

 

When the user changes the values on the dataTable input fields I would like to have a "set" API that would recive the changes made by the user.

 

I tried writing a setTabAccounts API but it was not called upon user changes.

Also tried writing a setPitem API but, had the same result.

 

What "set" API should I write to get the user changes?

 

Thanks,

Guy

 

 

 

 

 

 

 

 

Hi,

 

I have a few seelct lists that the user selects from and then press a commandButton that calls my API that save a list of objects in the DB.

On the bottom part of the screen I have a dataTable that presents all the object instances on the list that was just built.

 

The problem is: The dataTable doesn't refresh, I can change the selections and press go again and the DB changes, but my table that was already built and presented on the screen won't refresh.

 

I tried rebuilding it by using reRended on the action botton, but it didn't work (also tried wrapping the dataTable with outputPannel and tried to use it in the reRender, but it does nothing to the table, any suggestions?

 

Here is the relavent sections of the code:

 

....

....

....

<apex:commandButton action="{!refresh}" value="Go"  reRender="ThePageBlockWrapper"/>

 

 

<apex:outputPanel id="ThePageBlockWrapper">

      <apex:pageBlock title="Planing Table" id="thePageBlock" mode="edit">

          <apex:dataTable value="{!acc}" id="outputTable" var="pitem" columns="10" cellPadding="6">

          <apex:column headerValue="Account" >

          <apex:outputText value="{!pitem.name}" /> 

          </apex:column>

....
....
....

 

 

Thanks,

Guy

 

 

 

Hi,

 

I have an object of custom type: Company

I have anohter object called: Department which has a Master-Detail field -> Company

My third and last object is Employee and it has 2 Master detail relationships ->Company & ->Department

 

Now, I have a few companies and a few departments (each of the departments belong to a specific company).

 

When I open a new Employee I need to choose a company on the company field and a Department on the department field of the Employee.

 

Problem:

After choosing a company that the employee belongs to, I want the option list for choosing the department to only hold departments that belong to the company I choose.

 

How can I do that?

If someone know, I could really use the help,

Thanks,

Guy

Hi,

 

I have an object and I want one of its fields (product code) to be a number.

if I choose the field type as number it displays: 1,234,567 instead of 1234567

so I want it to be text: but I want to validate no letters were entered, how do I do that?

 

Would really appreciate the answer.

 

Thanks,

Guy 

Hi,

 

I've used as stylesheet value -> 'styles.css'
in one of the tutorials, the table looks great, but the salesforce environment on that page looks different then other tabs.

 

I've tried using different styleslike:    'allCustom.css' or 'Theme3.css' and got the regular fill and look of salesforce but my data table looks really bad.

 

Is there a ready style that would allow my data table to look great while keeping the look and fill of other salesforce pages?

 

Guy