You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Hibowl <ju...@gmail.com> on 2007/10/02 13:22:25 UTC

[T5] Access table values from html

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#a12996923
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Access table values from html

Posted by Hibowl <ju...@gmail.com>.
Hi :)

It seems I'm not very clear, sorry for my english...

As I answered to Chris, I'd like to display all the elements on the same
page, but in different tables, that's why I can't tell my page before which
element to render...

Anyway, your explanation is very clear :) 

Thank you


kristian.marinkovic wrote:
> 
> i still do not understand what you want to do but i'll try to
> provide some usful explanations :)
> 
> if you have a list of elements you can render them using 
> a Loop component. The Loop component (see Component
> Reference) provides the source parameter to pass in the 
> list (or another collection). The Loop component also 
> provides a value (Object) and an index (int) parameter. 
> 
> During the loop the variables referenced through the index and
> value parameter will be updated with the current iteration count and 
> with the object  via their setter methods. So if you also provide
> getter methods for these variables you can access them in your
> template.
> 
> OGNL was used in T4 and provided means to access and return
> an object from a list by directly providing an index in the template
> or the .page file. This is not possible with T5s prop binding (eventually
> will provide this functionality -> see JIRA).
> 
> so if you know beforehand what object you need to can provide a 
> getter method for it
> 
> g
> kris
> 
> 
> 
> Hibowl <ju...@gmail.com> 
> 02.10.2007 15:44
> Bitte antworten an
> "Tapestry users" <us...@tapestry.apache.org>
> 
> 
> An
> users@tapestry.apache.org
> Kopie
> 
> Thema
> Re: [T5] Access table values from html
> 
> 
> 
> 
> 
> 
> 
> Ok, in fact I want all the objects from the list, but not in the same 
> table,
> that's why I dont think a Loop is usuable, because I won't display them 
> one
> after the other.
> 
> But even if I provide a getter for my object, I don't think I can tell my
> page which object for the List to render (because it changes).
> 
> Now, I have instanciated all the 15 Objects of the list, and I provide 15
> getters... But I don't think it's very optimal !!
> 
> Thanks a lot for your help Chris !!
> 
> 
> 
> 
> 
> 
> 
> Chris Lewis-5 wrote:
>> 
>> Ok, but _how_ do you want to get this object? It seems like you only 
>> want one of them from the List, so you won't need to Loop. If that's 
>> right then you need only to provide a getter for your object (this 
>> assumes your page knows which specific object is desired).
>> 
>> Hibowl wrote:
>>> 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#a12999029
> 
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 
> 

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


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Access table values from html

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
i still do not understand what you want to do but i'll try to
provide some usful explanations :)

if you have a list of elements you can render them using 
a Loop component. The Loop component (see Component
Reference) provides the source parameter to pass in the 
list (or another collection). The Loop component also 
provides a value (Object) and an index (int) parameter. 

During the loop the variables referenced through the index and
value parameter will be updated with the current iteration count and 
with the object  via their setter methods. So if you also provide
getter methods for these variables you can access them in your
template.

OGNL was used in T4 and provided means to access and return
an object from a list by directly providing an index in the template
or the .page file. This is not possible with T5s prop binding (eventually
will provide this functionality -> see JIRA).

so if you know beforehand what object you need to can provide a 
getter method for it

g
kris



Hibowl <ju...@gmail.com> 
02.10.2007 15:44
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
users@tapestry.apache.org
Kopie

Thema
Re: [T5] Access table values from html







Ok, in fact I want all the objects from the list, but not in the same 
table,
that's why I dont think a Loop is usuable, because I won't display them 
one
after the other.

But even if I provide a getter for my object, I don't think I can tell my
page which object for the List to render (because it changes).

Now, I have instanciated all the 15 Objects of the list, and I provide 15
getters... But I don't think it's very optimal !!

Thanks a lot for your help Chris !!







Chris Lewis-5 wrote:
> 
> Ok, but _how_ do you want to get this object? It seems like you only 
> want one of them from the List, so you won't need to Loop. If that's 
> right then you need only to provide a getter for your object (this 
> assumes your page knows which specific object is desired).
> 
> Hibowl wrote:
>> 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#a12999029

Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org



Re: [T5] Access table values from html

Posted by lasitha <la...@gmail.com>.
Hi, i'm joining this thread rather late, so i apologize for any
repetition - if you've already come up with a clean (!= 15 getters!)
solution, feel free to ignore this.

I'm trying to understand what makes your problem more complicated than
a typical loop...

It sounds to me like each table represents something _more_ than can
be represented by a single Fichier instance.  Is that true?  In other
words, is there information presented in a table that is not available
in the corresponding Fichier?  I ask this because in your example, one
of the columns has the hardcoded value 'Fichier 50': is this string
something that can't be encapsulated by the corresponding Fichier
instance?

If this is the case, is there some 'larger' class you might come up
with that encapsulates both the data in the Fichier and the other data
presented in the table?  If there is a single object that contains all
the data to be presented on one table, then your problem is reduced to
a simple loop.

I could be completely misunderstanding the problem, but i thought i'd
throw this out and see if i hit anything :)
Cheers,
lasitha.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Access table values from html

Posted by Hibowl <ju...@gmail.com>.
Yes , I will use a loop to generate my tables... But I have 2 or more objects
to display in each table...
Anyway, I think I'm going to find a solution !




Chris Lewis-5 wrote:
> 
> Using loop you can create a new table for each object, so if you want to 
> display them all, this is what you want. If you want only one, then you 
> should know which before hand and make it available to the template via 
> a getter.
> 
> Hibowl wrote:
>> Yes, it's quite ridiculous :) But I needed to test...
>>
>> My page should display all the objects (in fact the IDs) on the same
>> page,
>> but on different tables :) !! 
>>
>> I think the loop with if components could be a good idea !! But I thought
>> there was a way to display only one element of the list...(with an index
>> parameter maybe).
>>
>> The help from the community is great :) I always search the mailing-list
>> before posting, and I have to say that it already help me a lot !!
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Chris Lewis-5 wrote:
>>   
>>> No, 15 getters would most likely be ridiculous. What I still don't know 
>>> is will this page be displaying all 15 at once (in different tables), or 
>>> will it display only 1 based on a choice made by the user?
>>>
>>> If one, the separate your logic for extracting the selected one from the 
>>> list, possibly in an action handler or onActivate (if the selection is 
>>> made by a PageLink and context).
>>> If you are going to display more than one on the same page, then provide 
>>> that collection as a single List by a getter. Your template can then use 
>>> Loop (and conditional If components if needed) to display them.
>>>
>>> Any clearer?
>>>
>>> You are welcome for the help :-). T5 is great but still young and a bit 
>>> weak in documentation, so the community has to make up for that. I've 
>>> received much help from this list.
>>>
>>> chris
>>>
>>> Hibowl wrote:
>>>     
>>>> Ok, in fact I want all the objects from the list, but not in the same
>>>> table,
>>>> that's why I dont think a Loop is usuable, because I won't display them
>>>> one
>>>> after the other.
>>>>
>>>> But even if I provide a getter for my object, I don't think I can tell
>>>> my
>>>> page which object for the List to render (because it changes).
>>>>
>>>> Now, I have instanciated all the 15 Objects of the list, and I provide
>>>> 15
>>>> getters... But I don't think it's very optimal !!
>>>>
>>>> Thanks a lot for your help Chris !!
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Chris Lewis-5 wrote:
>>>>   
>>>>       
>>>>> Ok, but _how_ do you want to get this object? It seems like you only 
>>>>> want one of them from the List, so you won't need to Loop. If that's 
>>>>> right then you need only to provide a getter for your object (this 
>>>>> assumes your page knows which specific object is desired).
>>>>>
>>>>> Hibowl wrote:
>>>>>     
>>>>>         
>>>>>> 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#a13000478
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Access table values from html

Posted by Chris Lewis <ch...@bellsouth.net>.
Using loop you can create a new table for each object, so if you want to 
display them all, this is what you want. If you want only one, then you 
should know which before hand and make it available to the template via 
a getter.

Hibowl wrote:
> Yes, it's quite ridiculous :) But I needed to test...
>
> My page should display all the objects (in fact the IDs) on the same page,
> but on different tables :) !! 
>
> I think the loop with if components could be a good idea !! But I thought
> there was a way to display only one element of the list...(with an index
> parameter maybe).
>
> The help from the community is great :) I always search the mailing-list
> before posting, and I have to say that it already help me a lot !!
>
>
>
>
>
>
>
>
>
> Chris Lewis-5 wrote:
>   
>> No, 15 getters would most likely be ridiculous. What I still don't know 
>> is will this page be displaying all 15 at once (in different tables), or 
>> will it display only 1 based on a choice made by the user?
>>
>> If one, the separate your logic for extracting the selected one from the 
>> list, possibly in an action handler or onActivate (if the selection is 
>> made by a PageLink and context).
>> If you are going to display more than one on the same page, then provide 
>> that collection as a single List by a getter. Your template can then use 
>> Loop (and conditional If components if needed) to display them.
>>
>> Any clearer?
>>
>> You are welcome for the help :-). T5 is great but still young and a bit 
>> weak in documentation, so the community has to make up for that. I've 
>> received much help from this list.
>>
>> chris
>>
>> Hibowl wrote:
>>     
>>> Ok, in fact I want all the objects from the list, but not in the same
>>> table,
>>> that's why I dont think a Loop is usuable, because I won't display them
>>> one
>>> after the other.
>>>
>>> But even if I provide a getter for my object, I don't think I can tell my
>>> page which object for the List to render (because it changes).
>>>
>>> Now, I have instanciated all the 15 Objects of the list, and I provide 15
>>> getters... But I don't think it's very optimal !!
>>>
>>> Thanks a lot for your help Chris !!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Chris Lewis-5 wrote:
>>>   
>>>       
>>>> Ok, but _how_ do you want to get this object? It seems like you only 
>>>> want one of them from the List, so you won't need to Loop. If that's 
>>>> right then you need only to provide a getter for your object (this 
>>>> assumes your page knows which specific object is desired).
>>>>
>>>> Hibowl wrote:
>>>>     
>>>>         
>>>>> 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 !
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   
>>>>>>>>>       
>>>>>>>>>           
>>>>>>>>>               
>>>>>>>>>                   
>>>>>>>>     
>>>>>>>>         
>>>>>>>>             
>>>>>>>>                 
>>>>>>>   
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>   
>>>>>       
>>>>>           
>>>>     
>>>>         
>>>   
>>>       
>>
>>     
>
>   


Re: [T5] Access table values from html

Posted by Hibowl <ju...@gmail.com>.
Yes, it's quite ridiculous :) But I needed to test...

My page should display all the objects (in fact the IDs) on the same page,
but on different tables :) !! 

I think the loop with if components could be a good idea !! But I thought
there was a way to display only one element of the list...(with an index
parameter maybe).

The help from the community is great :) I always search the mailing-list
before posting, and I have to say that it already help me a lot !!









Chris Lewis-5 wrote:
> 
> No, 15 getters would most likely be ridiculous. What I still don't know 
> is will this page be displaying all 15 at once (in different tables), or 
> will it display only 1 based on a choice made by the user?
> 
> If one, the separate your logic for extracting the selected one from the 
> list, possibly in an action handler or onActivate (if the selection is 
> made by a PageLink and context).
> If you are going to display more than one on the same page, then provide 
> that collection as a single List by a getter. Your template can then use 
> Loop (and conditional If components if needed) to display them.
> 
> Any clearer?
> 
> You are welcome for the help :-). T5 is great but still young and a bit 
> weak in documentation, so the community has to make up for that. I've 
> received much help from this list.
> 
> chris
> 
> Hibowl wrote:
>> Ok, in fact I want all the objects from the list, but not in the same
>> table,
>> that's why I dont think a Loop is usuable, because I won't display them
>> one
>> after the other.
>>
>> But even if I provide a getter for my object, I don't think I can tell my
>> page which object for the List to render (because it changes).
>>
>> Now, I have instanciated all the 15 Objects of the list, and I provide 15
>> getters... But I don't think it's very optimal !!
>>
>> Thanks a lot for your help Chris !!
>>
>>
>>
>>
>>
>>
>>
>> Chris Lewis-5 wrote:
>>   
>>> Ok, but _how_ do you want to get this object? It seems like you only 
>>> want one of them from the List, so you won't need to Loop. If that's 
>>> right then you need only to provide a getter for your object (this 
>>> assumes your page knows which specific object is desired).
>>>
>>> Hibowl wrote:
>>>     
>>>> 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#a12999402
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Access table values from html

Posted by Chris Lewis <ch...@bellsouth.net>.
No, 15 getters would most likely be ridiculous. What I still don't know 
is will this page be displaying all 15 at once (in different tables), or 
will it display only 1 based on a choice made by the user?

If one, the separate your logic for extracting the selected one from the 
list, possibly in an action handler or onActivate (if the selection is 
made by a PageLink and context).
If you are going to display more than one on the same page, then provide 
that collection as a single List by a getter. Your template can then use 
Loop (and conditional If components if needed) to display them.

Any clearer?

You are welcome for the help :-). T5 is great but still young and a bit 
weak in documentation, so the community has to make up for that. I've 
received much help from this list.

chris

Hibowl wrote:
> Ok, in fact I want all the objects from the list, but not in the same table,
> that's why I dont think a Loop is usuable, because I won't display them one
> after the other.
>
> But even if I provide a getter for my object, I don't think I can tell my
> page which object for the List to render (because it changes).
>
> Now, I have instanciated all the 15 Objects of the list, and I provide 15
> getters... But I don't think it's very optimal !!
>
> Thanks a lot for your help Chris !!
>
>
>
>
>
>
>
> Chris Lewis-5 wrote:
>   
>> Ok, but _how_ do you want to get this object? It seems like you only 
>> want one of them from the List, so you won't need to Loop. If that's 
>> right then you need only to provide a getter for your object (this 
>> assumes your page knows which specific object is desired).
>>
>> Hibowl wrote:
>>     
>>> 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 !
>>>>>>>
>>>>>>>
>>>>>>>   
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>   
>>>>>       
>>>>>           
>>>>     
>>>>         
>>>   
>>>       
>>
>>     
>
>   


Re: [T5] Access table values from html

Posted by Hibowl <ju...@gmail.com>.
Ok, in fact I want all the objects from the list, but not in the same table,
that's why I dont think a Loop is usuable, because I won't display them one
after the other.

But even if I provide a getter for my object, I don't think I can tell my
page which object for the List to render (because it changes).

Now, I have instanciated all the 15 Objects of the list, and I provide 15
getters... But I don't think it's very optimal !!

Thanks a lot for your help Chris !!







Chris Lewis-5 wrote:
> 
> Ok, but _how_ do you want to get this object? It seems like you only 
> want one of them from the List, so you won't need to Loop. If that's 
> right then you need only to provide a getter for your object (this 
> assumes your page knows which specific object is desired).
> 
> Hibowl wrote:
>> 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#a12999029
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Access table values from html

Posted by Chris Lewis <ch...@bellsouth.net>.
Ok, but _how_ do you want to get this object? It seems like you only 
want one of them from the List, so you won't need to Loop. If that's 
right then you need only to provide a getter for your object (this 
assumes your page knows which specific object is desired).

Hibowl wrote:
> 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 !
>>>>>
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>>     
>>>>         
>>>   
>>>       
>>
>>     
>
>   


Re: [T5] Access table values from html

Posted by Hibowl <ju...@gmail.com>.
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Access table values from html

Posted by Chris Lewis <ch...@bellsouth.net>.
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 !
>>>
>>>
>>>   
>>>       
>>
>>     
>
>   


Re: [T5] Access table values from html

Posted by Hibowl <ju...@gmail.com>.
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#a12998400
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Access table values from html

Posted by Chris Lewis <ch...@bellsouth.net>.
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 !
>
>
>