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
damienmagnandamienmagnan 

reRender property doesn't rerender included input text values and Column generations

Okay I have a pageBlockTable that contains columns that contains inputText, I have a button that rerender the section that contains the table... However none of the value attribute of my input texts are reread from my database, it only recalls the designated methods when the apex statement (e.g. {!obj.value}) is in raw text. There is my code :

<apex:page id="rmaPage" controller="rmaController" title="Rapport Mensuel d'Activité">
<script src="/soap/ajax/11.1/connection.js" type="text/javascript">
</script>

<style>.colonne, .colonneWE {text-align:center;} .colonneWE {background-color:#D3D3CA;}</style>
<apex:form id="mainForm">
<!-- Should be splited -->
<apex:pageBlock id="exception" title="Exception" rendered="{!renderException}">
<apex:outputLabel >
<b>Type : </b>{!exc.type}</apex:outputLabel>
<br />
<apex:outputLabel >
<b>Source : </b>{!exc.source}</apex:outputLabel>
<br />
<apex:outputLabel >
<b>Message : </b>{!exc.message}</apex:outputLabel>
<br />
<apex:outputLabel >
<b>Stack Trace : </b>{!exc.stackTrace}</apex:outputLabel>
<br />
<apex:outputLabel >
<b>Target site : </b>{!exc.targetSite}</apex:outputLabel>
<br />
</apex:pageBlock>
<apex:pageBlock id="debug" title="debug" rendered="{!renderDebug}">
<apex:outputLabel for="endPoint">
<b>End point</b>{!endPoint}</apex:outputLabel>
<br />
<apex:outputLabel for="xmlToParse">
<b>XML to parse</b>{!xmlToParse}</apex:outputLabel>
<br />
</apex:pageBlock>
<apex:pageBlock id="main" title="Rapport Mensuel d'Activité">
<apex:pageBlockSection id="identitySct" collapsible="false" title="Identité" columns="1">
<apex:pageBlockSectionItem id="nomSctItem">
<apex:outputLabel id="nomLbl" for="nom">
<b>Nom du salarié</b>
</apex:outputLabel>
<apex:outputText id="nom">{!itc.titre} {!itc.prenom} {!itc.nom}</apex:outputText>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="emailSctItem">
<apex:outputLabel id="emailLbl" for="email">
<b>E-mail</b>
</apex:outputLabel>
<apex:outputText id="email">{!itc.email}</apex:outputText>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockSection id="dateSct" title="Le choix dans la date" collapsible="false" columns="1">
<apex:pageBlockSectionItem id="chooseMonthSctItem">
<apex:outputLabel id="chooseMonthLbl" for="chooseMonth">
<b>Mois</b>
</apex:outputLabel>
<apex:selectList id="chooseMonth" value="{!selectMonth}" size="1">
<apex:selectOption itemValue="1" itemLabel="Janvier" id="Testeuh" />
<apex:selectOption itemValue="2" itemLabel="Février" />
<apex:selectOption itemValue="3" itemLabel="Mars" />
<apex:selectOption itemValue="4" itemLabel="Avril" />
<apex:selectOption itemValue="5" itemLabel="Mai" />
<apex:selectOption itemValue="6" itemLabel="Juin" />
<apex:selectOption itemValue="7" itemLabel="Juillet" />
<apex:selectOption itemValue="8" itemLabel="Août" />
<apex:selectOption itemValue="9" itemLabel="Septembre" />
<apex:selectOption itemValue="10" itemLabel="Octobre" />
<apex:selectOption itemValue="11" itemLabel="Novembre" />
<apex:selectOption itemValue="12" itemLabel="Décembre" />
</apex:selectList>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem id="yearSct">
<apex:outputLabel id="chooseYearLbl" for="chooseYear">
<b>Année</b>
</apex:outputLabel>
<apex:inputText value="{!selectYear}" />
</apex:pageBlockSectionItem>
<apex:commandButton id="dateSctBtn" reRender="rmaTbl" value="Valider" action="{!changeRma}" />
</apex:pageBlockSection>
<apex:pageBlockSection id="rmaSct" title="Date : {!month} {!year}" collapsible="false" columns="1">
<apex:pageBlockTable id="rmaTbl" value="{!itc.firstRma.lignes}" headerClass="colonne" var="act" frame="none" rowClasses="odd,even" title="RMA">
<apex:column headerValue="Affectation" width="100%">
<apex:outputText value="{!act.designation}">
</apex:outputText>
</apex:column>
<apex:column headerValue="1" styleClass="{!act.styleJour01}" headerClass="{!act.styleJour01}">
<apex:inputText value="{!act.jour01}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="2" styleClass="{!act.styleJour02}" headerClass="{!act.styleJour02}">
<apex:inputText value="{!act.jour02}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="3" styleClass="{!act.styleJour03}" headerClass="{!act.styleJour03}">
<apex:inputText value="{!act.jour03}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="4" styleClass="{!act.styleJour04}" headerClass="{!act.styleJour04}">
<apex:inputText value="{!act.jour04}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="5" styleClass="{!act.styleJour05}" headerClass="{!act.styleJour05}">
<apex:inputText value="{!act.jour05}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="6" styleClass="{!act.styleJour06}" headerClass="{!act.styleJour06}">
<apex:inputText value="{!act.jour06}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="7" styleClass="{!act.styleJour07}" headerClass="{!act.styleJour07}">
<apex:inputText value="{!act.jour07}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="8" styleClass="{!act.styleJour08}" headerClass="{!act.styleJour08}">
<apex:inputText value="{!act.jour08}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="9" styleClass="{!act.styleJour09}" headerClass="{!act.styleJour09}">
<apex:inputText value="{!act.jour09}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="10" styleClass="{!act.styleJour10}" headerClass="{!act.styleJour10}">
<apex:inputText value="{!act.jour10}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="11" styleClass="{!act.styleJour11}" headerClass="{!act.styleJour11}">
<apex:inputText value="{!act.jour11}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="12" styleClass="{!act.styleJour12}" headerClass="{!act.styleJour12}">
<apex:inputText value="{!act.jour12}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="13" styleClass="{!act.styleJour13}" headerClass="{!act.styleJour13}">
<apex:inputText value="{!act.jour13}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="14" styleClass="{!act.styleJour14}" headerClass="{!act.styleJour14}">
<apex:inputText value="{!act.jour14}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="15" styleClass="{!act.styleJour15}" headerClass="{!act.styleJour15}">
<apex:inputText value="{!act.jour15}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="16" styleClass="{!act.styleJour16}" headerClass="{!act.styleJour16}">
<apex:inputText value="{!act.jour16}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="17" styleClass="{!act.styleJour17}" headerClass="{!act.styleJour17}">
<apex:inputText size="2" onchange="setTotalForRow(this);">{!act.jour17}</apex:inputText>
</apex:column>
<apex:column headerValue="18" styleClass="{!act.styleJour18}" headerClass="{!act.styleJour18}">
<apex:inputText value="{!act.jour18}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="19" styleClass="{!act.styleJour19}" headerClass="{!act.styleJour19}">
<apex:inputText value="{!act.jour19}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="20" styleClass="{!act.styleJour20}" headerClass="{!act.styleJour20}">
<apex:inputText value="{!act.jour20}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="21" styleClass="{!act.styleJour21}" headerClass="{!act.styleJour21}">
<apex:inputText value="{!act.jour21}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="22" styleClass="{!act.styleJour22}" headerClass="{!act.styleJour22}">
<apex:inputText value="{!act.jour22}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="23" styleClass="{!act.styleJour23}" headerClass="{!act.styleJour23}">
<apex:inputText value="{!act.jour23}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="24" styleClass="{!act.styleJour24}" headerClass="{!act.styleJour24}">
<apex:inputText value="{!act.jour24}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="25" styleClass="{!act.styleJour25}" headerClass="{!act.styleJour25}">
<apex:inputText value="{!act.jour25}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="26" styleClass="{!act.styleJour26}" headerClass="{!act.styleJour26}">
<apex:inputText value="{!act.jour26}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="27" styleClass="{!act.styleJour27}" headerClass="{!act.styleJour27}">
<apex:inputText value="{!act.jour27}" size="2" onchange="setTotalForRow(this);" />{!act.jour27}
</apex:column>
<apex:column headerValue="28" styleClass="{!act.styleJour28}" headerClass="{!act.styleJour28}">
<apex:inputText value="{!act.jour28}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="29" styleClass="{!act.styleJour29}" headerClass="{!act.styleJour29}" rendered="{!act.show29}">
<apex:inputText value="{!act.jour29}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="30" styleClass="{!act.styleJour30}" headerClass="{!act.styleJour30}" rendered="{!act.show30}">
<apex:inputText value="{!act.jour30}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column styleClass="{!act.styleJour31}" headerClass="{!act.styleJour31}" rendered="{!act.show31}">
<apex:facet name="header">31</apex:facet>
<apex:inputText value="{!act.jour31}" size="2" onchange="setTotalForRow(this);" />
</apex:column>
<apex:column headerValue="Total">
{!act.total}
</apex:column>
</apex:pageBlockTable>
<apex:panelGrid>
<apex:panelgroup>
<apex:commandButton id="addLigneBtn" value="Ajouter :" onclick="ajouterLigne();" />
<apex:selectList multiselect="false" size="1" id="addLigne">
<apex:selectOptions value="{!optionsLignes}" id="selectOptions" />
</apex:selectList>
</apex:panelgroup>
</apex:panelGrid>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
<script>
//var table = document.getElementById('rmaPage:mainForm:main:rmaSct:rmaTbl');
//alert(table.rows[1].cells[31].parentNode);//.getAttribute('value')) + parseFloat(table.rows[1].cells[5].firstChild.getAttribute('value')));
//table.rows[1].cells[31].innerHTML = "de la merde";

function setTotalForRow(input)
{
row = input.parentNode.parentNode;
setValueInLastCellOfRow(row, getTotalForRow(row));
}

function getTotalForRow(row)
{
var value = 0;
for(i = 1; i <= row.cells.length - 2; i++)
value += getValueInCell(row, i);

return value;
}

var add = "zut";
var number = 0;

function setValueInLastCellOfRow(row, value)
{
row.cells[row.cells.length - 1].innerHTML = value.toString();
}
function getValueInCell(row, column)
{
val = row.cells[column].firstChild.value;
ret = 0.0;
ret = parseFloat(val);
return (isNaN(ret)) ? 0 : ret;
}
</script>
</apex:page>

By the way, I'd like to generate those 31 columns dynamically, because 1. it's long to write each column (5 use a program to generate them but still...) 2. the number of columns vary 3. The class of the object "act" (that contains the days) contains about 288 lines only to give to the page the values it asks (the style of the column, the number in a box, etc.), I generate that too through a program but that's really annoying.

Thanks in advance.