You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Anjana Gopinath <an...@truenorth1.com> on 2007/04/05 16:09:49 UTC

T5 Loop

Hi,

I am trying to iterate over a list and display the values in a  
textfield. User can edit these values and i need to save these back  
to the list. I am able to display all the values, but the values are  
not getting updated when user saves them.

  <span t:type="form">
	<span t:type="Loop"  source="values" value="value" >
		<span t:type="textfield"  value="value"/>

	</span>
	<span t:type="submit"/>
</span>

Is this possible ? i searched in the mailing lists, but couldnt find  
any information.
Thanks

Anjana Gopinath
True North Technology





Re: T5: Hibernate integration question - with additional questions

Posted by Celia Mou <cm...@ocean7.com>.
Thanks again, Howard!

I think T5 is definitely going to be a great thing!

I'm going to donate, and hope there would be good funding for it.

Thanks!

celia


Howard Lewis Ship wrote:
> On 4/9/07, Celia Mou <cm...@ocean7.com> wrote:
>> Thanks for clarifying this, Howard!
>>
>> Now actually, i have related questions: My application needs to handle
>> file uploads, and work with third-party packages to generate graphs
>> (through generating from the backend either a custom link or javascript
>> for the html page), and occasionally redirect to non-Tapestry pages or
>> URLs, maybe manipulate the request, response and session  objects when
>> necessary. I'm not quite confident whether I can achieve these by using
>> the current unfinished T5.
>>
>
> I'm in crunch mode for two different clients at the moment, which is
> why I've been slow to get more T5 code out.
>
> As a side note ... if anyone want to *fund* the development of T5,
> that would get it out the door much, much faster.
>
> In terms of T5 status:
>
> Uploads are coming.
>
> Returning a custom URL from a T5 event handler method is either in
> place, or coming.
>
> You have full access to the Servlet API objects, or to the generic
> Request and Session objects, to allow you to manipulate request and
> session attributes.  Over time, more of the HttpServletRequest methods
> will be re-implemented in the Request wrapper.
>
> The trick is allowing outside servlet code to access the Tapestry
> objects (even if stored in the session), in that you can't predict
> what the session attribute key is going to be (the name used is
> predictable ... but subject to change at any time. It's part of the
> Tapestry internals).
>


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


Re: T5: Hibernate integration question

Posted by Howard Lewis Ship <hl...@gmail.com>.
On 4/9/07, Celia Mou <cm...@ocean7.com> wrote:
> Thanks for clarifying this, Howard!
>
> Now actually, i have related questions: My application needs to handle
> file uploads, and work with third-party packages to generate graphs
> (through generating from the backend either a custom link or javascript
> for the html page), and occasionally redirect to non-Tapestry pages or
> URLs, maybe manipulate the request, response and session  objects when
> necessary. I'm not quite confident whether I can achieve these by using
> the current unfinished T5.
>

I'm in crunch mode for two different clients at the moment, which is
why I've been slow to get more T5 code out.

As a side note ... if anyone want to *fund* the development of T5,
that would get it out the door much, much faster.

In terms of T5 status:

Uploads are coming.

Returning a custom URL from a T5 event handler method is either in
place, or coming.

You have full access to the Servlet API objects, or to the generic
Request and Session objects, to allow you to manipulate request and
session attributes.  Over time, more of the HttpServletRequest methods
will be re-implemented in the Request wrapper.

The trick is allowing outside servlet code to access the Tapestry
objects (even if stored in the session), in that you can't predict
what the session attribute key is going to be (the name used is
predictable ... but subject to change at any time. It's part of the
Tapestry internals).

> Do you think I can actually manage? What are the recommendations?
>
> Any help is greatly appreciated!
>
> celia
>
>
> Howard Lewis Ship wrote:
> > Sorry, it's just the sketch of the final library; I haven't had a
> > chance to cycle around and make it useful.
> >
> > On 4/6/07, Celia Mou <cm...@ocean7.com> wrote:
> >> Hi,
> >>
> >> Does anyone have a working example of Tapestry 5 and Hibernate
> >> integration?
> >>
> >> According to the limited docs on the Tapestry site, one needs to put the
> >> hibernate.cfg.xml file in the src/main/resources directory, and then
> >> maybe contribute the entity package to the
> >> tapestry.hibernate.HibernateSessionSource. It seems if one has the
> >> entities package under the base package, one doesn't even need to
> >> contribute.
> >>
> >> That's what I got. But then, where would you put the mapping files? And
> >> what's the typical way to instantiate and destroy Hibernate sessions?
> >>
> >> Well, in short, I'm a bit lost in this. Any hint will be greatly
> >> appreciated. Thanks!
> >>
> >> celia
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: T5: Hibernate integration question

Posted by Celia Mou <cm...@ocean7.com>.
Thanks for clarifying this, Howard!

Now actually, i have related questions: My application needs to handle 
file uploads, and work with third-party packages to generate graphs 
(through generating from the backend either a custom link or javascript 
for the html page), and occasionally redirect to non-Tapestry pages or 
URLs, maybe manipulate the request, response and session  objects when 
necessary. I'm not quite confident whether I can achieve these by using 
the current unfinished T5.

Do you think I can actually manage? What are the recommendations?

Any help is greatly appreciated!

celia


Howard Lewis Ship wrote:
> Sorry, it's just the sketch of the final library; I haven't had a
> chance to cycle around and make it useful.
>
> On 4/6/07, Celia Mou <cm...@ocean7.com> wrote:
>> Hi,
>>
>> Does anyone have a working example of Tapestry 5 and Hibernate 
>> integration?
>>
>> According to the limited docs on the Tapestry site, one needs to put the
>> hibernate.cfg.xml file in the src/main/resources directory, and then
>> maybe contribute the entity package to the
>> tapestry.hibernate.HibernateSessionSource. It seems if one has the
>> entities package under the base package, one doesn't even need to
>> contribute.
>>
>> That's what I got. But then, where would you put the mapping files? And
>> what's the typical way to instantiate and destroy Hibernate sessions?
>>
>> Well, in short, I'm a bit lost in this. Any hint will be greatly
>> appreciated. Thanks!
>>
>> celia
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


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


Re: T5: Hibernate integration question

Posted by Howard Lewis Ship <hl...@gmail.com>.
Sorry, it's just the sketch of the final library; I haven't had a
chance to cycle around and make it useful.

On 4/6/07, Celia Mou <cm...@ocean7.com> wrote:
> Hi,
>
> Does anyone have a working example of Tapestry 5 and Hibernate integration?
>
> According to the limited docs on the Tapestry site, one needs to put the
> hibernate.cfg.xml file in the src/main/resources directory, and then
> maybe contribute the entity package to the
> tapestry.hibernate.HibernateSessionSource. It seems if one has the
> entities package under the base package, one doesn't even need to
> contribute.
>
> That's what I got. But then, where would you put the mapping files? And
> what's the typical way to instantiate and destroy Hibernate sessions?
>
> Well, in short, I'm a bit lost in this. Any hint will be greatly
> appreciated. Thanks!
>
> celia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


T5: Hibernate integration question

Posted by Celia Mou <cm...@ocean7.com>.
Hi,

Does anyone have a working example of Tapestry 5 and Hibernate integration?

According to the limited docs on the Tapestry site, one needs to put the 
hibernate.cfg.xml file in the src/main/resources directory, and then 
maybe contribute the entity package to the  
tapestry.hibernate.HibernateSessionSource. It seems if one has the 
entities package under the base package, one doesn't even need to 
contribute.

That's what I got. But then, where would you put the mapping files? And 
what's the typical way to instantiate and destroy Hibernate sessions?

Well, in short, I'm a bit lost in this. Any hint will be greatly 
appreciated. Thanks!

celia

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


Re: T5 Loop

Posted by tamseo <ta...@key-planning.co.jp>.
Hi Anjana Gopinath

I'm having the same problem. Did you find the solution for it
Any one know how to fix it. It's very urgent for my project

Thanks

Tam


Anjana Gopinath-2 wrote:
> 
> Howard,
> 
> Thanks a lot for responding. I tried setting the volatile="true" for  
> the Loop component, but i still have the same issue. When i try  
> printing the first element of the ArrayList on the onSuccess method,  
> it still shows the old value.
> 
> Start.html
> ------------------------------------------------------------------------ 
> ----------------------
> 
> 
> 
> 
> 
> 
> --------------------------------------------------------------------
> 
> 
> Start.java
> ------------------
> public class Start
> {
> 	
> 	@Persist
> 	private ArrayList<String> values;
> 	
> 	
> 	private String value;
> 	
> 	public String getValue() {
> 		return value;
> 	}
> 
> 	public void setValue(String value) {
> 		this.value = value;
> 	}
> 
> 	@SetupRender
> 	public void fillValues()
> 	{
> 		System.out.println("fillvalues------------");
> 		 values = new ArrayList<String>();
> 		 values.add("test");
> 		 values.add("test1");
> 		this.setValues(values);
> 		
> 	}
> 
> 	public ArrayList<String> getValues() {
> 		return values;
> 	}
> 
> 	public void setValues(ArrayList<String> values) {
> 		this.values = values;
> 	}
> 	
> 	String onSuccess()
> 	{
> 		System.out.println(this.getValues().get(0));
> 		return null;
> 	}
> 	
> }
> 
> 
> 
> Anjana Gopinath
> True North Technology
> 
> 
> 
> 
> On Apr 5, 2007, at 10:18 AM, Howard Lewis Ship wrote:
> 
>> This should work, but it looks like you simplified your example.
>>
>> The Loop component records into the form (as hidden fields) the values
>> from its source parameter. When the form is submitted, it uses these
>> values, and ignores it source parameter.
>>
>> In the short term, you should be able to get the Loop and Form combo
>> to work by turning on the volatile parameter of the Loop.  In the long
>> run, you should provide a PrimaryKeyEncoder to the Loop, to guide it
>> in how to serialize the dynamic data into the Form.
>>
>> On 4/5/07, Anjana Gopinath <an...@truenorth1.com> wrote:
>>> Hi,
>>>
>>> I am trying to iterate over a list and display the values in a
>>> textfield. User can edit these values and i need to save these back
>>> to the list. I am able to display all the values, but the values are
>>> not getting updated when user saves them.
>>>
>>>   
>>>         
>>>                 
>>>
>>>         
>>>         
>>> 
>>>
>>> Is this possible ? i searched in the mailing lists, but couldnt find
>>> any information.
>>> Thanks
>>>
>>> Anjana Gopinath
>>> True North Technology
>>>
>>>
>>>
>>>
>>>
>>
>>
>> -- 
>> Howard M. Lewis Ship
>> TWD Consulting, Inc.
>> Independent J2EE / Open-Source Java Consultant
>> Creator and PMC Chair, Apache Tapestry
>> Creator, Apache HiveMind
>>
>> Professional Tapestry training, mentoring, support
>> and project work.  http://howardlewisship.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-Loop-tf3531856.html#a11245636
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 Loop

Posted by Anjana Gopinath <an...@truenorth1.com>.
Howard,

Thanks a lot for responding. I tried setting the volatile="true" for  
the Loop component, but i still have the same issue. When i try  
printing the first element of the ArrayList on the onSuccess method,  
it still shows the old value.

Start.html
------------------------------------------------------------------------ 
----------------------
<span t:type="form">
<span t:type="Loop"  source="values" value="value" volatile="true" >
<span t:type="textfield"  value="value"/>

</span>
<span t:type="submit"/>
--------------------------------------------------------------------


Start.java
------------------
public class Start
{
	
	@Persist
	private ArrayList<String> values;
	
	
	private String value;
	
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	@SetupRender
	public void fillValues()
	{
		System.out.println("fillvalues------------");
		 values = new ArrayList<String>();
		 values.add("test");
		 values.add("test1");
		this.setValues(values);
		
	}

	public ArrayList<String> getValues() {
		return values;
	}

	public void setValues(ArrayList<String> values) {
		this.values = values;
	}
	
	String onSuccess()
	{
		System.out.println(this.getValues().get(0));
		return null;
	}
	
}



Anjana Gopinath
True North Technology




On Apr 5, 2007, at 10:18 AM, Howard Lewis Ship wrote:

> This should work, but it looks like you simplified your example.
>
> The Loop component records into the form (as hidden fields) the values
> from its source parameter. When the form is submitted, it uses these
> values, and ignores it source parameter.
>
> In the short term, you should be able to get the Loop and Form combo
> to work by turning on the volatile parameter of the Loop.  In the long
> run, you should provide a PrimaryKeyEncoder to the Loop, to guide it
> in how to serialize the dynamic data into the Form.
>
> On 4/5/07, Anjana Gopinath <an...@truenorth1.com> wrote:
>> Hi,
>>
>> I am trying to iterate over a list and display the values in a
>> textfield. User can edit these values and i need to save these back
>> to the list. I am able to display all the values, but the values are
>> not getting updated when user saves them.
>>
>>   <span t:type="form">
>>         <span t:type="Loop"  source="values" value="value" >
>>                 <span t:type="textfield"  value="value"/>
>>
>>         </span>
>>         <span t:type="submit"/>
>> </span>
>>
>> Is this possible ? i searched in the mailing lists, but couldnt find
>> any information.
>> Thanks
>>
>> Anjana Gopinath
>> True North Technology
>>
>>
>>
>>
>>
>
>
> -- 
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


Re: T5 Loop

Posted by Howard Lewis Ship <hl...@gmail.com>.
This should work, but it looks like you simplified your example.

The Loop component records into the form (as hidden fields) the values
from its source parameter. When the form is submitted, it uses these
values, and ignores it source parameter.

In the short term, you should be able to get the Loop and Form combo
to work by turning on the volatile parameter of the Loop.  In the long
run, you should provide a PrimaryKeyEncoder to the Loop, to guide it
in how to serialize the dynamic data into the Form.

On 4/5/07, Anjana Gopinath <an...@truenorth1.com> wrote:
> Hi,
>
> I am trying to iterate over a list and display the values in a
> textfield. User can edit these values and i need to save these back
> to the list. I am able to display all the values, but the values are
> not getting updated when user saves them.
>
>   <span t:type="form">
>         <span t:type="Loop"  source="values" value="value" >
>                 <span t:type="textfield"  value="value"/>
>
>         </span>
>         <span t:type="submit"/>
> </span>
>
> Is this possible ? i searched in the mailing lists, but couldnt find
> any information.
> Thanks
>
> Anjana Gopinath
> True North Technology
>
>
>
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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