Re: T5: mixing select component onchange=this.form.submit() and zone component

2008-04-06 Thread ice96

Thanks, I removed t:submit/
Now submit works but I'm getting error:

org.apache.tapestry.runtime.ComponentEventException
A component event handler method returned the value
[EMAIL PROTECTED] Return type
org.apache.tapestry.internal.structure.BlockImpl can not be handled.
Configured return types are java.lang.Class, java.lang.String, java.net.URL,
org.apache.tapestry.Link, org.apache.tapestry.StreamResponse,
org.apache.tapestry.runtime.Component.
-- 
View this message in context: 
http://www.nabble.com/T5%3A-mixing-select-component-onchange%3D%22this.form.submit%28%29%22-and-zone-component-tp16516982p16521656.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5: multiple sessions with Tapestry-Hibernate?

2008-04-06 Thread Angelo Chen

Hi,

I have a need to generate a sequential ID for employee entity, the entity
has its own primary key which is auto incremented. I use a one-record table
that has a field 'next_id', every time when a new employee is added, I'll
just get that record and increment the field, this works most of the time,
but if there are multiple workstations adding new employees, problem will
happen, it will have this 'dead lock' issue. I'm thinking of
accessing/incrementing the one-record table to be in a separate Hibernate
session, it will immediately flush after incrementing the 'next_id', this
will leave a very small window for that record to be locked and allowing
other workstations to continue, and question is, does Tapestry-Hibernate
allow multiple Hibernate sessions? if not, any solution to this? Thanks.

Angelo
-- 
View this message in context: 
http://www.nabble.com/T5%3A-multiple-sessions-with-Tapestry-Hibernate--tp16522245p16522245.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: mixing select component onchange=this.form.submit() and zone component

2008-04-06 Thread ice96

Ok. Now I found solurtion. for onSelect we can use tapestry5 components.
Now my trouble with zone and block component
Test5:tml:
html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
head
titleAjax test/title
/head
body


t:block t:id=dynamicBlock
fun dynamic block!
${color}
t:beaneditform t:id=oRegisterEquipmentForm
submitlabel=order

reorder=name,surname,frequency,weekDay,lecture,laptop,multimedia,auditorium,destination,bring,group,add_notes,dateFrom,dateTo
/
br/

/t:block

form t:type=Form t:id=playerForm t:zone=zoneToUpdatet:label
for=color /: t:select t:id=color model=literal:Red,Green,Blue
t:mixins=t5components/OnEvent event=change
onCompleteCallback=onSelectCompleteFunction //form

t:zone t:id=zoneToUpdate
Content before update
/t:zone


script type=text/javascript
function onSelectCompleteFunction(response)
{
$('zoneToUpdate').update(response);
}

/script
/body
/html


Test5.java:

package org.stml.stmljms.pages.operators;

import java.util.Date;

import org.apache.tapestry.Block;
import org.apache.tapestry.StreamResponse;
import org.apache.tapestry.annotations.OnEvent;
import org.apache.tapestry.annotations.Property;
import org.apache.tapestry.corelib.components.Zone;
import org.apache.tapestry.ioc.annotations.Inject;
import org.apache.tapestry.util.TextStreamResponse;
import org.stml.stmljms.forms.ORegisterEquipmentForm;
import org.stml.stmljms.services.OrderService;

public class Test5 {
@Inject
private OrderService orderService;

@Property
private String color;
private ORegisterEquipmentForm oRegisterEquipmentForm;

@Inject
private Block dynamicBlock;


public String getColor() {
return color;
}

public void setColor(String color) {
System.out.println(xxx asd);
this.color = color;
}

public ORegisterEquipmentForm getORegisterEquipmentForm() {
return oRegisterEquipmentForm;
}

public void setORegisterEquipmentForm(
ORegisterEquipmentForm registerEquipmentForm) {
oRegisterEquipmentForm = registerEquipmentForm;
}

@OnEvent(component = color, value = change)
public Block onChange()
{
 System.out.println(it works);
 return dynamicBlock;
 //return new TextStreamResponse(text/html, new 
Date().toString());
}
/*
@OnEvent(component = playerForm, value = success)
private Block successFromTheForm() {
System.out.println(sitas irgi veikia);
return dynamicBlock;
}
*/
/*
 * @OnEvent(value = submit) public Object save() { //
 *
(oRegisterEquipmentForm.getDateTo()-oRegisterEquipmentForm.getDateFrom())
 * orderService.setOrder(oRegisterEquipmentForm); return 
operators/Start;
}
 */
}



I got view with java script debug. Anyone could help me?
Btw. Data component in block doesn't work.:(

http://www.nabble.com/file/p16522871/Screenshot.png Screenshot.png 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-mixing-select-component-onchange%3D%22this.form.submit%28%29%22-and-zone-component-tp16516982p16522871.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: .class coercion

2008-04-06 Thread Alejandro Scandroli
Hi Gabriel,

I know this message is a little bit old, but I just found it today.
Here is my Class coercion code:

public static void contributeTypeCoercer(ConfigurationCoercionTuple
configuration)
{
CoercionClass, String classToString = new CoercionClass, 
String()
{
public String coerce(Class clazz)
{
return clazz.getName();
}
};

CoercionString, Class stringToClass = new CoercionString, 
Class()
{
public Class coerce(String className)
{
try
{
return Class.forName(className);

} catch (ClassNotFoundException e)
{
throw new RuntimeException(Coercion 
failed!, e);
}
}
};

configuration.add(new CoercionTupleClass, String(Class.class,
String.class, classToString));
configuration.add(new CoercionTupleString, Class(String.class,
Class.class, stringToClass));
}



--
Alejandro Scandroli - http://weblog.amneris.es/
Amneris: We build process-driven web applications.
http://www.amneris.es


On Mon, Feb 25, 2008 at 4:04 PM, Gabriel Landais [EMAIL PROTECTED] wrote:
 Hello,
  I've a bean with a Class? property. I want to display the simple name,
 without success.

  First it understands well that (T5.0.10) :

public static void
 contributeDefaultDataTypeAnalyzer(MappedConfigurationClass?, String
 configuration) {
configuration.add(Class.class, text);
}

  It display something like class my.package.entity.
  As I'm trying to contribute my own TypeCoercer, it looks like it is not
 used :

public static void contributeTypeCoercer(ConfigurationCoercionTuple
 configuration) {
CoercionClass, String coercionClassString = new CoercionClass,
 String() {
public String coerce(Class input) {
if (input == null) {
return ;
}
// my code normally looksup an enum
return input.getSimpleName();
}
};
configuration.add(new CoercionTupleClass, String(Class.class,
 String.class, coercionClassString));
}

  Any idea? I've added a read only property for the moment, perhaps a best
 way...

  --
  Gabriel [EMAIL PROTECTED]
  http://www.codelutin.com
  tel : 02 40 50 29 28 / fax : 09 59 92 29 28


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



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



Re: Mixin rendering a component

2008-04-06 Thread Imants Firsts
I have an entity with one-to-many relationship to other
entity - i.e. this entity contains a field of type
ListEntity2.

I have a component which displays this list of objects.
For normal screen I just use this component. But for
edit screen for the main entity I would like to add
some functionality to my list component - i.e. add a
Delete button for each item, which would submit the
enclosing form.

I wanted to use Mixin, since I can't extend template
and override some part of it like I can do with java class.

I think the solution could be to for my edit component
to extend the view component and completely override
it's template, by duplicating it and adding the Delete
buttons.

Quoting Josh Canfield [EMAIL PROTECTED]:
 I don't see any way to render a component from a
mixin. I'm not sure
 of a use case where you'd want to do that with a
mixin. Can you tell
 us what you are trying to do? Then maybe someone can
offer another
 solution.
 
 Josh
 
 On Fri, Apr 4, 2008 at 3:22 PM, Imants Firsts
[EMAIL PROTECTED] wrote:
  Anyone has any idea? Maybe some other solution?
 
 
  Quoting Imants Firsts [EMAIL PROTECTED]:
   Can mixin render a component, for example
TextField? I
   know that that it does not support templates and that
   it can render the input tag directly.
   But I would like the mixin to add a component to
form,
   so that it can be processed when the form is
submitted.
   Is something like that possible with mixins?
  
   Imants
 
 
 
-
  To unsubscribe, e-mail:
[EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
 
 
 
 
 
 -- 
 --
 TheDailyTube.com. Sign up and get the best new videos
on the internet
 delivered fresh to your inbox.
 

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


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



session-less forms

2008-04-06 Thread Fernando Padilla
I have a requirement to not depend on HttpSession, but the Form 
component has a @Persist field that Tapestry wants to store in a 
session.  What are some options to avoid this?



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



RE: Mixin rendering a component

2008-04-06 Thread Jonathan Barker

Would it be acceptable to keep the list outside of the form, and use
ActionLinks with the id's of the items to be deleted?

You could then have a conditional on your list component for whether or not
the column with the ActionLink is displayed.

Jonathan



 -Original Message-
 From: Imants Firsts [mailto:[EMAIL PROTECTED]
 Sent: Sunday, April 06, 2008 4:30 PM
 To: Tapestry users
 Subject: Re: Mixin rendering a component
 
 I have an entity with one-to-many relationship to other
 entity - i.e. this entity contains a field of type
 ListEntity2.
 
 I have a component which displays this list of objects.
 For normal screen I just use this component. But for
 edit screen for the main entity I would like to add
 some functionality to my list component - i.e. add a
 Delete button for each item, which would submit the
 enclosing form.
 
 I wanted to use Mixin, since I can't extend template
 and override some part of it like I can do with java class.
 
 I think the solution could be to for my edit component
 to extend the view component and completely override
 it's template, by duplicating it and adding the Delete
 buttons.
 
 Quoting Josh Canfield [EMAIL PROTECTED]:
  I don't see any way to render a component from a
 mixin. I'm not sure
  of a use case where you'd want to do that with a
 mixin. Can you tell
  us what you are trying to do? Then maybe someone can
 offer another
  solution.
 
  Josh
 
  On Fri, Apr 4, 2008 at 3:22 PM, Imants Firsts
 [EMAIL PROTECTED] wrote:
   Anyone has any idea? Maybe some other solution?
  
  
   Quoting Imants Firsts [EMAIL PROTECTED]:
Can mixin render a component, for example
 TextField? I
know that that it does not support templates and that
it can render the input tag directly.
But I would like the mixin to add a component to
 form,
so that it can be processed when the form is
 submitted.
Is something like that possible with mixins?
   
Imants
  
  
  
 -
   To unsubscribe, e-mail:
 [EMAIL PROTECTED]
   For additional commands, e-mail:
 [EMAIL PROTECTED]
  
  
 
 
 
  --
  --
  TheDailyTube.com. Sign up and get the best new videos
 on the internet
  delivered fresh to your inbox.
 
 
 -
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


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



RE: Mixin rendering a component

2008-04-06 Thread Imants Firsts
I consider ActionLinks wrong from the architectural
perspective. You really should not send GET requests
which deletes entities. Any crawler that crawls such a
page would be devastating.

Quoting Jonathan Barker [EMAIL PROTECTED]:
 Would it be acceptable to keep the list outside of
the form, and use
 ActionLinks with the id's of the items to be deleted?
 
 You could then have a conditional on your list
component for whether or
 not
 the column with the ActionLink is displayed.
 
 Jonathan
 
 
 
  -Original Message-
  From: Imants Firsts [mailto:[EMAIL PROTECTED]
  Sent: Sunday, April 06, 2008 4:30 PM
  To: Tapestry users
  Subject: Re: Mixin rendering a component
  
  I have an entity with one-to-many relationship to other
  entity - i.e. this entity contains a field of type
  ListEntity2.
  
  I have a component which displays this list of objects.
  For normal screen I just use this component. But for
  edit screen for the main entity I would like to add
  some functionality to my list component - i.e. add a
  Delete button for each item, which would submit the
  enclosing form.
  
  I wanted to use Mixin, since I can't extend template
  and override some part of it like I can do with
java class.
  
  I think the solution could be to for my edit component
  to extend the view component and completely override
  it's template, by duplicating it and adding the Delete
  buttons.
  
  Quoting Josh Canfield [EMAIL PROTECTED]:
   I don't see any way to render a component from a
  mixin. I'm not sure
   of a use case where you'd want to do that with a
  mixin. Can you tell
   us what you are trying to do? Then maybe someone can
  offer another
   solution.
  
   Josh
  
   On Fri, Apr 4, 2008 at 3:22 PM, Imants Firsts
  [EMAIL PROTECTED] wrote:
Anyone has any idea? Maybe some other solution?
   
   
Quoting Imants Firsts [EMAIL PROTECTED]:
 Can mixin render a component, for example
  TextField? I
 know that that it does not support templates
and that
 it can render the input tag directly.
 But I would like the mixin to add a component to
  form,
 so that it can be processed when the form is
  submitted.
 Is something like that possible with mixins?

 Imants
   
   
   
 
-
To unsubscribe, e-mail:
  [EMAIL PROTECTED]
For additional commands, e-mail:
  [EMAIL PROTECTED]
   
   
  
  
  
   --
   --
   TheDailyTube.com. Sign up and get the best new videos
  on the internet
   delivered fresh to your inbox.
  
  
 
-
   To unsubscribe, e-mail:
  [EMAIL PROTECTED]
   For additional commands, e-mail:
  [EMAIL PROTECTED]
  
  
 
-
  To unsubscribe, e-mail:
[EMAIL PROTECTED]
  For additional commands, e-mail:
[EMAIL PROTECTED]
 
 

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


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



RE: Mixin rendering a component

2008-04-06 Thread Jonathan Barker

Actually, that's an interesting point. In general, I don't do crawlable
apps, so it's not an issue.

Keep the list out of your main form.  In the list, generate a column that
contains a form (one for each row) with the context set to the id of the
item to be deleted. Submit button now triggers your delete.

Same approach - different tool.



 -Original Message-
 From: Imants Firsts [mailto:[EMAIL PROTECTED]
 Sent: Sunday, April 06, 2008 6:25 PM
 To: Tapestry users
 Subject: RE: Mixin rendering a component
 
 I consider ActionLinks wrong from the architectural
 perspective. You really should not send GET requests
 which deletes entities. Any crawler that crawls such a
 page would be devastating.
 
 Quoting Jonathan Barker [EMAIL PROTECTED]:
  Would it be acceptable to keep the list outside of
 the form, and use
  ActionLinks with the id's of the items to be deleted?
 
  You could then have a conditional on your list
 component for whether or
  not
  the column with the ActionLink is displayed.
 
  Jonathan
 
 
 
   -Original Message-
   From: Imants Firsts [mailto:[EMAIL PROTECTED]
   Sent: Sunday, April 06, 2008 4:30 PM
   To: Tapestry users
   Subject: Re: Mixin rendering a component
  
   I have an entity with one-to-many relationship to other
   entity - i.e. this entity contains a field of type
   ListEntity2.
  
   I have a component which displays this list of objects.
   For normal screen I just use this component. But for
   edit screen for the main entity I would like to add
   some functionality to my list component - i.e. add a
   Delete button for each item, which would submit the
   enclosing form.
  
   I wanted to use Mixin, since I can't extend template
   and override some part of it like I can do with
 java class.
  
   I think the solution could be to for my edit component
   to extend the view component and completely override
   it's template, by duplicating it and adding the Delete
   buttons.
  
   Quoting Josh Canfield [EMAIL PROTECTED]:
I don't see any way to render a component from a
   mixin. I'm not sure
of a use case where you'd want to do that with a
   mixin. Can you tell
us what you are trying to do? Then maybe someone can
   offer another
solution.
   
Josh
   
On Fri, Apr 4, 2008 at 3:22 PM, Imants Firsts
   [EMAIL PROTECTED] wrote:
 Anyone has any idea? Maybe some other solution?


 Quoting Imants Firsts [EMAIL PROTECTED]:
  Can mixin render a component, for example
   TextField? I
  know that that it does not support templates
 and that
  it can render the input tag directly.
  But I would like the mixin to add a component to
   form,
  so that it can be processed when the form is
   submitted.
  Is something like that possible with mixins?
 
  Imants



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


   
   
   
--
--
TheDailyTube.com. Sign up and get the best new videos
   on the internet
delivered fresh to your inbox.
   
   
  
 -
To unsubscribe, e-mail:
   [EMAIL PROTECTED]
For additional commands, e-mail:
   [EMAIL PROTECTED]
  
  
  
 -
   To unsubscribe, e-mail:
 [EMAIL PROTECTED]
   For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 -
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: T5: multiple sessions with Tapestry-Hibernate?

2008-04-06 Thread Josh Canfield

does Tapestry-Hibernate
allow multiple Hibernate sessions? if not, any solution to this?  
Thanks.


Yes, you can grab the HibernateSessionSource and call create to get a  
second session.


You are responsible for this session, so make sure you close it.

Josh



On Apr 6, 2008, at 2:04 AM, Angelo Chen wrote:



Hi,

I have a need to generate a sequential ID for employee entity, the  
entity
has its own primary key which is auto incremented. I use a one- 
record table
that has a field 'next_id', every time when a new employee is added,  
I'll
just get that record and increment the field, this works most of the  
time,
but if there are multiple workstations adding new employees, problem  
will

happen, it will have this 'dead lock' issue. I'm thinking of
accessing/incrementing the one-record table to be in a separate  
Hibernate
session, it will immediately flush after incrementing the 'next_id',  
this
will leave a very small window for that record to be locked and  
allowing
other workstations to continue, and question is, does Tapestry- 
Hibernate
allow multiple Hibernate sessions? if not, any solution to this?  
Thanks.


Angelo
--
View this message in context: 
http://www.nabble.com/T5%3A-multiple-sessions-with-Tapestry-Hibernate--tp16522245p16522245.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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




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



Re: session-less forms

2008-04-06 Thread Josh Canfield
I have a requirement to not depend on HttpSession, but the Form  
component has a @Persist field that Tapestry wants to store in a  
session.  What are some options to avoid this?



I may have posted this before, but here it is again. I think it's a  
pretty good solution.


I created a session persistence strategy that only stores non-null  
values, and extended the Form to only store the validation if there  
are errors... The changes to the existing classes are minor.


Here's the code.

import org.apache.tapestry.ValidationTracker;
import org.apache.tapestry.ValidationTrackerImpl;
import org.apache.tapestry.annotations.Persist;

/**
 * Overrides the core [EMAIL PROTECTED]  
org.apache.tapestry.corelib.components.Form} in order to store the  
validation tracker only

 * when there is something to track.
 * p/
 * Created by IntelliJ IDEA.
 * User: joshcanfield
 * Date: Oct 26, 2007
 */
public class Form extends org.apache.tapestry.corelib.components.Form {
@Persist(nonnull)
private ValidationTracker _tracker;

private ValidationTracker _nonPersistedTracker;

public ValidationTracker getDefaultTracker() {
if (_nonPersistedTracker == null) {
if (_tracker != null) {
// _tracker is loaded via injection magic when it's  
in the session

_nonPersistedTracker = _tracker;
} else {
_nonPersistedTracker = new ValidationTrackerImpl();
}
}
return _nonPersistedTracker;
}

public void setDefaultTracker(ValidationTracker defaultTracker) {
_nonPersistedTracker = defaultTracker;
}

protected void onAction() {
if (_nonPersistedTracker.getHasErrors()) {
_tracker = _nonPersistedTracker;
} else {
_tracker = null;
}
}

}


import org.apache.tapestry.internal.services.PersistentFieldChangeImpl;
import static  
org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;

import static org.apache.tapestry.ioc.internal.util.Defense.notBlank;
import org.apache.tapestry.services.PersistentFieldChange;
import org.apache.tapestry.services.PersistentFieldStrategy;
import org.apache.tapestry.services.Request;
import org.apache.tapestry.services.Session;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: joshcanfield
 * Date: Oct 26, 2007
 */
public class NonNullSessionPersistentFieldStrategy implements  
PersistentFieldStrategy {

/**
 * Prefix used to identify keys stored in the session.
 */
static final String PREFIX = nonnull:;

private final Request _request;

protected NonNullSessionPersistentFieldStrategy(Request request) {
_request = request;
}

public final CollectionPersistentFieldChange  
gatherFieldChanges(String pageName) {

Session session = _request.getSession(false);

if (session == null) return Collections.emptyList();

ListPersistentFieldChange result = newList();

String fullPrefix = PREFIX + pageName + :;

for (String name : session.getAttributeNames(fullPrefix)) {
PersistentFieldChange change = buildChange(name,  
session.getAttribute(name));


result.add(change);
}

return result;
}

public void discardChanges(String pageName) {
Session session = _request.getSession(false);

if (session == null) return;

String fullPrefix = PREFIX + pageName + :;

for (String name : session.getAttributeNames(fullPrefix)) {
session.setAttribute(name, null);
}
}

private PersistentFieldChange buildChange(String name, Object  
attribute) {
// TODO: Regexp is probably too expensive for what we need  
here. Maybe an IOC InternalUtils

// method for this purpose?

String[] chunks = name.split(:);

// Will be empty string for the root component
String componentId = chunks[2];
String fieldName = chunks[3];

return new PersistentFieldChangeImpl(componentId, fieldName,  
attribute);

}

public final void postChange(String pageName, String componentId,  
String fieldName, Object newValue) {

notBlank(pageName, pageName);
notBlank(fieldName, fieldName);
StringBuilder builder = new StringBuilder(PREFIX);
builder.append(pageName);
builder.append(':');

if (componentId != null) builder.append(componentId);

builder.append(':');
builder.append(fieldName);
// because we don't want to create a session when the object  
is null

Session session = _request.getSession(newValue != null);
if (session != null) {
session.setAttribute(builder.toString(), newValue);
}
}

}

Add this to your app module:

public void contributePersistentFieldManager(
MappedConfigurationString, PersistentFieldStrategy  

tapestry hibernate breakage in Apr 6 5.0.12-SNAPSHOT

2008-04-06 Thread Julian Wood
The latest snapshot changed something with tapestry-ioc or tapestry- 
hibernate.


I had an ApplicationInitializer in my AppModule:

public static void  
contributeApplicationInitializer 
(OrderedConfigurationApplicationInitializerFilter configuration,
 
org.hibernate.Session session) {

BootStrapper bootStrapper = new DataBootStrapper(session);
configuration.add(UserInitializer, bootStrapper);
}

which then did something like this:

public DataBootStrapper(Session session) {
this.session = session;
}

public void initializeApplication(Context context,  
ApplicationInitializer applicationInitializer) {

Country ca = new Country(Canada, true);
session.save(ca);
applicationInitializer.initializeApplication(context);
}

This all worked fine until today's snapshot. Now no data is committed  
to the database, and no errors are thrown. Even if you wrap with your  
own txn, nothing happens:


public void initializeApplication(Context context,  
ApplicationInitializer applicationInitializer) {

session.beginTransaction();
Country ca = new Country(Canada, true);
session.save(ca);
session.getTransaction().commit();
applicationInitializer.initializeApplication(context);
}

Reverting back to a previous tapestry snapshot or 5.0.11 (for ioc,  
core, and hibernate) fixes the problem. Anyone know what happened? Do  
I need a new approach or is this a regression bug?


Thanks,

J



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



Re: How to redirect in component

2008-04-06 Thread Angelo Chen

hi,

maybe you can do this in onActivate,

String onActivate()
{
   // check login if not redirect
   return login;
}

but a better approach is, using Dispatcher, you can find some good articles
in the Tapestry5's wiki pages.

Angelo,



txhdeve wrote:
 
 I made a layout component for my application.In this layout I want to
 implement this function that to check whether user login the system,if
 not,then redirect the login page.How to finish it. I try to do this in
 @BeginRender,but this method only return the booean or void .How can I
 redirect other pages?
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-redirect-in-component-tp16532137p16532602.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: tapestry hibernate breakage in Apr 6 5.0.12-SNAPSHOT

2008-04-06 Thread Angelo Chen

Hi Julian,

I've seen https://issues.apache.org/jira/browse/TAPESTRY-2247 closed, is it
the reason for ur code not to work? 


Julian Wood wrote:
 
 The latest snapshot changed something with tapestry-ioc or tapestry- 
 hibernate.
 
 I had an ApplicationInitializer in my AppModule:
 
  public static void  
 contributeApplicationInitializer 
 (OrderedConfigurationApplicationInitializerFilter configuration,
   
 org.hibernate.Session session) {
  BootStrapper bootStrapper = new DataBootStrapper(session);
  configuration.add(UserInitializer, bootStrapper);
  }
 
 which then did something like this:
 
  public DataBootStrapper(Session session) {
  this.session = session;
  }
 
  public void initializeApplication(Context context,  
 ApplicationInitializer applicationInitializer) {
  Country ca = new Country(Canada, true);
  session.save(ca);
  applicationInitializer.initializeApplication(context);
  }
 
 This all worked fine until today's snapshot. Now no data is committed  
 to the database, and no errors are thrown. Even if you wrap with your  
 own txn, nothing happens:
 
  public void initializeApplication(Context context,  
 ApplicationInitializer applicationInitializer) {
   session.beginTransaction();
  Country ca = new Country(Canada, true);
  session.save(ca);
   session.getTransaction().commit();
  applicationInitializer.initializeApplication(context);
  }
 
 Reverting back to a previous tapestry snapshot or 5.0.11 (for ioc,  
 core, and hibernate) fixes the problem. Anyone know what happened? Do  
 I need a new approach or is this a regression bug?
 
 Thanks,
 
 J
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/tapestry-hibernate-breakage-in-Apr-6-5.0.12-SNAPSHOT-tp16531440p16533312.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: error on DateField component

2008-04-06 Thread Ahmad Maimunif
i use
tapestry 5.1.10
ie v6

t:DateField t:id=post_dateField t:value=lesson.post_date t:label=Post 
Date/

post_date is java.util.Date

Josh Canfield [EMAIL PROTECTED] wrote: Generally your questions are more 
likely to be answered if you provide
some information about your problem.

How about:
What version of Tapestry are you using? (4.x.x? 5.x.x?)
What browser are you using?
What DateField are you using?
How are you adding the DateField?

Even better, dig deeper:
What Object is throwing the error?
What property or method isn't supported?

Does this look like your problem?
https://issues.apache.org/jira/browse/TAPESTRY-2320

Josh


2008/4/2 Ahmad Maimunif 
:
 There is an error (client side) when i press DateField icon
 Object soen't support this property or method
 help me please..


 -
 Bergabunglah dengan orang-orang yang berwawasan, di bidang Anda di Yahoo! 
 Answers



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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




   
-
Kunjungi halaman depan Yahoo! Indonesia yang baru!

is there tapestry 5 component for htmlarea?

2008-04-06 Thread Ahmad Maimunif
where can i find it?

thx

   
-
Bergabunglah dengan orang-orang yang berwawasan, di bidang Anda di Yahoo! 
Answers