Hi,
I have a component TabPanel with the following parameter:
@Property
@Parameter(value = prop:resources.id, defaultPrefix =
BindingConstants.LITERAL)
private String clientId;
which value I use as id=${clientId} in the .tml
If I put multiple instances of this
This is not really a Tapestry problem but a CSS issue..
If you don't know what CSS classes are applied to some element in your html,
use something like FireBug, or Chrome to inspect this. You can see what CSS
rules are applied and what is overridden. Then you can easily override these
rules if
Hi,
I have a form where a part of it consists of a List. I tried to do the
following:
*.java*
@Property
private ListCoordinateDto coordinates;
@Property
private CoordinateDto coordinate;
@Property
private int loop = 0;
*.tml*
t:loop t:source=coordinates t:value=coordinate
Hi,
I solved it by adding the encoder parameter as you suggested:
t:loop t:source=coordinates t:value=coordinate t:encoder=encoder
t:index=loop
public ValueEncoderCoordinateDto getEncoder() {
return new ValueEncoderCoordinateDto() {
@Override
Now for validation purposes I need to be able to access these created fields
in my onValidate method.
Any idea how I can achieve this?
I saw ComponentResources.getEmbeddedComponent(), but have not had success
with that yet.
Any pointers?
--
View this message in context:
Did you use the zone parameter for your select?
Here you find the documentation with an example:
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Select.html
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Select.html
Could
Hi,
Thanks Taha, I solved it in the following way:
I don't really want to add something to my Language enum.
I replaced it with a dummy html radio input as you suggested. To make it a
part of the whole radiogroup I had to add the name attribute. Now I also had
to add the value attribute with an
Hi,
I have a RadioGroup with options based on an enum (Language).
*.tml*
t:radiogroup t:value=selectedLanguage
t:loop t:source=languages t:value=loopLanguage
t:radio t:value=language /
${format:labeled=language.description}
/t:loop
/t:radiogroup
*.class*
@Property
Hi,
I made a simple Chart component using Google charts api.
(I also use tapestry5-jquery)
I have the following in this component: (stripped down)
@SetupRender
void setup() {
javascriptSupport.importJavaScriptLibrary(https://www.google.com/jsapi;);
}
I forgot to mention that in the component I add the javascript file
containing the initializer method drawCharts like this:
@Import(library = context:/JQuery/charts.js)
If I put this on the page containing this component instead on the component
it does work from the first submit. (Probably
Maybe you can make an implementation of AssetSource
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Switching-assets-based-on-something-different-than-language-tp5718854p5718856.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
Just for the interested:
After some more research I found that setting the version manually (which is
not recommended by Hibernate) didn't work because of what is described here:
https://forum.hibernate.org/viewtopic.php?p=2293177sid=2969aa867c7086b4a3c7a68bda853690#p2293177
It's a really old
Thanks for the example (and JumpStart in general).
You point on doing the commit in onValidate makes sense, so i changed that.
I removed the manual version check as you suggest (which ofcourse makes
sense). So I actually ended up having what I had at the start of making this
mail thread. So I
Hi,
I'm not sure if this question belongs here, but thought it might have been
something that others came along too.
I have a Tapestry application using Hibernate. Now I am trying to add
Hibernate's optimistic locking using a Timestamp.
In my Tapestry page I have an activation context to
Hi,
Thanks for the explanation. Yes with I understand its not working I meant
my approach is failing. I understand optimistic locking is working, but just
don't know how to make use of it.
So you mean I have to use Persist instead of activation context?
--
View this message in context:
Nice idea and seems to work.
I changed to Integer version, because as you all said it is recommended and
timestamp is sligthly less safe.
So I have this now:
Index.class
public class Index {
@Inject
private PersonRepository personRepo;
@Property
private
Doesn't seem to work.
It does work if I do the following:
.tml
-
t:hidden t:value=version /
.class
--
@Property
private Integer version;
void setupRender() {
version = person.getVersion()
}
void onSuccess() {
if(version == person.getVersion) {
// do update
}
Thanks for the ideas, I will look into this :)
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Tapestry-Hibernate-optimistic-locking-tp5718413p5718431.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
When do you run the javascript? Is the content of the blocks rendered when
you apply this javascript?
Maybe you should make a simple mixin which you assign to the input fields.
--
View this message in context:
Hmm I'm not sure I understand what you mean with, or how to achieve something
like that:
Lance Java wrote
ValidationTracker is an environmental so you could wrap the existing
ValidationTracker and push() the wrapper onto the environment and keep
track of the fields this way.
Can you give me
ValidationTrackerImpl is final, so I cannot extend this class. But I found
ValidationTrackerWrapper class, maybe I should extend this?
I'm trying something like this:
public class ValidationFieldTracker extends ValidationTrackerWrapper {
private ListField fields;
public
Hi,
I have a form where I do some server side validation on submit. This form is
in a zone and gets submitted with ajax. Now if I want the fields with errors
to be decorated accordingly, I have to update this zone.
If I don't want to update the full zone, but just decorate these fields with
- More client side validation feeling
- avoid unnecessary rerendering, database queries, etc.
- some elements in the zone that were visually altered with javascript get
reset to their initial state
- ...
It's not a big problem, but it would surely be better if I could avoid these
problems. But
Ok it works with the onPassivate in this case:
void onActivate(int policyId) {
if(policy == null) {
policy = policyRepository.get(policyId);
}
}
int onPassivate() {
return policy.getId();
I think you just need to pass a parameter to your component that defines
wheter to show that part yes or not.
So in your component:
@Parameter
@Property
private boolean showRight;
in .tml:
t:if test=showRight
t:delegate to=right/
p:else
/p:else
/t:if
--
Hi
I have a page with an activation context:
void onActivate(int policyId) {
policy = policyRepository.get(policyId);
}
Now I have a component on this page which does AJAX requests. At this point
the policy variable set in the activation context is null.
Now I can 'solve' this by using
Hi,
If you are using tapestry5-jquery (http://tapestry5-jquery.com/), they have
a mixin that does this:
Reveal (http://tapestry5-jquery.com/mixins/docsreveal)
If you don't want to use tapestry5-jquery, you could always search for a
javascript 'popup' that fits your needs and create your own
Hi,
I'm working on an ajax multistep form wizard component for in our
webapplication.
I pass the different 'views' as informal parameters and delegate them to the
right place. In my component I have these view blocks surrounded with a Form
component. Now I would like to catch the Form events into
Ok I think I found the answer: Event bubbling
Now my bigger problem is that I can't give the Form component inside the
Wizard component a dynamic id, because component ids are static.
What I was trying: (doesn't work)
Wizard.tml
t:Form t:id=${formId}
...
/t:Form
Wizard.java
Hi Robert,
Thanks, that solves my problem, didn't know it would be so easy :)
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/catch-events-from-Form-in-component-tp5717772p5717782.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
Hi,
I have a problem with executing some javascript after an ajax call to a
tapestry event.
*Test.class*
public class Test {
@Inject
private ComponentResources componentResources;
@Inject
private AjaxResponseRenderer ajaxResponseRenderer;
I have no client code, so yea that's why it probably doesn't work...
First my code was like this:
I had a callback function on the ajax request in my .tml:
which works.
But I wanted to remove javascript from my .tml files and while doing this I
thought AjaxResponseRenderer.addCallback would
I think I found it:
*$.tapestry.utils.loadScriptsInReply(r);*
I put this in the ajax request callback function and looks like its working
now. So now my Test page code looks like:
public class Test {
@Inject
private ComponentResources componentResources;
What do you mean with height; more rows? Then you can use a TextArea with
rows and cols attributes.
If you just want visual height of the text TextField then you'll need CSS.
Why can't you use CSS?
--
View this message in context:
Well I'm afraid you just can't set focus on a hidden element. So you have to
try to set the focus after it is visible. Maybe use of
Tapestry.ZONE_UPDATED_EVENT as lance firstly suggested might work.
$('formZone').observe(Tapestry.ZONE_UPDATED_EVENT, function(event) {
// set the focus
});
Hi,
I have a component (grid) where I added a javascript onclick event on my
rows where I do an ajax (jquery) request to a component event:
$.get('${onRowClickEventLink}');
This all works fine, but I also want to update some zones after this event
so I added this to the event method:
void
Yep I use tapestry5-jquery :)
Ok so I added the following code to my javascript click events callback:
if (responseJSON.zones) {
// perform multi zone update
$.each(responseJSON.zones, function(zoneId) {
$('#' + zoneId).tapestryZone(applyContentUpdate,
responseJSON.zones[zoneId]);
});
Hi,
I'm not sure what periodic zone updater you are talking about, but I
remember with the Zone component the update parameter was by default
highlight. You could set it to show to get rid of the yellow
highlighting.
Not sure if this helps you with your problem though.
Greetings,
Nathan
--
Normally that's all you have to do.
Are you sure you used @Test annotation on your test method?
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/How-to-add-JUnit-Tests-in-default-tapestry-pom-tp5713713p5713714.html
Sent from the Tapestry - User mailing list archive at
Maybe try
integer=your error message
or field specific:
valueNumeric-integer=your error message
Did not test them though
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Change-the-label-of-component-id-tp5713562p5713572.html
Sent from the Tapestry - User mailing list
I use tapestry-spring-security in my Tapestry app.
I added @Secured(ROLE_SYSADMIN) in one of my pages and also in my
AppModule I added:
public static void contributeApplicationDefaults(MappedConfigurationString,
String configuration)
{
Your jquery selector is wrong I think it has to be $('#mediaZone'). So with
the # as it's the id attribute.
Also I always use jqueries bind function. Not sure if thats the problem
though.
$('#mediaZone').bind(Tapestry.ZONE_UPDATED_EVENT, function(event) {
...
}
--
View this message in
Hi,
In my current project I want to add some kind of side bar with some extra
functions/data in the form of icons with a panel that slides open
(javascript). These items can be global or more page specific. Example:
Search: visible on every page
Notes: visible on specific pages, containing data
Hi,
Thanks that's what I needed. I have now the global items in my Layout
component. And I can add some from within a Page as a parameter.
My code at the moment (simplified):
*Layout.tml:*
div id=sidePanel
[items that are shown on every page]
t:delegate to=sidePanelContent /
/div
Hi,
For our current project we need a kind of customer service chat function. A
logged in user can see if there is an admin online and can start a
one-to-one chat (simple text).
Is there already something made for Tapestry like this? Or who can help me
with some pointers on how to start working
Hi,
I use the t:validate attribute to assign client side validation to a input
field.
Now what I want to do: if a specific radio input has been checked? I need to
add a validator to another input element. If it is unchecked the validator
should be removed.
I can add the attribute via javascript,
Hi,
But the difficult part is how to set the RadioInputChecked value when its
getting (un)checked.
I could catch it in javascript and do an ajax request to an Event and then
set this value. But this all looks so much for such a simple problem.
If someone has a better idea please share
--
View
Ok,
thanks for the explanation, also on the constructing of zone updates.
I tested it with the time and your right. Is there any way I can know if in
the ZONE_UPDATED_EVENT of the inner zone (zone1) comes from a zone1 or zone2
update? Because I have javascript code in the zone1 update event,
Found a solution for my problem (not sure if it's a good solution, but it
works):
In the update event of the parent zone (zone1 in my example) I added an if
statement to know if it's not just an inner zone that's getting updated:
$('#zone1').bind(Tapestry.ZONE_UPDATED_EVENT, function(event) {
Hi,
I have this construction in my .tml (simplified):
t:Zone t:id=zone1 id=zone1
t:Zone t:id=zone2 id=zone2
t:Form t:id=form t:zone=zone2
t:Submit /
/t:Form
/t:Zone
/t:Zone
In my page class:
@InjectComponent
private Zone Zone2;
public void onSubmitFromForm() {
Hi all,
In a .properties file of a page I have:
test=%
I just want to show the percent symbol, but then I get this error:
org.apache.tapestry5.ioc.internal.util.TapestryException
Conversion = '%'
I have tried different things like with as results:
Change properties file to UTF8, unicode
Hi,
I read somewhere that it is possible to do in javascript a simple get
request like:
(jquery)
$.getJSON('pageName:eventName/arg');
and in Tapestry page:
JSONObject onEventName(String arg) {
JSONObject obj;
...
return obj;
}
I'm trying this, but it never gets into the event
Ok nevermind, I fixed my problem :) !
Some simplified code of what I've done:
@Inject
private Request request; // to access GET and/or POST variables
// Event handler method which returns the JSON based on request parameters
StreamResponse onGetData() {
return new
Ok thanks for the ideas, that's even better ;)
Nathan
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Call-event-from-javascript-tp5096654p5097330.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
I think this is a MySQL / Hibernate issue, not Tapestry.
I think you need to configure your connection pooling. Example:
http://community.jboss.org/wiki/HowToConfigureTheC3P0ConnectionPool
http://community.jboss.org/wiki/HowToConfigureTheC3P0ConnectionPool
--
View this message in context:
Steve Eynon wrote:
I believe the @Inject is working just fine - you just have to access
the service *after* the class has been constructed!
Yep that was my problem.
Thanks for the explanation!
--
View this message in context:
I have made a new project and have now this:
*Main.java*
public static void main(String[] args) {
RegistryBuilder builder = new RegistryBuilder();
builder.add(AppModule.class);
Registry registry = builder.build();
registry.performRegistryStartup();
Removed the static (shouldnt be there anyway), but still the same problem
:/
if I do
registry.getService(PolicyValueProviderSource.class)
and pass this as a parameter to my DocumentGenerator's constructor it does
work.
Is this the way to go then? (my knowledge of Tapestry IoC is very
Hi,
I'm making an application using Tapestry IoC configuration (contributions).
So in my AppModule I have:
*public void
contributePolicyValueProviderSource(MappedConfigurationlt;String,
PolicyValueProvidergt; config) {
...
}*
and in code I do:
*@Inject
private PolicyValueProviderSource
Hey,
I have a page with a grid which is in a zone. I have also above this zone
some filters; they all update the zone with AJAX:
onChange=$('frmFilter').fire(Tapestry.FORM_PROCESS_SUBMIT_EVENT);
And in the onSubmit i return zone.getBody();
This all works fine.
But now I only need the
Hi,
I have a beandisplay where I'd like to set the css class of for example an
integer field where value 100.
Is this possible? Or any hints on how i might achieve this would be
appreciated as I have no clue.
Thanks!
--
View this message in context:
I have a page where i can edit 1 object that has been selected to edit. This
object can be a different datatype everytime depending on some properties
set in the page.
//Here i get the right object
public Object getObject() {
return dao.getDaoForEntityType(entityType).get(objectId);
}
I have a grid where i can choose which row i want to edit.
When chosen a row it renders the row with a select in one of the columns
instead of the objects value. This select contains all possible values for
this property.
After choosing an option you can click a actionlink in the row to save this
Hi,
I have a page where i load a list of objects depending on some other
variables. This list of objects can be of the type of 1 of several type of
entity objects.
So I have declared it as :
private List tableData;
and
t:grid source=tableData ...
This works, but the problem is when
64 matches
Mail list logo