Re: T5: Custom components are not statefull

2008-02-06 Thread Alexander Lamb
Hello, Indeed, the graph (my component) works fine outside of a loop when I have several of them on a page. The data to display (in that case a TimeSeries for a JFreeChart) is kept in the instance of the component so when the page display, the src value refers to the correct graph and dat

Re: T5: Custom components are not statefull

2008-02-05 Thread Josh Canfield
Hi Alex, > Actually, the component itself now generates a new id correctly (using > the solution that was suggested). Your component actually hasn't gotten a new id, you've just generated a unique id based on your component's id. This is a good thing because if you had several images that you

Re: T5: Custom components are not statefull

2008-02-05 Thread Alexander Lamb
Actually, the component itself now generates a new id correctly (using the solution that was suggested). As you can see in the HTML generated: style="cursor:pointer"> style="cursor:pointer"> style="cursor:pointer"> The id of the img is correctly incremented (toto_1, 2, 3...) But the source

Re: T5: Custom components are not statefull

2008-02-04 Thread Chris Lewis
It's difficult to respond as clearly we're not seeing all of the code, but here one would assume that your custom component, in terms of generated markup, is simply an img element. No action link will have your generated id because you're not creating one in this code. Rather you create and out

Re: T5: Custom components are not statefull

2008-02-04 Thread Josh Canfield
Ok, I think it's clearer to me what you're trying to do. Your first assertion is correct; Components are not stateful. You can either put something into the action link context or into the session to maintain your state. Take a look at the source for *AbstractTextField*

Re: T5: Custom components are not statefull

2008-02-04 Thread Davor Hrg
Actions target component so the id used. when your component is rendered multiple times, clientId changes and can be used as identifier. if you want clientId in the action link, send is as context parameter. Davor Hrg On 2/4/08, Alexander Lamb <[EMAIL PROTECTED]> wrote: > Well, getting close, b

Re: T5: Custom components are not statefull

2008-02-04 Thread Alexander Lamb
Well, getting close, but not quite. Indeed, the getClientId works fine, but since my component is actually a graph (JFreeChart) being rendered from an URL, it looks like the clientId is not pushed to the ActionLink created. @SuppressWarnings("unchecked") void beginRender(MarkupWrite

Re: T5: Custom components are not statefull

2008-02-04 Thread Chris Lewis
Alex, Id generation, as far as I know, does not come for free. If you want to receive an id generated by T5, you have to explicitly request it. You'll find this done in one of the parent classes of the field elements - possibly in AbstractField. I've implemented it the same way in several dif

Re: T5: Custom components are not statefull

2008-02-04 Thread Alexander Lamb
Good point. I tried but no change! Le 4 févr. 08 à 15:15, Davor Hrg a écrit : maybe it must be inside a form... Davor Hrg On Feb 4, 2008 2:36 PM, Alexander Lamb <[EMAIL PROTECTED]> wrote: No, it extends nothing. Actually, the TextField was put in the loop only to check I was not going craz

Re: T5: Custom components are not statefull

2008-02-04 Thread Davor Hrg
maybe it must be inside a form... Davor Hrg On Feb 4, 2008 2:36 PM, Alexander Lamb <[EMAIL PROTECTED]> wrote: > No, it extends nothing. Actually, the TextField was put in the loop > only to check I was not going crazy... to see the loop was indeed > statefull, but not for my custom component. > >

Re: T5: Custom components are not statefull

2008-02-04 Thread Alexander Lamb
No, it extends nothing. Actually, the TextField was put in the loop only to check I was not going crazy... to see the loop was indeed statefull, but not for my custom component. Should a custom component extend some class to benefit from the id increment? Alex Le 4 févr. 08 à 13:44, Mich

Re: T5: Custom components are not statefull

2008-02-04 Thread Michael Courcy
Sorry I meant AbstractField Michael Courcy a écrit : Does your enrollmentbenchmarkchart compenent extends AbstractTextField ? Alexander Lamb a écrit : Hello list, It looks like custom components are not statefull. Indeed, I have a loop which contains a graph I generate and a TextField (for

Re: T5: Custom components are not statefull

2008-02-04 Thread Michael Courcy
Does your enrollmentbenchmarkchart compenent extends AbstractTextField ? Alexander Lamb a écrit : Hello list, It looks like custom components are not statefull. Indeed, I have a loop which contains a graph I generate and a TextField (for testing purposes), and the generated code looks like t

T5: Custom components are not statefull

2008-02-04 Thread Alexander Lamb
Hello list, It looks like custom components are not statefull. Indeed, I have a loop which contains a graph I generate and a TextField (for testing purposes), and the generated code looks like this: name="textfield_8" type="text" value="ITALY">class="t-error-icon t-invisible" id="textfield