Re: T5: radio, label

2007-08-15 Thread tamseo

This is my simple example, I craeted it just to check how to use Radio 

html:



  ${name1}
  
 ${name2}
 

  
  


  
  ${nameoption} has been selected
  


Page class

@Persist
private String nameoption;
private String name1 = "Option1";
private String name2 = "Option2";

 i ignore setter and getter here.
-- 
View this message in context: 
http://www.nabble.com/T5%3A-radio%2C-label-tf4276314.html#a12174779
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: radio, label

2007-08-15 Thread tamseo

Chris !

I followed RadioDemo test in T5 source, and i'm in the same situation with
you.
Now I'using  HTML  and waiting for answer from T5 experienced user.



-- 
View this message in context: 
http://www.nabble.com/T5%3A-radio%2C-label-tf4276314.html#a12174593
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: radio, label

2007-08-15 Thread tamseo

Hi Chris!

I think if you remove the label component your code will work.

or add "label" attribute for Radio like this




in my opinion we can't use Label like this Type



Chris Lewis wrote:
> Hello,
>
> I'm trying to get a simple form with some radio buttons and labels 
> working, without success. Following is the source for my Login page 
> template and class. Note that the page is rendering in a layout 
> component.
>
> Login.html:
>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>
>
>Type
>
>
>  
>
> 
>
> Login.java
> public class Login {
>  public static final String AGENT_LISTER="AGENT";
>public static final String AGENT_FSBO="FSBO";
>private String listerType = AGENT_LISTER;
>private StringValueEncoder stringEncoder = new StringValueEncoder();
>
>/**
> * @return the listerType
> */
>public String getListerType() {
>return listerType;
>}
>
>/**
> * @param listerType the listerType to set
> */
>public void setListerType(String listerType) {
>this.listerType = listerType;
>}
>
>/**
> * @return the stringEncoder
> */
>public StringValueEncoder getStringEncoder() {
>return stringEncoder;
>}
> }
>
> When I visit the page I am greeted with a "Failure reading parameter 
> for of component listers/Login:label: Component listers/Login does not 
> contain an embedded component with id 'reg-agent'." exception, but 
> there is a component with id reg-agent!
>
> -
> 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]




-- 
View this message in context: 
http://www.nabble.com/T5%3A-radio%2C-label-tf4276314.html#a12174382
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: Fwd: How to load a image dynamically in tapestry5.0.4

2007-06-25 Thread tamseo

Hi

In my page, I use javascript to load a text file, it is a dynamic file
depend on the user logged in


var so = new SWFObject("${userFile}");

Can I use this snipet code to load a text file ???
I tried but It didn't work. So i have to use like this in class file

public Stirng getUserFile(){
return "http://localhost/myapp/data/"+ userName +".txt";
}

Howard Lewis Ship wrote:
> 
> -- Forwarded message --
> From: Howard Lewis Ship <[EMAIL PROTECTED]>
> Date: Jun 7, 2007 10:10 PM
> Subject: Re: How to load a image dynamically in tapestry5.0.4
> To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> 
> 
> Let me use 5.0.5 syntax since its a little cleared and will be totally
> relevant pretty soon.
> 
> Let's say you have a page named Catalog on which you want to display
> images:
> 
> Catalog.html:
> 
> 
>${productImageURL} 
> 
> 
> Ok, now Catalog.java (i'll omit the ordinary getters/setters):
> 
> public class Catalog {
>   private Product _product;
> 
>   @Inject
>   private ComponentResources _resources;
> 
>   public Link getProductImageURL() {
> return _resources.createActionLink("image", false,  _product.getId());
>   }
> 
>   public Object onImage(long productId) {
> 
>   finalInputStream is = // ... get InputStream from productId
> 
>   return new StreamResponse() {
> 
> public String getContentType()  { return "img/jpeg"; }
> 
> public   InputStream getStream() throws IOException { return is; }
>   };
> 
> }
> 
> ... so what do we have?
> 
> We have an   element that gets its URL from the code.
> 
> getProductImageURL() generates a URL that triggers inside the Catalog
> page (not a component within the page), with an event type of "image"
> and places the product's id property as path info.  It will look like:
> 
>   http://localhost:8080/catalog:image/12345
> 
> Now, when the page renders, the   element in the browser will use
> that URL.  Thus a new request comes up, which fires the "image" event
> on the Catalog page.  We provide an event hander as "onImage"
> (whereas normally we use "onAction").
> 
> The return value is an instance of StreamResponse (that's an
> interface).  In the current code, a StreamResponse provides a content
> type and an InputStream.
> 
> Tapestry will use this to "pump down" the bytes in the stream.
> 
> The only thing new in 5.0.5 is the way we were able to put an
> expansion into the src attribute of the   element.  In 5.0.4 you'd
> have to use a Img component.
> 
> That's it ... I like this because it was hard to do (properly) in T4
> and is cake in T5.
> 
> 
> 
> On 6/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> Hi Howard,
>>
>> In your reply below you mentioned that
>> > There's another approach used when the data is inside the database, but
>> we
>> > can dive into that if the above solution is insufficient.
>>
>> Can you please provide some more information as to what this approach is?
>> Knowing how busy you are I don't expect a complete solution but I would
>> appreciate it if you could point me to the right direction.
>>
>> I am thinking of an approach similar to JSP where you write the byte[]
>> retrieved from the database directly into the OutputStream but I don't
>> know if this is the best way to do this with T5 or if it's even possible.
>>
>> Thanks
>> Petros
>>
>>
>> Howard Lewis Ship wrote:
>> >
>> > In order to answer this question, some background is needed.
>> >
>> > If you know the product's id (whatever you use, where it's  SKU number
>> or
>> > a
>> > surrogate key) ... what is the exact process from going from that to a
>> URL
>> > suitable for an   tag?
>> >
>> > That is ... are the images stored in the database?  Or are they on the
>> > file
>> > system somewhere?  If they are files on the file system, are those
>> files
>> > mapped to a client-visible URL?
>> >
>> > In the latter case, you can do something like:
>> >
>> >  prop:productImageURL
>> >
>> > public String getProductImageURL() {
>> >   return "http://static.myco.com/product-images/"; + _productId +
>> ".gif";
>> > }
>> >
>> >
>> >
>> > Assigning a t:id to a tag without specifying a component type creates
>> an
>> > Any
>> > component, a component that just renders whatever tag and informal
>> > parameters you provide it.  Here wer'e linking that to some Java code
>> in
>> > the
>> > corresponding page or component that computes the URL of the product
>> based
>> > on an instance variable.  Probably your example is more complicated,
>> but
>> > you
>> > get the idea.
>> >
>> > There's another approach used when the data is inside the database, but
>> we
>> > can dive into that if the above solution is insufficient.
>> >
>> > Assets are useful for accessing resources inside the web application
>> > context, or on the classpath, and includes logic related to
>> localization
>> > ...
>> > but it is not always appropriate when accessing resources that are well
>> > outside the web application itself.
>> >
>> > On 5/19/07, Allen Guo <[EM

Re: T5 Loop

2007-06-21 Thread tamseo

Hi Anjana Gopinath

I'm having the same problem. Did you find the solution for it
Any one know how to fix it. It's very urgent for my project

Thanks

Tam


Anjana Gopinath-2 wrote:
> 
> Howard,
> 
> Thanks a lot for responding. I tried setting the volatile="true" for  
> the Loop component, but i still have the same issue. When i try  
> printing the first element of the ArrayList on the onSuccess method,  
> it still shows the old value.
> 
> Start.html
>  
> --
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Start.java
> --
> public class Start
> {
>   
>   @Persist
>   private ArrayList values;
>   
>   
>   private String value;
>   
>   public String getValue() {
>   return value;
>   }
> 
>   public void setValue(String value) {
>   this.value = value;
>   }
> 
>   @SetupRender
>   public void fillValues()
>   {
>   System.out.println("fillvalues");
>values = new ArrayList();
>values.add("test");
>values.add("test1");
>   this.setValues(values);
>   
>   }
> 
>   public ArrayList getValues() {
>   return values;
>   }
> 
>   public void setValues(ArrayList values) {
>   this.values = values;
>   }
>   
>   String onSuccess()
>   {
>   System.out.println(this.getValues().get(0));
>   return null;
>   }
>   
> }
> 
> 
> 
> Anjana Gopinath
> True North Technology
> 
> 
> 
> 
> On Apr 5, 2007, at 10:18 AM, Howard Lewis Ship wrote:
> 
>> This should work, but it looks like you simplified your example.
>>
>> The Loop component records into the form (as hidden fields) the values
>> from its source parameter. When the form is submitted, it uses these
>> values, and ignores it source parameter.
>>
>> In the short term, you should be able to get the Loop and Form combo
>> to work by turning on the volatile parameter of the Loop.  In the long
>> run, you should provide a PrimaryKeyEncoder to the Loop, to guide it
>> in how to serialize the dynamic data into the Form.
>>
>> On 4/5/07, Anjana Gopinath <[EMAIL PROTECTED]> wrote:
>>> Hi,
>>>
>>> I am trying to iterate over a list and display the values in a
>>> textfield. User can edit these values and i need to save these back
>>> to the list. I am able to display all the values, but the values are
>>> not getting updated when user saves them.
>>>
>>>   
>>> 
>>> 
>>>
>>> 
>>> 
>>> 
>>>
>>> Is this possible ? i searched in the mailing lists, but couldnt find
>>> any information.
>>> Thanks
>>>
>>> Anjana Gopinath
>>> True North Technology
>>>
>>>
>>>
>>>
>>>
>>
>>
>> -- 
>> Howard M. Lewis Ship
>> TWD Consulting, Inc.
>> Independent J2EE / Open-Source Java Consultant
>> Creator and PMC Chair, Apache Tapestry
>> Creator, Apache HiveMind
>>
>> Professional Tapestry training, mentoring, support
>> and project work.  http://howardlewisship.com
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5-Loop-tf3531856.html#a11245636
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 Tapestry-Test How to use with HTML attributes

2007-06-21 Thread tamseo

I found the solution. 
just like this
assertText("//[EMAIL PROTECTED]'id']","expected")

Please ignore my post. Thanks.


tamseo wrote:
> 
> Hi,
> 
> I tried to use assertText() method like this
> assertText("html_Div_Id","expected") But It didn't work because the
> element "html_Div_Id" was not found.
> does Tapestry-Test used with Tapestry attributes only?
> 
> Any body know how to do that .  I'm learning Tapestry, so your answer will
> be realy helpful.
> 
> Thanks in advance
> 
> Tam
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5-Tapestry-Test-How-to-use-with-HTML-attributes-tf3951169.html#a11228757
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 Tapestry-Test How to use with HTML attributes

2007-06-20 Thread tamseo

Hi,

I tried to use assertText() method like this
assertText("html_Div_Id","expected") But It didn't work because the element
"html_Div_Id" was not found.
does Tapestry-Test used with Tapestry attributes only?

Any body know how to do that .  I'm learning Tapestry, so your answer will
be realy helpful.

Thanks in advance

Tam


-- 
View this message in context: 
http://www.nabble.com/T5-Tapestry-Test-How-to-use-with-HTML-attributes-tf3951169.html#a11209847
Sent from the Tapestry - User mailing list archive at Nabble.com.


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