T5 Component Select ID Example.

2011-02-07 Thread ael

For Newbie Like me guide...

Reference: 
http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/select/easyid
Select ID  

Index.tml



Person: 

You chose personId: ${personId}




Index.java


import com.dash.tapestryselect2.model.IdSelectModel;
import com.dash.tapestryselect2.model.Userbean;
import java.util.ArrayList;
import java.util.Date;


import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.services.PropertyAccess;

public class Index
{
public Date getCurrentTime() 
{ 
return new Date(); 
}

// The activation context

@Property
private Long personId;

// Screen fields

@SuppressWarnings("unused")
@Property
private IdSelectModel personIds;

@Inject
private PropertyAccess _propertyAccess;

// The code

Long onPassivate() {
return personId;
}

void onActivate(Long personId1) {
personId = personId1;
}

// Form triggers the PREPARE event during form render and form 
submission.

void onPrepare() {
// Get all persons - ask business service to find them (from 
the database)
ArrayList persons = new ArrayList();
persons.add(new Userbean(Long.valueOf(1),"Mirko","Mirko"));
persons.add(new
Userbean(Long.valueOf(2),"Slavko","Slavko"));
persons.add(new Userbean(Long.valueOf(3),"Jozo","Jozo"));
personIds = new IdSelectModel(persons, Userbean.class,
"username", "uid", _propertyAccess);
}

}




IdSelectModel.java


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dash.tapestryselect2.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.tapestry5.OptionGroupModel;
import org.apache.tapestry5.OptionModel;
import org.apache.tapestry5.internal.OptionModelImpl;
import org.apache.tapestry5.ioc.services.PropertyAccess;
import org.apache.tapestry5.ioc.services.PropertyAdapter;
import org.apache.tapestry5.util.AbstractSelectModel;

public class IdSelectModel extends AbstractSelectModel {

private List list;
private PropertyAdapter labelFieldAdapter;
private PropertyAdapter idFieldAdapter;

/**
 * @param list the list of objects you want modeled in a Select 
component.
These objects MUST implement
 *equals(Object obj) and hashCode(). If the objects are JPA
entities, ensure their implementations of
 *equals(Object obj) and hashCode() return the same thing for
different instances of the same detached
 *entity.
 * @param clazz the class of objects in the list.
 * @param labelField the name of the field you want displayed as the 
label
in the selection list, eg. "name".
 * @param idField the name of the field which is the unique identifier 
of
each object in the list, eg. "id". This is
 *used in the value property of the Select component.
 * @param access Declare a PropertyAccess injected into your page (eg.
 * @Inject private PropertyAccess _access) then pass it in here.
 *
 */
public IdSelectModel(List list, Class clazz, String labelField,
String idField, PropertyAccess access) {
if (clazz == null) {
throw new IllegalArgumentException("clazz is 
required.");
}
if (idField == null) {
throw new IllegalArgumentException("idField is 
required.");
}
if (labelField == null) {
throw new IllegalArgumentException("labelField is 
required.");
}

this.list = list;
this.idFieldAdapter =
access.getAdapter(clazz).getPropertyAdapter(idField);
this.labelFieldAdapter =
access.getAdapter(clazz).getPropertyAdapter(labelField);

if (idFieldAdapter == null) {
throw new IllegalArgumentException("idField " + idField 
+ " does not
exist in class " + clazz + ".");
}
if (labelFieldAdapter == null) {
throw new IllegalArgumentException("labelField " + 
idField + " does not
exist in class " + clazz + ".");
}
}

public List getOptionGroups() {
return null;
}

public List getOptions() {
List optionModelList = new 
ArrayList();
for (T obj : list) {
optionModelList.add(new 
OptionModelImpl(nvl(labelFieldAdapter.get(obj)),
idFieldAdapter.get(obj)));
}
return optionModelList;
}

publi

Re: Tynamo Security and Tapestry case insensitive paths

2011-02-07 Thread Kalle Korhonen
On Mon, Feb 7, 2011 at 9:43 AM, Mark  wrote:
> On Sun, Feb 6, 2011 at 8:22 AM, Kalle Korhonen
>> Made a patch release yesterday with a fix, use 0.2.2 or 0.3.1, see
>> http://tynamo.org/tapestry-security+guide
> I found this in the destination of your link:
> Use lowercase throughout the shiro.ini file configuration If you want
> to use a shiro.ini configuration file,
> Is that to say that in 0.3.1 case insensitivity is the default
> behavior as long as  you use lowercase in the shiro.ini file?

Correct. Use lowercase in shiro.ini file (it would have been another
extension point to override and I just didn't want to deal with it
right now), all incoming request urls are treated as case insensitive.

Kalle

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



Re: Changes to Logic at Runtime

2011-02-07 Thread Thiago H. de Paula Figueiredo
I guess you need a rule engine. Tapestry's live class reloading wouldn't  
be an option as you said you don't want to recompile classes.


Tapestry works on compiled bytecode, so using Groovy or Java or Scala  
wouldn't make a difference.


On Mon, 07 Feb 2011 15:25:21 -0200, Mark  wrote:


I have a situation where I need to be able to change the logic that
occurs on a page at runtime without recompiling or redeploying the
app.  For example, imagine a shopping cart for a site that offers all
kids of constantly changing promotions. Examples would be:

- Buy a blue widget and get 10% off a white widget.
- Buy two white widgets and get $5 off your entire order
- Buy  white and blue widget before 2/15 and get a green widget for free.

The point is that the rules are varied enough that they can't be coded
into the app and they really need to best stored in the database where
they can easily be changed on the fly--even if that means you have to
have a developer write them.

I know there is a way to create a java class in a running system on
the fly, so that is one option. Using some sort of expression language
like MVEL is another option. I just wanted to make sure there isn't
some way to do this using Tapestry's capabilities that I'm
overlooking.

Specifically, is there a way to get some type of executable script
into a Page or Service in a running app? Is this something Groovy can
do, or does Groovy only work with Tapestry when it is compiled to byte
code?

Mark

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




--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras

http://www.arsmachina.com.br

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



Re: AjaxFormLoop does not render informal parameters

2011-02-07 Thread Mark
> I'm using AjaxFormLoop component in one of my projects, and I noticed that
> this component does not render informal parameters.

I'm not sure why it isn't' rendering informal parameters.  Others can
probably explain if this is a bug or by design.  However, you can
usually work around this by just sticking another div with the desired
class inside of the AJaxFormLoop component.

Mark

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



Re: How to fix the id attribute of a select component

2011-02-07 Thread LLTYK

When you load Tapestry components in an ajax request a new t:id is generated.
Presumably because it's possible for a component with the same original id
to still be on the page. I'm not sure how this relates to the client side
id.
-- 
View this message in context: 
http://tapestry-users.832.n2.nabble.com/How-to-fix-the-id-attribute-of-a-select-component-tp5999701p6001123.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Re: Tynamo Security and Tapestry case insensitive paths

2011-02-07 Thread Mark
On Sun, Feb 6, 2011 at 8:22 AM, Kalle Korhonen
 wrote:
> Made a patch release yesterday with a fix, use 0.2.2 or 0.3.1, see
> http://tynamo.org/tapestry-security+guide
>
> Kalle

I found this in the destination of your link:

Use lowercase throughout the shiro.ini file configuration If you want
to use a shiro.ini configuration file,

Is that to say that in 0.3.1 case insensitivity is the default
behavior as long as  you use lowercase in the shiro.ini file?

Mark

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



Re: How to fix the id attribute of a select component

2011-02-07 Thread Mark
So when you use:



myIdName is being overwritten by something else?

Mark

On Mon, Feb 7, 2011 at 5:23 AM, Richard Hill  wrote:
>
> Hi Igor,
>
> Thanks for the response. I forget to mention in my original email that I
> tried setting the id attribute as well, but to no avail - it gets
> over-written. This is T5.2.
>
> Richard.
>
>
>
>
> On Mon, 2011-02-07 at 12:20 +0100, Igor Drobiazko wrote:
>> t:id is a Tapestry component id, which has nothing to do with the
>> client-side id of the tag written by the component. You should use the
>> clientId parameter.
>>
>> On Mon, Feb 7, 2011 at 10:30 AM, Richard Hill 
>> wrote:
>>
>>         Hi All,
>>
>>         I have a select component in a block:
>>
>>         >         t:blankOption="NEVER"
>>         onchange="_SU3.renderWebOptions();"/>
>>
>>         The block is the second of three. The switching between them
>>         is
>>         accomplished with an ajax actionlink request and a >         to />
>>
>>         By default the first block is shown on page load. If I then
>>         switch to
>>         the second block, the id attribute of the  is
>>         something like:
>>
>>         id="cctEditSelect_947gyh0"
>>
>>         My onchange javascript function expects this to be simply
>>         "cctEditSelect". If I refresh the whole page, then the id _is_
>>         rendered
>>         just "cctEditSelect" (the currently visible block is
>>         @Persist'd). It's
>>         only when switching from another block do I get the random
>>         characters
>>         appended.
>>
>>         I'm guessing this is to do with Tapestry making sure there are
>>         no id
>>         conflicts. I have tried to force the id, by putting in
>>         my .java:
>>
>>         @InjectComponent
>>         @Id("cctEditSelect")
>>         private Select cctEditSelect;
>>
>>         But no juice - I get the same behaviour. How can I fix this id
>>         attribute?
>>
>>         Many thanks,
>>
>>         Richard.
>>
>>
>>
>>
>>
>>
>> --
>> Best regards,
>>
>> Igor Drobiazko
>> http://tapestry5.de
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: [T5.2] Pass additional info/context on Ajax Select

2011-02-07 Thread Mark
Take a look at this:
http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/ajaxonevent

You should be able to add a t:context to the component that is
triggering the event.

Whatever the context is when the component is rendered will be passed
back the action event. So you can have something like:

public Object onSetQty(Item item) {


}

Mark

On Mon, Feb 7, 2011 at 4:51 AM, Yohan Yudanara  wrote:
> Hi,
>
> I want to ask a question:
> Is it possible to pass additional info on Ajax Select (method
> "onValueChanged"), other than selected value ?
>
> I need to pass ids of element inside AjaxFormLoop (because rows inside
> AjaxFormLoop can be add/remove dynamically at runtime).
> e.g: I need to pass: "machineZone, machineZone_0, machineZone_1" which is
> generated automatically when user add/remove rows on AjaxFormLoop.
>
> Thanks in advance..
>
> Best regards,
> Yohan Yudanara
>

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



Re: [T5.2] Update Zone inside AjaxFormLoop

2011-02-07 Thread Mark
You can set the client side id to something like:

id=${rowZoneId}

public String getRowZoneId() {
  return "rowZone-" rowId;
}

That way if you need to update a particular zone you can reference it.
 As long as you set rowId to be the same value when you add it to the
MultiZoneUpdate as it was when that row was rendered it should work.


Does that help?

Mark

On Mon, Feb 7, 2011 at 4:34 AM, Yohan Yudanara  wrote:
> Hi,
>
> I've tried MultiZoneUpdate and it's working.
>
> So, I want to change my question:
> We can add/delete rows in AjaxFormLoop, so the zone ids is dynamic. How to
> get available zone ids inside AjaxFormLoop ?
> Do we need to loop it using Javascript and pass it to server side via
> context, or is there any other way ?
>
> Thanks in advance,
>
> Best regards,
> Yohan Yudanara
>
> On Mon, Feb 7, 2011 at 2:35 PM, Yohan Yudanara 
> wrote:
>
>> Hi,
>>
>> I have a Master-Detail Form one page.
>>
>> The Master section, contains a Select Component.
>> The Detail section (which is implemented using AjaxFormLoop), also contain
>> a Select Component.
>>
>> What I want to do is to make Ajax Select:
>> Options in detail's Select Component (which is inside zone in AjaxFormLoop)
>> is depend on what user choose on master's Select Component.
>>
>> I have problem because:
>> * If I'm using zone attribute in master's select component, only the
>> "Select" component in 1st detail record is updated.
>> * If I'm using multizone update, I can't use @InjectComponent to get
>> "Select" components in detail records, because the component id is dynamic
>> (because it's inside AjaxFormLoop).
>>
>> Is there any clue how to do this?
>>
>> Thanks in advance.
>>
>> Best regards,
>> Yohan Yudanara
>>
>>
>>
>>
>>
>>
>

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



Changes to Logic at Runtime

2011-02-07 Thread Mark
I have a situation where I need to be able to change the logic that
occurs on a page at runtime without recompiling or redeploying the
app.  For example, imagine a shopping cart for a site that offers all
kids of constantly changing promotions. Examples would be:

- Buy a blue widget and get 10% off a white widget.
- Buy two white widgets and get $5 off your entire order
- Buy  white and blue widget before 2/15 and get a green widget for free.

The point is that the rules are varied enough that they can't be coded
into the app and they really need to best stored in the database where
they can easily be changed on the fly--even if that means you have to
have a developer write them.

I know there is a way to create a java class in a running system on
the fly, so that is one option. Using some sort of expression language
like MVEL is another option. I just wanted to make sure there isn't
some way to do this using Tapestry's capabilities that I'm
overlooking.

Specifically, is there a way to get some type of executable script
into a Page or Service in a running app? Is this something Groovy can
do, or does Groovy only work with Tapestry when it is compiled to byte
code?

Mark

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



Re: Test Selenium with Tapestry 5.2.4

2011-02-07 Thread Gillespie59

Thanks Mark

We have just found the solution. I had the wrong testng version in my
pom.xml .


-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Test-Selenium-with-Tapestry-5-2-4-tp3370957p3374542.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Test Selenium with Tapestry 5.2.4

2011-02-07 Thread Mark
The stack trace looks like it is saying there is a problem with the
testStartup method not receiving all the parameters it needs.

I'm afraid I don't know why.  Perhaps someone else on the list can help.

I do have a suggestion though. When I run into problems with the
testing, I usually try to checkout the Tapestry project and look at
how the Selenium tests are run internally. Often you can find
something similar to what you are trying to do and use it as a model.

Mark



On Mon, Feb 7, 2011 at 3:37 AM, Gillespie59
 wrote:
>
> Does anyone have a solution to my problem ?
>
> I really thank to all of you!
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Test-Selenium-with-Tapestry-5-2-4-tp3370957p3373989.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Antwort: Tapestry 5 error "Caused by: java.lang.RuntimeException: Literal values are not updateable"

2011-02-07 Thread LLTYK

Because it's literal "false" and where changes would be stored is not
specified. If you want to set it you  have to have the parameter map to a
property of the container.

The example doesn't make clear what you are trying to do to begin with.
-- 
View this message in context: 
http://tapestry-users.832.n2.nabble.com/Tapestry-5-error-Caused-by-java-lang-RuntimeException-Literal-values-are-not-updateable-tp6000461p6000769.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Re: Antwort: Tapestry 5 error "Caused by: java.lang.RuntimeException: Literal values are not updateable"

2011-02-07 Thread Thiago H. de Paula Figueiredo

On Mon, 07 Feb 2011 13:44:53 -0200, m!g  wrote:

Failure writing parameter 'test' of component TestPage:test: Literal  
values are not updateable.


The message is quite clear: you're trying to change the value of a literal  
value. This happens in the first line of your method:



Object onSubmitFromForm() {
test=true;// here!
return null;
}

If you passed a property to the parameter, its value would be changed to  
true when you do test = true.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Antwort: Tapestry 5 error "Caused by: java.lang.RuntimeException: Literal values are not updateable"

2011-02-07 Thread m!g

I made only page just for simplicity. OK, Here is component with parameter:

public class TestPage {
@Component(parameters={"test=false"})
private Test test;
}
http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
xml:space="preserve">








public class Test {
@Parameter(value="false")
@Property
private boolean test;

@Component
private Form form;

@Inject
private Request request;

Object onSubmitFromForm() {
test=true;
return null;
}
}

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
xml:space="preserve">

${test}





Error is the same:
Failure writing parameter 'test' of component TestPage:test: Literal values
are not updateable.
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.java:1152)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$3000(ComponentPageElementImpl.java:72)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$7.invoke(ComponentPageElementImpl.java:1077)
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl$7.invoke(ComponentPageElementImpl.java:1074)

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-5-error-Caused-by-java-lang-RuntimeException-Literal-values-are-not-updateable-tp3374330p3374449.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Antwort: Tapestry 5 error "Caused by: java.lang.RuntimeException: Literal values are not updateable"

2011-02-07 Thread Thiago H. de Paula Figueiredo
On Mon, 07 Feb 2011 12:42:12 -0200, Kristian Marinkovic  
 wrote:



Pages usually don't have parameters. Components do!


I can't think of any reason for a page to have a parameter: instead, they  
have the activation context and query parameters. Pages *don't* have  
parameters.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Antwort: Tapestry 5 error "Caused by: java.lang.RuntimeException: Literal values are not updateable"

2011-02-07 Thread Kristian Marinkovic
Pages usually don't have parameters. Components do!

g,
kris



Von:m!g 
An: users@tapestry.apache.org
Datum:  07.02.2011 15:38
Betreff:Tapestry 5 error "Caused by: java.lang.RuntimeException: 
Literal values are not updateable"




Hi everyone.
Here is a simple test application:

public class Test {
 @Parameter(value="false")
 @Property
 private boolean test;

 @Component
 private Form form;

 @Inject
 private Request request;

 Object onSubmitFromForm() {
 test=true;
 return null;
 }
}

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
xml:space="preserve">



${test}






When I try to submit form I get error:


org.apache.tapestry5.runtime.ComponentEventException: Failure writing
parameter 'test' of component Test: Literal values
 are not updateable. [at classpath:ru/kupivip/pages/Test.tml, line 4]
 at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.jav
a:1152)


Is it right behaviour of T5? Why I can't update parameter values?
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-5-error-Caused-by-java-lang-RuntimeException-Literal-values-are-not-updateable-tp3374330p3374330.html

Sent from the Tapestry - User mailing list archive at Nabble.com.

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




Tapestry 5 error "Caused by: java.lang.RuntimeException: Literal values are not updateable"

2011-02-07 Thread m!g

Hi everyone.
Here is a simple test application:

public class Test {
@Parameter(value="false")
@Property
private boolean test;

@Component
private Form form;

@Inject
private Request request;

Object onSubmitFromForm() {
test=true;
return null;
}
}

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
xml:space="preserve">



${test}






When I try to submit form I get error:


org.apache.tapestry5.runtime.ComponentEventException: Failure writing
parameter 'test' of component Test: Literal values
 are not updateable. [at classpath:ru/kupivip/pages/Test.tml, line 4]
at
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.processEventTriggering(ComponentPageElementImpl.jav
a:1152)


Is it right behaviour of T5? Why I can't update parameter values?
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-5-error-Caused-by-java-lang-RuntimeException-Literal-values-are-not-updateable-tp3374330p3374330.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: How to fix the id attribute of a select component

2011-02-07 Thread Richard Hill

Hi Igor, 

Thanks for the response. I forget to mention in my original email that I
tried setting the id attribute as well, but to no avail - it gets
over-written. This is T5.2.

Richard.




On Mon, 2011-02-07 at 12:20 +0100, Igor Drobiazko wrote:
> t:id is a Tapestry component id, which has nothing to do with the
> client-side id of the tag written by the component. You should use the
> clientId parameter.
> 
> On Mon, Feb 7, 2011 at 10:30 AM, Richard Hill 
> wrote:
> 
> Hi All,
> 
> I have a select component in a block:
> 
>  t:blankOption="NEVER"
> onchange="_SU3.renderWebOptions();"/>
> 
> The block is the second of three. The switching between them
> is
> accomplished with an ajax actionlink request and a  to />
> 
> By default the first block is shown on page load. If I then
> switch to
> the second block, the id attribute of the  is
> something like:
> 
> id="cctEditSelect_947gyh0"
> 
> My onchange javascript function expects this to be simply
> "cctEditSelect". If I refresh the whole page, then the id _is_
> rendered
> just "cctEditSelect" (the currently visible block is
> @Persist'd). It's
> only when switching from another block do I get the random
> characters
> appended.
> 
> I'm guessing this is to do with Tapestry making sure there are
> no id
> conflicts. I have tried to force the id, by putting in
> my .java:
> 
> @InjectComponent
> @Id("cctEditSelect")
> private Select cctEditSelect;
> 
> But no juice - I get the same behaviour. How can I fix this id
> attribute?
> 
> Many thanks,
> 
> Richard.
> 
> 
> 
> 
> 
> 
> -- 
> Best regards,
> 
> Igor Drobiazko
> http://tapestry5.de



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



Re: How to fix the id attribute of a select component

2011-02-07 Thread Igor Drobiazko
t:id is a Tapestry component id, which has nothing to do with the
client-side id of the tag written by the component. You should use the
clientId parameter.

On Mon, Feb 7, 2011 at 10:30 AM, Richard Hill  wrote:

>
> Hi All,
>
> I have a select component in a block:
>
>  onchange="_SU3.renderWebOptions();"/>
>
> The block is the second of three. The switching between them is
> accomplished with an ajax actionlink request and a 
>
> By default the first block is shown on page load. If I then switch to
> the second block, the id attribute of the  is something like:
>
> id="cctEditSelect_947gyh0"
>
> My onchange javascript function expects this to be simply
> "cctEditSelect". If I refresh the whole page, then the id _is_ rendered
> just "cctEditSelect" (the currently visible block is @Persist'd). It's
> only when switching from another block do I get the random characters
> appended.
>
> I'm guessing this is to do with Tapestry making sure there are no id
> conflicts. I have tried to force the id, by putting in my .java:
>
> @InjectComponent
> @Id("cctEditSelect")
> private Select cctEditSelect;
>
> But no juice - I get the same behaviour. How can I fix this id
> attribute?
>
> Many thanks,
>
> Richard.
>
>
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de


[T5.2] Pass additional info/context on Ajax Select

2011-02-07 Thread Yohan Yudanara
Hi,

I want to ask a question:
Is it possible to pass additional info on Ajax Select (method
"onValueChanged"), other than selected value ?

I need to pass ids of element inside AjaxFormLoop (because rows inside
AjaxFormLoop can be add/remove dynamically at runtime).
e.g: I need to pass: "machineZone, machineZone_0, machineZone_1" which is
generated automatically when user add/remove rows on AjaxFormLoop.

Thanks in advance..

Best regards,
Yohan Yudanara


Re: [T5.2] Update Zone inside AjaxFormLoop

2011-02-07 Thread Yohan Yudanara
Hi,

I've tried MultiZoneUpdate and it's working.

So, I want to change my question:
We can add/delete rows in AjaxFormLoop, so the zone ids is dynamic. How to
get available zone ids inside AjaxFormLoop ?
Do we need to loop it using Javascript and pass it to server side via
context, or is there any other way ?

Thanks in advance,

Best regards,
Yohan Yudanara

On Mon, Feb 7, 2011 at 2:35 PM, Yohan Yudanara wrote:

> Hi,
>
> I have a Master-Detail Form one page.
>
> The Master section, contains a Select Component.
> The Detail section (which is implemented using AjaxFormLoop), also contain
> a Select Component.
>
> What I want to do is to make Ajax Select:
> Options in detail's Select Component (which is inside zone in AjaxFormLoop)
> is depend on what user choose on master's Select Component.
>
> I have problem because:
> * If I'm using zone attribute in master's select component, only the
> "Select" component in 1st detail record is updated.
> * If I'm using multizone update, I can't use @InjectComponent to get
> "Select" components in detail records, because the component id is dynamic
> (because it's inside AjaxFormLoop).
>
> Is there any clue how to do this?
>
> Thanks in advance.
>
> Best regards,
> Yohan Yudanara
>
>
>
>
>
>


Re: Test Selenium with Tapestry 5.2.4

2011-02-07 Thread Gillespie59

Does anyone have a solution to my problem ? 

I really thank to all of you!
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Test-Selenium-with-Tapestry-5-2-4-tp3370957p3373989.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



How to fix the id attribute of a select component

2011-02-07 Thread Richard Hill

Hi All,

I have a select component in a block:



The block is the second of three. The switching between them is
accomplished with an ajax actionlink request and a 

By default the first block is shown on page load. If I then switch to
the second block, the id attribute of the  is something like:

id="cctEditSelect_947gyh0" 

My onchange javascript function expects this to be simply
"cctEditSelect". If I refresh the whole page, then the id _is_ rendered
just "cctEditSelect" (the currently visible block is @Persist'd). It's
only when switching from another block do I get the random characters
appended.

I'm guessing this is to do with Tapestry making sure there are no id
conflicts. I have tried to force the id, by putting in my .java:

@InjectComponent
@Id("cctEditSelect")
private Select cctEditSelect;

But no juice - I get the same behaviour. How can I fix this id
attribute?

Many thanks,

Richard.





Re: [Announce] Tapestry Testify project - v1.0.3 released

2011-02-07 Thread Peter Stavrinides
Thanks for your effort Paul!


- Original Message -
From: "PaulField" 
To: users@tapestry.apache.org
Sent: Saturday, 5 February, 2011 16:20:51 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: [Announce] Tapestry Testify project - v1.0.3 released


I'd like to announce the latest release of the Tapestry Testify project at
Tapestry 360:
http://tapestry.formos.com/nightly/tapestry-testify/
 
Tapestry Testify is an extension to Tapestry that allows you to write page
and component tests very easily and have them run very efficiently.
 
 
** Release Notes **
* Upgraded to support Tapestry 5.2.x  (tested with 5.2.4)

- Paul
 
---
Paul Field
http://twitter.com/cloudy_skies


-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Announce-Tapestry-Testify-project-v1-0-3-released-tp3372532p3372532.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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