Please post your solution to the list. It makes it much easier for other folks to find it later.
--sam On 11/21/06, Patrick Klein <[EMAIL PROTECTED]> wrote:
Nevermind, found it 2 minutes after hitting the send button :) Patrick > Hi! > > I scraped the for-loop in favor of a hardcoded list of components > which does the trick for our needs here. It would have been nicer the > way below (and much more flexible) but i could not find a working > solution for the problem using this approach. > Now another question came up: > Using an EventListener with an Array of DOM-elements (e.g. > @EventListener(elements={"tag_1", "tag_2", ..., "tag_x"}, ...)) is > there a way to find out, for which element the listener was activated? > I checked BowserEvent and IRequestCycle but found nothing suitable so > far... > > Patrick >> Hi! >> >> I'm trying to use Ajax to update the content of a for-loop containing >> PropertySelections. The template for the table i want to update looks >> like this: >> >> <form jwcid="[EMAIL PROTECTED]" async="ognl:true" >> updateComponents="ognl:updateComponents"> >> <table> >> <tr> >> <th>Test</th> >> <th>Result</th> >> <th>Target</th> >> </tr> >> <tr jwcid="@For" element="tr" source="ognl:dataList" >> value="ognl:data"> >> 1) <td jwcid="@PropertySelection" id="ognl:data.testId" >> model="ognl:testModel" value="ognl:data.test"/> >> 2) <td jwcid="@PropertySelection" id="ognl:data.resultId" >> model="ognl:dynamicResultModel" value="ognl:data.result"/> >> 3) <td jwcid="@PropertySelection" id="ognl:data.targetId" >> model="ognl:dynamicTargetModel" value="ognl:data.target"/> >> <td jwcid="@Any" id="ognl:data.updateBlockId"> >> <div jwcid="@TextField" id="ognl:data.outputId" >> value="ognl:data.output"/> >> </td> >> </tr> >> </table> >> </form> >> >> id's are uniquely generated and found correctly inside the generated >> html-code. onchange EventListeners are given for the property >> selections. EventListeners are name so it is clear which element has >> caused the event. >> What i'm trying to accomplish is the following: >> User changes value of selection 1). This activates EventListener >> (async=true). This part actually works... that far. Now the >> PropertyModel of 2) should be changed (note that the table holds more >> then one line). >> Changes on 2) have an impact on the selection in 3), changes in 3) >> manipulate the output-field of the line. >> >> All this is working perfectly outside the for-loop. >> >> The problem now is that my selection-model goes amoc if change one of >> the properties a second time (numberFormatException in >> PropertySelection.translateValue(String s), s is actually null). >> Additionally not only the addressed selections get updated (e.g. >> changing the first selection in a line should only have an impact on >> the second and maybe third selection of the same line), but at least >> too other selections. The Browser shows a Property Selection with >> another PropertySelection inside instead of the updated selection. >> >> The main problem seems to that i need to address the selections to >> update uniquely, but how? The data-iterator is firmly on the last >> value is it is not null already and will be next updated on rewind... >> >> Can anyone help me out here? >> >> thnx in advance, >> Patrick >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]