• Carlos Cubas
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 2
    Replies
<apex:page Controller="TestPage_ctrl">
  <apex:form >
        <apex:outputPanel id="outputPane">
             {!IntegerStringMap}
                           <apex:outputPanel id="outputPanelId">
                            <apex:repeat value="{!IntegerStringMap}" var="a">
                                {!a}
                            </apex:repeat>
                     </apex:outputPanel>
                     </apex:outputPanel>
                     <apex:commandButton value="Add" action="{!addLotToConvert}" reRender="outputPane"/>
        </apex:form>
</apex:page>
public class TestPage_ctrl{

    public integer i { get ; set ;}
    public map<integer,String> IntegerStringMap { get; set; }
    
    public TestPage_ctrl(){
        i = 0;
        IntegerStringMap = new map<integer,String>();
        IntegerStringMap.put(i,'Test'+i);
    }
    
    public void  addLotToConvert(){
        i = i+1;
        IntegerStringMap.put(i,'Test'+i);
        //return null;
    }
}

When trying to use the Above code in Developer org it works as expected showing the Map contents and the Map Key as same. But when using this code in CS10/CS11 it does not. And there is a difference between the Contents and the Key of map.

 
<apex:page Controller="TestPage_ctrl">
  <apex:form >
        <apex:outputPanel id="outputPane">
             {!IntegerStringMap}
                           <apex:outputPanel id="outputPanelId">
                            <apex:repeat value="{!IntegerStringMap}" var="a">
                                {!a}
                            </apex:repeat>
                     </apex:outputPanel>
                     </apex:outputPanel>
                     <apex:commandButton value="Add" action="{!addLotToConvert}" reRender="outputPane"/>
        </apex:form>
</apex:page>
public class TestPage_ctrl{

    public integer i { get ; set ;}
    public map<integer,String> IntegerStringMap { get; set; }
    
    public TestPage_ctrl(){
        i = 0;
        IntegerStringMap = new map<integer,String>();
        IntegerStringMap.put(i,'Test'+i);
    }
    
    public void  addLotToConvert(){
        i = i+1;
        IntegerStringMap.put(i,'Test'+i);
        //return null;
    }
}

When trying to use the Above code in Developer org it works as expected showing the Map contents and the Map Key as same. But when using this code in CS10/CS11 it does not. And there is a difference between the Contents and the Key of map.