Tuesday, 15 September 2015

java - JSP iterator syntax, iterator within another -


I have a syntax problem with another Iterator I want to reiterate values ​​of equipesParties But, I can not find the correct syntax.

This is a tag that causes the problem: value = "{equipesParties [# cpt.count ())}"

  & Lt; S: Iterator value = "equipes" var = "equipe" id = "equipe" position = "CPT" & gt; & Lt; Div style = "height: 30px; vertical-align: center;" & Gt; & Lt; Input type = "checkbox" class = "recoup" name = "equip" value = "& lt; s: asset value = '# equip.ID' / & gt; Id = "equipe_": asset value = '# equip.I./'> if: test = 'gallery.equipe.id == # equipe.id' & gt; check = "check Done "& lt; / s: if & gt; / & gt; label style =" float: none; Display: Inline; Padding-top: 0; "for =" equip_ & lt; S: Asset value = '#imships.id' /> "& gt; & lt; s: property value = '# equipe.name' / & gt; & lt; / label & gt; & lt; / div & Gt; & lt; div id = "galerie_partiebox" & lt; s: if test = 'gallery == ft. Gallery.partie == faucet' style = "display: none;" & lt; / S: if & gt; & gt; Select Lifestyle = "Float: None; S: If the test = 'parties! = Null' & gt; & lt; s: Iterator value = "{equipesParties [ # Cpt.count ())} "var =" partie ">  Option  selected =" selected " & Lt; / s: if & gt; value = "& lt; S: Asset Value = '#partie.id' /> gt; & gt; & lt; s: Asset Value = "#partie.gameName" /> gt; & lt; / options & gt; & lt; / s    / Div> 

The correct syntax is equipesParties [% {# cpt.index}] , but let me tell you another There is no need to use an iterator to create a selection box. Just use the selection tag provided by Strauss 2

Your (now working) code (2s : If, 2 S: asset, 1 iterator)

  select style = "float: none; Margin: 0 30 px; "Name =" partie "id =" select_partie ">  <: iterator value =" equipesParties [% {# cpt.index}] "Var =" partie "> gt; option & lt; s: if test = '# partie.id == gallery.partie.id'> selected =" selected "& lt; / s: if & Gt; value = "& lt; S: Asset Value = '#partie.id' /> gt; & gt;: Property Value = "#partie.gameName" />   same  result  
 with    

This simple tag can be replaced by: cssStyle = "float: margin: 0 0 30px; "Name =" partie "id =" select_partie "value =" gallery.partie.id "list =" equipesParties [% {# cpt.index}] "list =" id "list value =" playname "/>

I left your test = 'parties! = Null' & gt; because it was not valid; at least in a selection box Should be an option element.

Exclude from to hide it completely, if necessary.

No comments:

Post a Comment