You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ned Collyer <ne...@gmail.com> on 2008/12/15 06:23:37 UTC

Question re wicket:enclosure tag and resource resolution with wicket:message tags

I think it would be useful if the message resolution inside a
wicket:enclosure used the "child" (or implicit child) as the component that
is sent thru the localiser.

This is the scenario

OverviewPanel extends Panel

<wicket:panel>
	<wicket:enclosure child="productsListView">
	    <table class="searchResults">
	        <thead>
	            <tr><th><wicket:message key="name"/></th></tr>
	        </thead>
	        <tbody>
	            <tr wicket:id="productsListView">
	                <td> # <wicket:container
wicket:id="name">[name]</wicket:container> </td>
	            </tr>
	        </tbody>
	    </table>
	</wicket:enclosure>
	<wicket:enclosure child="customersListView">
	    <table class="searchResults">
	        <thead>
	            <tr>
	                <th><wicket:message key="name"/></th>
	            </tr>
	        </thead>
	        <tbody>
	            <tr wicket:id="customersListView">
	                <td> # <wicket:container
wicket:id="name">[name]</wicket:container> </td>
	            </tr>
	        </tbody>
	    </table>
	</wicket:enclosure>
</wicket:panel>

ProductsListView.properties
  name=Product

CustomersListView.properties
  name=Customers

I think what's happening at the moment is the OverviewPanel instance is
passed through to the localiser, and as such, its trying to resolve the
wicket:message tag "name" against the OverviewPanel.

If the child element of the enclosure was sent to the localiser, then it
would make the above example work  (This is a  sensible usecase IMO).

Any missing resources would then try to be resolved against the parent - aka
OverviewPanel.

Any thoughts around this?
-- 
View this message in context: http://www.nabble.com/Question-re-wicket%3Aenclosure-tag-and-resource-resolution-with-wicket%3Amessage-tags-tp21008465p21008465.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Question re wicket:enclosure tag and resource resolution with wicket:message tags

Posted by Ned Collyer <ne...@gmail.com>.
I can appreciate what it currently does - I just think it could be a little
more convenient.

It would still provide the default behavior, but allow keys to be translated
with the child scope primarily - in the same way it allows visibility to be
driven with the child scope.

Thanks for your feedback Igor.


igor.vaynberg wrote:
> 
> i do not think this is the irght way to go. the nesting is:
> 
> <wicket:panel>
>        <wicket:enclosure child="productsListView">
>                    <wicket:message key="name"/></th></tr>
> 
> so clearly the key is owned by the panel. these are the rules for
> wicket:message. keep in mind the tag is a convinience and so we try to
> keep it as simple as possible. you can always add a label that uses
> whatever you want as the localizer.
> 
> -igor
> 

-- 
View this message in context: http://www.nabble.com/Question-re-wicket%3Aenclosure-tag-and-resource-resolution-with-wicket%3Amessage-tags-tp21008465p21023555.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Question re wicket:enclosure tag and resource resolution with wicket:message tags

Posted by Igor Vaynberg <ig...@gmail.com>.
i do not think this is the irght way to go. the nesting is:

<wicket:panel>
       <wicket:enclosure child="productsListView">
                   <wicket:message key="name"/></th></tr>

so clearly the key is owned by the panel. these are the rules for
wicket:message. keep in mind the tag is a convinience and so we try to
keep it as simple as possible. you can always add a label that uses
whatever you want as the localizer.

-igor

On Sun, Dec 14, 2008 at 9:23 PM, Ned Collyer <ne...@gmail.com> wrote:
>
> I think it would be useful if the message resolution inside a
> wicket:enclosure used the "child" (or implicit child) as the component that
> is sent thru the localiser.
>
> This is the scenario
>
> OverviewPanel extends Panel
>
> <wicket:panel>
>        <wicket:enclosure child="productsListView">
>            <table class="searchResults">
>                <thead>
>                    <tr><th><wicket:message key="name"/></th></tr>
>                </thead>
>                <tbody>
>                    <tr wicket:id="productsListView">
>                        <td> # <wicket:container
> wicket:id="name">[name]</wicket:container> </td>
>                    </tr>
>                </tbody>
>            </table>
>        </wicket:enclosure>
>        <wicket:enclosure child="customersListView">
>            <table class="searchResults">
>                <thead>
>                    <tr>
>                        <th><wicket:message key="name"/></th>
>                    </tr>
>                </thead>
>                <tbody>
>                    <tr wicket:id="customersListView">
>                        <td> # <wicket:container
> wicket:id="name">[name]</wicket:container> </td>
>                    </tr>
>                </tbody>
>            </table>
>        </wicket:enclosure>
> </wicket:panel>
>
> ProductsListView.properties
>  name=Product
>
> CustomersListView.properties
>  name=Customers
>
> I think what's happening at the moment is the OverviewPanel instance is
> passed through to the localiser, and as such, its trying to resolve the
> wicket:message tag "name" against the OverviewPanel.
>
> If the child element of the enclosure was sent to the localiser, then it
> would make the above example work  (This is a  sensible usecase IMO).
>
> Any missing resources would then try to be resolved against the parent - aka
> OverviewPanel.
>
> Any thoughts around this?
> --
> View this message in context: http://www.nabble.com/Question-re-wicket%3Aenclosure-tag-and-resource-resolution-with-wicket%3Amessage-tags-tp21008465p21008465.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org