You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by bigcache1 <sh...@gmail.com> on 2011/10/16 16:44:07 UTC
Attribute question
I have component with SelectModel:
@Property
private SelectModel facilitySelect = new FacilitySelectModel(dao);
and that model implemented in data package:
public class FacilitySelectModel extends AbstractSelectModel {
private List<OptionModel> options = new ArrayList<OptionModel>(3);
public FacilitySelectModel(CrudServiceDAO dao) {
List<Facility> facilities = dao.findWithNamedQuery(Facility.ALL);
for (Facility f : facilities)
options.add(new OptionModelImpl(f.getName(), f.getFacilityId()));
}
public List<OptionGroupModel> getOptionGroups() {
return null;
}
public List<OptionModel> getOptions() {
return options;
}
}
So my problem is that with such approach data for selectmodel is loaded at
the startup or first request, and not updates then. So if I add new facility
- it won't be in the selection list, until I restart whole application. So
what should I do, to see fresh information with each request?
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Attribute-question-tp4907045p4907045.html
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: Attribute question
Posted by bigcache1 <sh...@gmail.com>.
Found an ajax select, thanks a lot!
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Attribute-question-tp4907045p4907664.html
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: Attribute question
Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
Have you taken a look at JumpStart
http://jumpstart.doublenegative.com.au/home.html
for inspiration?
On Oct 16, 2011, at 12:30 PM, bigcache1 wrote:
> Another question in the row - how to update underlying value each time when
> selection changed?
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Attribute-question-tp4907045p4907225.html
> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Attribute question
Posted by bigcache1 <sh...@gmail.com>.
Another question in the row - how to update underlying value each time when
selection changed?
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Attribute-question-tp4907045p4907225.html
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: Attribute question
Posted by bigcache1 <sh...@gmail.com>.
Works nice, thanks a lot!
I just thought about some attribute for facilitySelect property
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Attribute-question-tp4907045p4907088.html
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: Attribute question
Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
Why not do it at
@Inject
private DAO dao;
void onPrepareForRender(){
facilitySelect = new FacilitySelectModel(dao);
}
regards
Taha
On Oct 16, 2011, at 8:14 PM, bigcache1 wrote:
> I have component with SelectModel:
> @Property
> private SelectModel facilitySelect = new FacilitySelectModel(dao);
>
>
> and that model implemented in data package:
>
> public class FacilitySelectModel extends AbstractSelectModel {
>
> private List<OptionModel> options = new ArrayList<OptionModel>(3);
>
> public FacilitySelectModel(CrudServiceDAO dao) {
> List<Facility> facilities = dao.findWithNamedQuery(Facility.ALL);
> for (Facility f : facilities)
> options.add(new OptionModelImpl(f.getName(), f.getFacilityId()));
> }
>
> public List<OptionGroupModel> getOptionGroups() {
> return null;
> }
>
> public List<OptionModel> getOptions() {
> return options;
> }
> }
>
>
> So my problem is that with such approach data for selectmodel is loaded at
> the startup or first request, and not updates then. So if I add new facility
> - it won't be in the selection list, until I restart whole application. So
> what should I do, to see fresh information with each request?
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Attribute-question-tp4907045p4907045.html
> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org