Auto-generate textField with AjaxObserveFiled and AjaxUpdateComponent
Auto-generate textField with AjaxObserveFiled and AjaxUpdateComponent
- Subject: Auto-generate textField with AjaxObserveFiled and AjaxUpdateComponent
- From: Raymond NANEON <email@hidden>
- Date: Wed, 14 Sep 2011 07:30:18 +0000 (GMT)
Hi,
I have a little problem to auto-generate textField with AjaxObserveFiled and AjaxUpdateComponent when a textField is filled. This is the code,
" HTML :
<table>
<tr>
<td class = "texte"> Mots clefs :</td>
<td class = "texte"> <wo:textField name = "motclef1" id = "motclef" value = "$session.motClef" />
</td>
<td class = "texte">
<wo:if condition = "$session.motClef"> <wo:textField name = "motclef2" id = "motCle2" value = "$session.motClef1" /> </wo:if>
</td>
<td class = "texte">
<wo name = "mo3UC">
<wo:conditional condition = "$session.motClef1"> <wo:textField name = "motclef3" id = "motCle3" value = "$session.motClef2" /> </wo:conditional>
</wo>
</td>
<td class = "texte">
<wo name = "mo4UC">
<wo:conditional condition = "$session.motClef2"> <wo:textField name = "motclef4" id = "motCle4" value = "$session.motClef3" /> </wo:conditional> </wo>
</td>
<td class = "texte">
<wo name = "mo5UC">
<wo:conditional condition = "$session.motClef3"><wo:textField name = "motclef5" value = "$session.motClef4" /></wo:conditional> </wo>
</td>
<td class = "texte">
<wo name = "mo6UC">
<wo:conditional condition = "$session.motClef4"><wo:textField name = "motclef6" value = "$session.motClef5" /></wo:conditional> </wo>
</td>
</tr>
<tr>
<td class = "texte"> </td>
<td class = "texte"> <wo:conditional condition = "$session.motClef5"><wo:textField name = "motclef7" value = "$session.motClef6" /></wo:conditional> </td>
<td class = "texte"> <wo:conditional condition = "$session.motClef6"><wo:textField name = "motclef8" value = "$session.motClef7" /></wo:conditional> </td>
<td class = "texte"> <wo:conditional condition = "$session.motClef7"><wo:textField name = "motclef9" value = "$session.motClef8" /></wo:conditional> </td>
<td class = "texte"> <wo:conditional condition = "$session.motClef8"><wo:textField name = "motclef10" value = "$session.motClef9" /></wo:conditional> </td>
<td class = "texte"> <wo:conditional condition = "$session.motClef9"><wo:textField name = "motclef11" value = "$session.motClef10" /></wo:conditional> </td>
<td class = "texte"> <wo:conditional condition = "$session.motClef11"><wo:textField name = "motclef12" value = "$session.motClef11" /></wo:conditional> </td>
</tr>
<wo name = "mOF1" />
<wo name = "mOF2" />
<wo name = "mOF3" />
<wo name = "mOF4" />
<wo name = "mOF5" />
</table>"
WOD :
mOF1 : AjaxObserveField {
fullSubmit = true;
observeFieldFrequency = 2;
observeFieldID = "motclef";
updateContainerID = "mo2UC";
}
mo2UC : AjaxUpdateContainer {
id="mo2UC";
}
mOF2 : AjaxObserveField {
fullSubmit = true;
observeFieldFrequency = 2;
observeFieldID = "motcle2";
updateContainerID = "mo3UC";
}
mo3UC : AjaxUpdateContainer {
id="mo3UC";
}
mOF3 : AjaxObserveField {
fullSubmit = true;
observeFieldFrequency = 2;
observeFieldID = "motCle3";
updateContainerID = "mo4UC";
}
mo4UC : AjaxUpdateContainer {
id="mo4UC";
}
mOF4 : AjaxObserveField {
fullSubmit = true;
observeFieldFrequency = 2;
observeFieldID = "motCle4";
updateContainerID = "mo5UC";
}
mo5UC : AjaxUpdateContainer {
id="mo5UC";
}
mOF5 : AjaxObserveField {
fullSubmit = true;
observeFieldFrequency = 2;
observeFieldID = "motCle5";
updateContainerID = "mo6UC";
}
mo6UC : AjaxUpdateContainer {
id="mo6UC";
}
The first textField generate the second, but the second one don't generate the third and when I enter in source code, I see the the first textField as HTML input Object but the second one is not an HTML input object. It does not exist so the other textField don't appears.
So I tried another code with _javascript_ and fullSubmit with a submitButton.
here is the second code :
"HTML :
<table>
<tr>
<td class = "texte"> Mots clefs :</td>
<td class = "texte"> <wo:textField name = "motclef1" id = "motclef" value = "$session.motClef" onKeyDown = "declaration.elements['changes'].click();" onKeyUp = "declaration.elements['changes'].click();"/>
</td>
<td class = "texte">
<wo:if condition = "$session.motClef"> <wo:textField name = "motclef2" id = "motCle2" value = "$session.motClef1" onKeyDown = "declaration.elements['changes'].click();" onKeyUp = "declaration.elements['changes'].click();"/> </wo:if>
</td>
<td class = "texte">
<wo:if condition = "$session.motClef1"> <wo:textField name = "motclef3" id = "motCle3" value = "$session.motClef2" onKeyDown = "declaration.elements['changes'].click();" onKeyUp = "declaration.elements['changes'].click();"/> </wo:if>
</td>
<td class = "texte">
<wo:if condition = "$session.motClef2"> <wo:textField name = "motclef4" id = "motCle4" value = "$session.motClef3" onKeyDown = "declaration.elements['changes'].click();" onKeyUp = "declaration.elements['changes'].click();"/> </wo:if>
</td>
<td class = "texte">
<wo:if condition = "$session.motClef3"><wo:textField name = "motclef5" value = "$session.motClef4" onKeyDown = "declaration.elements['changes'].click();" onKeyUp = "declaration.elements['changes'].click();"/></wo:if>
</td>
<td class = "texte">
<wo:if condition = "$session.motClef4"><wo:textField name = "motclef6" value = "$session.motClef5" onKeyDown = "declaration.elements['changes'].click();" onKeyUp = "declaration.elements['changes'].click();"/></wo:if>
</td>
</tr>
</table>
<wo:submitButton name = "changes" action = "$ctrl.motclef2" class = "hide" />
"
It works fine but there is lot of submit and it is not smooth but in the WebPage code source, when the new textField appears, it is automatically an HTML input Object and it is not the case of AjaxMethod. Why?
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden