Hi Geert,

This is timely for me too. :)

I think you might still have a typo.  I suspect the correct code (for 
1.5.1) is:

for (item : items) {
   setOutput("itemId", item.getId());
   setExitQuery(template, "cartaction");
   // or any other argument you need, see javadocs
   template.appendBlock("rows", "row");
}

Josh



Geert Bevin wrote:
> Bah, made a typo, this should do it:
> 
> for (item : items) {
>   setOutput("itemId", item.getId());
>   setExitQueryUrl("cartaction", template);
>   // or any other argument you need, see javadocs
>   template.appendBlock("rows", "row");
> }
> 
> On 6/20/07, Geert Bevin <[EMAIL PROTECTED]> wrote:
>> I don't really have time to explain it in detail, but basically the
>> way it's supposed to be done is for each row:
>> for (item : items) {
>> setOutput("itemId", item.getId());
>> setExitQueryUrl("EXIT:QUERY:cartaction", template); // or any other
>> argument you need, see javadocs
>> template.appendBlock("rows", "row");
>>
>> }
>>
>> On 6/20/07, Mork0075 <[EMAIL PROTECTED]> wrote:
>>> I'am not sure if this is Geert's intention pointing us to the keywords,
>>> but i didnt understand how you should pass the tableRows with datalinks
>>> to the next element. even if you pass the whole table instance to the
>>> next element, how much sense does this make for manipulating the bean
>>> represented by a special row?
>>>
>>> In the numberguess game you pass a gameid everytime you swith the
>>> element. This is clear. But how much sense does it make to pass the
>>> table structure? i would solve it this way mentioned below: let Rife
>>> create the links etc, but only pass the id of the bean to the
>>> editElement, how it is done in this example:
>>>
>>> <a href="${v EXIT:QUERY:cartaction/}remove/${v itemId/}">Remove</a>
>>>
>>> There you fetch the bean from the database with this specific id and then 
>>> do wheatwever you want with it.
>>>
>>> I think you have the idea of 'cutting' a special row by clicking on a link 
>>> and then the data from this row is 'extracted' and passed to the 
>>> editElement. This wouldnt be my intuitive understanding of solving this 
>>> problem.
>>>
>>> Here' another link of the sortable table example, perhaps this helps a 
>>> little bit to understand what Geert ment:
>>> http://rifers.org/wiki/display/RIFE/Sortable+table+example
>>>
>>>
>>>
>>>
>>> Matthias Barmeier schrieb:
>>>
>>>> Hi Mork,
>>>>
>>>> I understand the Numberguess example, but does this mean that I need an
>>>> invisible form for every
>>>> table row ?? And my links has to submit this form that is filled with
>>>> the bean ??
>>>>
>>>> Ciao
>>>>     Matze
>>>>
>>>> Mork0075 schrieb:
>>>>
>>>>> I have to correct myself, this explanation is quite good:
>>>>> http://rifers.org/wiki/display/RIFE/GuideNumberguess
>>>>>
>>>>> Matthias Barmeier schrieb:
>>>>>
>>>>>
>>>>>> Hi Geert,
>>>>>>
>>>>>> I have searched the wiki and looked up the things you mentioned. But one
>>>>>> point is not clear for me.
>>>>>>
>>>>>> How can I tie beans to a table row ?
>>>>>>
>>>>>> As I understand I can declare an output/input bean to transport data
>>>>>> through several pages using datalinks, but how do I put the bean from
>>>>>> the table row function (like edit) selected into that output bean.
>>>>>> Every row contains a different bean instance of the same class.
>>>>>>
>>>>>> Thanx in ad.
>>>>>>
>>>>>> Ciao
>>>>>>     Matze
>>>>>>
>>>>>> Geert Bevin schrieb:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi Matthias,
>>>>>>>
>>>>>>> while what Mork says will work, it's not the best approach in RIFE
>>>>>>> since you typically never work with URLs directly. You rather work
>>>>>>> with exits and submissions and declare the dataflow. RIFE will then
>>>>>>> properly create all the URLs for you.
>>>>>>>
>>>>>>> You can find the principle being explained here:
>>>>>>> http://rifers.org/wiki/display/RIFE/GuideNumberguess#GuideNumberguess-sect1numberguessdata
>>>>>>>
>>>>>>> Note that this is the most basic version of the functionality, and you
>>>>>>> can search the wiki for autolinks, annotations, globalvars,
>>>>>>> globalexits, ... to really facilitate your life in most situations.
>>>>>>>
>>>>>>> For another example that is relatively close to what you need, check
>>>>>>> out example 5, friends listing: http://rifers.org/examples#D.5
>>>>>>>
>>>>>>> Hope this helps,
>>>>>>>
>>>>>>> Geert
>>>>>>>
>>>>>>> On 6/19/07, Matthias Barmeier <[EMAIL PROTECTED]> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Thanks for you answer, this was my first approach but I am new to rife
>>>>>>>> and do not want to
>>>>>>>> transfer my struts know how directly to rife without asking if more
>>>>>>>> elegant solutions are available.
>>>>>>>>
>>>>>>>> Ciao
>>>>>>>>     Matze
>>>>>>>>
>>>>>>>>
>>>>>>>> Mork0075 schrieb:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Hello Matthias,
>>>>>>>>>
>>>>>>>>> i think this question is not rife specific, i would solve it this way 
>>>>>>>>> in
>>>>>>>>> any other web framework this way:
>>>>>>>>>
>>>>>>>>> On you interface, theres a link called 'E' (edit). This link points
>>>>>>>>> perhaps to the html page (processed by the element) /company/edit.htm.
>>>>>>>>> On generating your table filled with data, you also append a parameter
>>>>>>>>> to the url. In the template this looks like
>>>>>>>>>
>>>>>>>>> <a href="/company/edit.htm?[!V 'id'/]!"
>>>>>>>>>
>>>>>>>>> This placeholder will be substituted with the companyID. If someone
>>>>>>>>> clicks the link, the element /company/edit will handle this request. 
>>>>>>>>> In
>>>>>>>>> this element, you can read the parameter from the URL, fetch the 
>>>>>>>>> company
>>>>>>>>> Bean with this specific id from the database, override some fields and
>>>>>>>>> then update the Bean to the database.
>>>>>>>>>
>>>>>>>>> This would be all.
>>>>>>>>>
>>>>>>>>> Hope this helps
>>>>>>>>>
>>>>>>>>> Matthias Barmeier schrieb:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I am fairly new to rife and would be happy if someone of you could 
>>>>>>>>>> give
>>>>>>>>>> me some hints on how to manage the following:
>>>>>>>>>>
>>>>>>>>>> I have a table filled with data from a list of beans using an element
>>>>>>>>>> and template.appendBlock method.
>>>>>>>>>>
>>>>>>>>>> +------------+----------------+---------+
>>>>>>>>>> | Company    | Address        |         |
>>>>>>>>>> +------------+----------------+---------+
>>>>>>>>>> | MyCompany  | MyAddress      | E D C   |
>>>>>>>>>> +            +                +         +
>>>>>>>>>> | and so on..|                |         |
>>>>>>>>>> +------------+----------------+----------+
>>>>>>>>>>
>>>>>>>>>> I would like to have links for 'E' (edit), 'D' (delete), 'C' 
>>>>>>>>>> (check). If
>>>>>>>>>> someone selects 'E'
>>>>>>>>>> I would like to transport the Company bean to an element where I can
>>>>>>>>>> change content and store it via the persistence layer into the 
>>>>>>>>>> database.
>>>>>>>>>>
>>>>>>>>>> I cannot use crud because I use a AndorMDA generated hibernate based
>>>>>>>>>> persistence layer.
>>>>>>>>>>
>>>>>>>>>> My question is if someone of you could give me some hints or pointers
>>>>>>>>>> how to make this right with rife.
>>>>>>>>>>
>>>>>>>>>> Thanx in ad.
>>>>>>>>>>
>>>>>>>>>> Ciao
>>>>>>>>>>     Matze
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> Geert Bevin
>> Terracotta - http://www.terracotta.org
>> Uwyn "Use what you need" - http://uwyn.com
>> RIFE Java application framework - http://rifers.org
>> Music and words - http://gbevin.com
>>
> 
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"rife-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/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to