I'm maybe not very clear, I will try to describe better.
I have an ArrayList from Fichier, and I'd like to display their IDs.

Start.java :

private ArrayList<Fichier> _listeFichiers;
private Fichier _fichier;

//+getters/setters

Fichier.java : 
private fichierId;
...
//+getters/setters



Start.html : I have several tables with Fichier descriptions, and there is a
cell where I want to display the Id of the Fichier :

 <table id="tbFichiers" summary="Fichiers">
  
   <tr>
       <th id="th1" class="colonnefichiers"> # Numéro Ordre </th>
       <th id="th2">
          # Description  
       </th>
       <th id="th3" class="colonneavancement">Avancement</th>
       <th id="th4" class="colonnenotifications">Etat </th>
         </tr>
     <tr>
           <td class="tdlft" headers="th1"><t:pagelink page="fichiers/detail"
context=${fichier.id} onmouseover="return overlib('Afficher détails fichier
50.');" onmouseout="return nd();"><strong>Fichier 50</strong></t:pagelink>
javascript:void(0); ? </td>
           <td class="tdlft" headers="th2">alerte</td>
           <td headers="th3"><strong>Fichier Id : ${fichier.id}</strong></td>
           <td headers="th4"><strong>Etat </strong></td>
         </tr>
         .......
   </table>


My problem is how to display the Id of the fichier, I would like to specify
the index in the array, so that it could render the good id.

Am I clear enough ?

thanks :)




Chris Lewis-5 wrote:
> 
> I'm sorry I'm afraid I don't understand your situation. If you could 
> explain what exactly you are trying to do, maybe I can help.
> 
> chris
> 
> Hibowl wrote:
>> Hi, 
>> thanks for your answer. I tried with the loop, but I need to display only
>> one value. I think I could use the index parameter for Loop, but I don't
>> see
>> how to link it with my List.
>>
>> http://www.nabble.com/T5%3A-How-to-acces-to-an-array-from-loop--tf3599642.html#a10054876
>> Here is an example, but how can I use it with my example ?
>>
>> Thank you for your help !
>>
>>
>> Chris Lewis-5 wrote:
>>   
>>> This is a pretty basic operation that you can learn by doing the T5 
>>> tutorial.
>>> It sounds like you want to enumerate a list and display something for 
>>> each iteration - a String property from each Fichier instance. To do 
>>> this you need the T5 Loop 
>>> <http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#orgapachetapestrycorelibcomponentsloop>
>>>  
>>> component. Your page provides the List (any Iterable), but must also 
>>> provide a property for holding a member of the List for each iteration 
>>> (the value parameter of the Loop). So in your page you need:
>>>
>>> //The Iterable.
>>> private ArrayList<Fichier> listeFichiers;
>>>
>>> //The "current" element.
>>> private Fichier fichier;
>>>
>>> //now you need at least a getter for your list, and both a getter and a 
>>> setter for fichier.
>>>
>>> In your template you can now:
>>>
>>> <t:loop source="listeFichiers" value="fichier">
>>>     ${fichier.field}
>>> </t:loop>
>>>
>>> Note that ${fichier.field} will result in a call to the method 
>>> Fichier#getField.
>>>
>>> Hibowl wrote:
>>>     
>>>> Hi,
>>>>
>>>> I'd like to access the values of a List from my html page, but I don't
>>>> know
>>>> how to do that...
>>>>
>>>> Start.java :
>>>>
>>>> private ArrayList<Fichier> listeFichiers;
>>>>
>>>> (getter/setter).
>>>>
>>>>
>>>> Start.html :
>>>> I want to display a field from Fichier (type String). But how can I
>>>> access
>>>> to it ? Is there a way to use such a ${listeFichiers...} with a
>>>> parameter
>>>> ?
>>>>
>>>> Thank you for any help !
>>>>
>>>>
>>>>   
>>>>       
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-T5--Access-table-values-from-html-tf4554333.html#a12998692
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to