Dear All,

I have one problem to discuss with all of you.
its about to display multilevel data in view.

For example,
I have 3 list of data which related to each other.

I createted PropertyBag for each list

PropertyBag["S1"] is the parent data
PropertyBag["S2"] is child of "S1" and parent of "S3"
PropertyBag["S3"] is child of "S2".

each of the data inside these propertybag have to bind into
checkboxfield.
so i create #set for each of it.
And use nvelocity Foreach loop to display them into the table

My problem occur when S1 have more then one data that have child its
just display the first S1 data with all child but not the next S1 data
with child.

Below is my code to review

<table width="750">
  <tr>

       <th width="250" style="text-align:center">Sub Level 1</th>
       <th width="250" style="text-align:center">Sub Level 2</th>
       <th width="250" style="text-align:center">Sub Level 3</th>


 </tr>

#set($List1 = $FormHelper.CreateCheckboxList("SubMenu1", $S1, "%
{value='Id'}"))
#set($List2 = $FormHelper.CreateCheckboxList("SubMenu2", $S2, "%
{value='Id'}"))
#set($List3 = $FormHelper.CreateCheckboxList("SubMenu3", $S3, "%
{value='Id'}"))


             #foreach($elem in $List1)
                   #if($elem.Child =="Y")
                         #set($b=0)

                            #foreach($elem2 in $List2)

                                 #if($elem2.Smenu1.Id==$elem.Id)

                                         #if($elem2.Child =="Y")

                                                #set($c=0)
                                                       #foreach($elem3
in $List3)

                                                             #if
($elem3.Smenu2.Id==$elem2.Id)

 
<tr>
 
<td >
 
#if($b==0)
 
$List1.Item() $elem.Name
 
#end


 
</td>
 
<td>
 
#if($c==0)
 
$List2.Item() $elem2.Name
 
#end
 
</td>
 
<td> $List3.Item() $elem3.Name
 
#set($c=$c+1)
 
</td>
 
</tr>
 
#end
                                                             #end
                                                   #else
                                              <tr>
                                                  <td>
                                                      #if($b==0)
                                                         $List1.Item()
$elem.Name
                                                      #end
                                                    </td>
                                                    <td>

                                                      $List2.Item()
$elem2.Name
                                                      #set($b=$b+1)
                                                     </td>
                                                    <td> </td>
                                                     </tr>
                                                #end
                                        #end
                                  #end
                            #else
                          <tr>
                          <td>
                                  $List1.Item() $elem.Name

                          </td>
                          <td></td>
                           <td> </td>
                           </tr>

                      #end
                  #end

</table>
</div>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to