Sagewire Logo

T5: Palette doesn't retrieved the latest object from DB

4 Message(s) by 2 Author(s) originally posted in tapestry java


From: Joshua Jackson Date:   Friday, December 21, 2007
Dear all,

I have used the T5 palette component that use list of object that is
retrieved from database . So the item under the 'available' is
retrieved from the database. That way I expect when I move it to the
'selected' then update it to the database, it wouldn't be available
anymore under the 'available'. But what I get is, it seems it cache
the object and it did not retrieved the latest object from the
database. How do I get the latest object from database with T5
pallette?

Has anyone succeed with this problem?

I use T 5.0.7-SNAPSHOT

Thanks in advance
--
I'm a code r not a drag-n-dropper

Blog: http://joshuaJAVA.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxx


From: Sven Homburg Date:   Friday, December 21, 2007
you must refill the select model on every request. I do it within the SetupRender method like this:

private List<ReportDatasource> _datasourceList;

@xxxxxxxxxxx(parameters = {"value=entity.datasource",
"model=datasourceModel", "encoder=datasourceEncoder",
"label=message:label.datasource"})
private Select _inputDatasource;

@xxxxxxxxxxx
public void doSetupRender()
{
_datasourceList = getDefaultDAO(ReportDatasource.class).findAll();
}

public SelectModel getDatasourceModel()
{
return new DatasourceSelectModel(_datasourceList,
_propertyAccess, false);
}

best regards
S.Homburg

Joshua Jackson schrieb:
Dear all,
I have used the T5 palette component that use list of object that is
retrieved from database. So the item under the 'available' is
retrieved from the database. That way I expect when I move it to the
'selected' then update it to the database, it wouldn't be available
anymore under the 'available'. But what I get is, it seems it cache
the object and it did not retrieved the latest object from the
database. How do I get the latest object from database with T5
pallette?
Has anyone succeed with this problem?
I use T 5.0.7-SNAPSHOT
Thanks in advance



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxx


From: Sven Homburg Date:   Friday, December 21, 2007
here an other approche:

@xxxxxxxxxxx("flash")
private DatasourceSelectModel _datasourceSelectModel;

@xxxxxxxxxxx
public void doSetupRender()
{
_datasourceSelectModel = new
DatasourceSelectModel(getDefaultDAO(ReportDatasource.class).findAll(),
_propertyAccess, false);
}

public SelectModel getDatasourceModel()
{
return _datasourceSelectModel;
}

best regards
S.Homburg

Joshua Jackson schrieb:
Dear all,
I have used the T5 palette component that use list of object that is
retrieved from database. So the item under the 'available' is
retrieved from the database. That way I expect when I move it to the
'selected' then update it to the database, it wouldn't be available
anymore under the 'available'. But what I get is, it seems it cache
the object and it did not retrieved the latest object from the
database. How do I get the latest object from database with T5
pallette?
Has anyone succeed with this problem?
I use T 5.0.7-SNAPSHOT
Thanks in advance



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxx


From: Joshua Jackson Date:   Wednesday, December 26, 2007
Thanks Sven,

This approach works best. I also like the code better than the first approach.

Cheers

wrote in message:
here an other approche:
@xxxxxxxxxxx("flash")
private DatasourceSelectModel _datasourceSelectModel;
@xxxxxxxxxxx
public void doSetupRender()
{
_datasourceSelectModel = new
DatasourceSelectModel(getDefaultDAO(ReportDatasource.class).findAll(),
_propertyAccess, false);
}
public SelectModel getDatasourceModel()
{
return _datasourceSelectModel;
}


--
I'm a coder not a drag-n-dropper

Blog: http://joshuaJAVA.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxx



Next Message: T5: Tapestry-Test



Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional