trueboroda / tapestrytools

Automatically exported from code.google.com/p/tapestrytools
0 stars 0 forks source link

Provide autocompletion for components that are declared using @Component annotation #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Components may be also declared in in Java class by using @Component annotation.

http://tapestry.apache.org/5.3.3/apidocs/org/apache/tapestry5/annotations/Compon
ent.html

For example,

    @Component(
            parameters = {"value=context.propertyValue", 
                                   "label=prop:context.label",
                                   "clientId=prop:context.propertyid",
                                   "validate=prop:calendarFieldValidator"})
    private DateField calendarField;

This component may be used in the template like this.

<input t:id="calendarField"/>

Note that the field name is the component id.

If the id element in the @Component is set

@Component(id="myField")

then the component is used in the templare using the defined id:

<input t:id="myField"/>

Original issue reported on code.google.com by igor.dro...@gmail.com on 21 May 2012 at 9:11

GoogleCodeExporter commented 9 years ago
If somebody types <input t:id="   the plugin should suggest a list of all the 
component ids, that are defined in the corresponding Java class using 
@Component annotation.

Original comment by igor.dro...@gmail.com on 21 May 2012 at 9:12

GoogleCodeExporter commented 9 years ago

Original comment by gavingui...@gmail.com on 22 May 2012 at 1:55

GoogleCodeExporter commented 9 years ago
Same feature with issue 28 
http://code.google.com/p/tapestrytools/issues/detail?id=28,
right?

Original comment by gavingui...@gmail.com on 22 May 2012 at 1:56

GoogleCodeExporter commented 9 years ago
No, these are different features.

t:type="ActionLink" is used to define a component in a template. This is used 
in combination with component's parameters. Fior example:

        <a t:type="ActionLink" context="123">Click me</a>

t:id is used to attach a component, that was defined in page's Java class, to a 
html tag. In other words, this is just a reference to a component defined in 
Java class. Here is an example:

       <a t:id="myLink">Click me</a>  

Whereby myLink is a field in page's class of type ActionLink:

       @Component( parameters={"context=123"} )
       private ActionLink myLink;

See the difference?

Original comment by igor.dro...@gmail.com on 22 May 2012 at 6:31

GoogleCodeExporter commented 9 years ago
Thanks for the explanation, i am clear now

Original comment by gavingui...@gmail.com on 22 May 2012 at 7:28

GoogleCodeExporter commented 9 years ago
Finished, i will update TapestryTools update center soon

Original comment by gavingui...@gmail.com on 31 May 2012 at 1:11

GoogleCodeExporter commented 9 years ago
If no id is specified using @Component annotation, autocompletion still doesn't 
work. For example, 

    @Component(id="myLink")
    private EventLink myLink;

    @Component(parameters="context=123")
    private ActionLink anotherLink;

In this case only myLink is suggested, as shown in attached screenshot.

Note that the field name is the component's id, if no id is specified 
explicitly using @Component annotation.

Original comment by igor.dro...@gmail.com on 27 Jun 2012 at 2:41

Attachments:

GoogleCodeExporter commented 9 years ago
Found out the reason, and fix it in the code already, will update the update 
site soon

Original comment by gavingui...@gmail.com on 27 Jun 2012 at 3:42

GoogleCodeExporter commented 9 years ago

Original comment by gavingui...@gmail.com on 27 Jun 2012 at 3:43

GoogleCodeExporter commented 9 years ago
Fix already in version 201207011447

Original comment by gavingui...@gmail.com on 1 Jul 2012 at 12:36