Completely right sire although you have to admit than having defined the field
@Parameter(required = true) private String _stext; 1)<t:count end="3" stext="4">Ho!</t:count> will go along (I declare a parameter of type string but... 2)<t:count end="3" stext="mytext">Ho!</t:count> will fail (I declare the same....) In both cases my attemt is to set up a string parameter in a component In my humble opinion it will be easy for newcomers not to have default prefix at all or recomend not to use it the first days till you know what you do and again in 1) it asumes that there are no strings containing numbers? is it no prop the default binding? it should complain either no get4 property() <-nonsense or error trying to asingn number to string but not simply let it go. In what 2) concerns totally agree with you no prefix prop prefix..... Reading page 3 of component parameters helps a lot but some some more complete samples will have save a lot of time like a component showing all diferent usage of the binding params Thanks a lot for your explanation. Chris Lewis-5 wrote: > > Max, > > The reason is actually quite simple. When you pass in values to > component parameters, tapestry interprets their values in the context of > binding prefix. If you create your own component with parameters and do > not specify a the binding prefix under which the value is to be > interpreted, the default is 'prop:' which means tapestry will look in > the containing page object for a bean-style method. So in your example > where you passed 'mytext' tapestry looked in your page instance > (org.compramaestra.pages.TreeDemo) for a method 'getMytext()', didn't > find it, and told you precisely why it failed. When you create your own > components you have control over the default binding prefix - the tricky > part is understanding which prefix would be the most generally used. All > of this is clearly documented here: > > http://tapestry.apache.org/tapestry5/tapestry-core/guide/parameters.html > > Now that you know how tapestry interprets values, it should be quite > clear why it interprets numbers as numbers and strings as various > things. The reason is that a number can't be used for a java identifier > (variables or methods), and therefore would never represent a method > (and thus a page property). Strings on the other hand, and represent a > myriad of things - literal text (literal:), a localized message > (message:), a page property (prop:), etc. > > hope that helps > > chris > > maxthesecond wrote: >> allegedly longs from >> http://tapestry.formos.com/nightly/tapestry5/tapestry-core/guide/coercion.html >> and then Vm will turn them Ints....if not the lord itself, but >> nevertheless >> still puzzled , specially if I commplete your sentence: 'tapestry can >> interprete numerics as integer' but not strings as strings....... >> >> Regards and thank's again (don't be fooled by the message just some >> humor) >> >> >> >> >> Sven Homburg wrote: >> >>> tapestry can interprete numerics as integer (or long, im not sure) >>> >>> 2008/4/26 maxthesecond <[EMAIL PROTECTED]>: >>> >>> >>>> wunderbar >>>> But still I'm lost in the space:why? I mean why integer values doesen't >>>> subdue to this literal rule?..well I see they are not literate... >>>> Infinite thanks I'll read again once more the documentation and try get >>>> it >>>> right in my mind. >>>> Thanks again. >>>> >>>> >>>> >>>> >>>> Sven Homburg wrote: >>>> >>>>> you should use "literal:mytext" for parameter stext >>>>> without "literal" tapestry tries to interpret "mytext" >>>>> >>>>> 2008/4/26 maxthesecond <[EMAIL PROTECTED]>: >>>>> >>>>> >>>>>> In the count sample component >>>>>> >>>>>> >>>>>> >>>>>> >>>> http://tapestry.formos.com/nightly/tapestry5/tapestry-core/guide/parameters.html >>>> >>>>>> public class Count >>>>>> { >>>>>> @Parameter >>>>>> private int _start = 1; >>>>>> >>>>>> @Parameter(required = true) >>>>>> private int _end; >>>>>> >>>>>> >>>>>> //added by me >>>>>> @Parameter(required = true) >>>>>> private String _stext; >>>>>> >>>>>> @Parameter >>>>>> private int _value; >>>>>> >>>>>> private boolean _increment; >>>>>> >>>>>> @SetupRender >>>>>> void initializeValue() >>>>>> { >>>>>> _value = _start; >>>>>> >>>>>> _increment = _start < _end; >>>>>> } >>>>>> >>>>>> @AfterRender >>>>>> boolean next() >>>>>> { >>>>>> if (_increment) >>>>>> { >>>>>> int newValue = _value + 1; >>>>>> >>>>>> if (newValue <= _end) >>>>>> { >>>>>> _value = newValue; >>>>>> return false; >>>>>> } >>>>>> } >>>>>> else >>>>>> { >>>>>> int newValue = _value - 1; >>>>>> >>>>>> if (newValue >= _end) >>>>>> { >>>>>> _value = newValue; >>>>>> return false; >>>>>> } >>>>>> } >>>>>> >>>>>> return true; >>>>>> } >>>>>> >>>>>> I added the stext parameter for the sake of test,you don't need even >>>>>> >>>> to >>>> >>>>>> declare getter and setter for parameters, in the page that uses the >>>>>> component you write down simply: >>>>>> >>>>>> <t:count end="3" stext="4">Ho!</t:count> >>>>>> >>>>>> and both parameters 'end' and 'stext' will go on with no problems.... >>>>>> >>>>>> but if I write >>>>>> >>>>>> <t:count end="3" stext="mytext">Ho!</t:count> >>>>>> >>>>>> then I get the following enlighting message: >>>>>> >>>>>> "Could not convert 'mytext' into a component parameter binding: Class >>>>>> org.compramaestra.pages.TreeDemo does not contain a property named >>>>>> 'mytext' >>>>>> (within property expression 'mytext'). Available properties: class, >>>>>> componentResources, message, node, treeNodes." >>>>>> >>>>>> So what? the argument is supposed to be the parameter? I'm totally >>>>>> >>>> lost >>>> >>>>>> ,bear in mind that >>>>>> >>>>>> <t:count end="3" stext="4">Ho!</t:count> does not complain at all >>>>>> >>>>>> >>>>>> Thanks a lot if any can save me! >>>>>> >>>>>> tapestry 5.0.11 >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> View this message in context: >>>>>> >>>>>> >>>> http://www.nabble.com/T5-Component-question-based-on-the-Count-component-in-documentation-tp16917580p16917580.html >>>> >>>>>> Sent from the Tapestry - User mailing list archive at Nabble.com. >>>>>> >>>>>> >>>>>> --------------------------------------------------------------------- >>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>>>>> For additional commands, e-mail: [EMAIL PROTECTED] >>>>>> >>>>>> >>>>>> >>>>> -- >>>>> with regards >>>>> Sven Homburg >>>>> http://tapestry5-components.googlecode.com >>>>> >>>>> >>>>> ----- >>>>> best regards >>>>> Sven >>>>> >>>>> >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/T5-Component-question-based-on-the-Count-component-in-documentation-tp16917580p16917700.html >>>> Sent from the Tapestry - User mailing list archive at Nabble.com. >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>>> For additional commands, e-mail: [EMAIL PROTECTED] >>>> >>>> >>>> >>> -- >>> with regards >>> Sven Homburg >>> http://tapestry5-components.googlecode.com >>> >>> >>> ----- >>> best regards >>> Sven >>> >>> >> >> > > -- > http://thegodcode.net > > > -- View this message in context: http://www.nabble.com/T5-Component-question-based-on-the-Count-component-in-documentation-tp16917580p16922275.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]