You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beehive.apache.org by Adam Jenkins <ma...@adamjenkins.net> on 2005/07/04 21:26:45 UTC

accessing datagrid i18n

Hi all,

How do you access the i18n values for a datagrid?  i.e. 

When accessing for <netui-data:declareBundle bundlePath="myprops"
name="app"/>

I use ${bundle.app.somevalue}.  How do I access from 

<netui-data:dataGrid name="requestsGrid" dataSource="pageInput.requests"
resourceBundlePath="requestsgridlabels">

or is that attribute just to replace the standard labels and images and
I should continue to use netui-data:declareBundle for my labels?

Cheers
Adam


Re: accessing datagrid i18n

Posted by Eddie ONeil <ek...@gmail.com>.
Adam--

  I think your take on this is correct.  

  The <netui-data:declareBundle> tag is best used for
internationalizing text used to render the content-specific strings in
the data grid.  The headerText labels for the pet grid (your example
below) are a good case of this.

  The data grid's resourceBundlePath is used to override the strings
that the data grid renders for paging, etc.  Think of these as
specific to the look-and-feel of a data grid or set of data grids; for
example, the text used for "Previous" and "Next" in the pager.

  The <netui-data:imageAnchorColumn> could be used as below.  Here,
this will render the "export.png" as a clickable link which will
navigate to the "export" action in the current page flow.  The current
pet identifier will be passed to the anchor via a request parameter. 
The JSP might look like:

<netui-data:imageAnchorCell
        src="${pageContext.request.contextPath}/images/export.png"
        alt="${bundle.petGridBundle.exportAlt}"
        action="export">
    <netui:parameter name="id" value="${container.item.petId}"/>
</netui-data:imageAnchorCell>
  
  Hope that helps; let me know if I'm not making something clear or
something doesn't work.

Eddie




On 7/5/05, Adam Jenkins <ma...@adamjenkins.net> wrote:
> So the 'best practice' in this case would be to have another
> netui-data:declareBundle and get the values from that rather than
> putting them in the bundle refered to by 'resourceBundlePath' on
> netui-data:dataGrid and keep the later for messages required by thu
> datagrid system (e.g. datagrid.msg.nodata)?
> 
> I wanted to have all my i18n labels for the data grid in the some bundle
> if possible.  Should I declare another netui-data:declareBundle pointing
> to the same place as the resourceBundlePath of netui-data:dataGrid or is
> there a way I can get the reference created by the dataGrid?  Or should
> I really have them separated into two different resource files?
> 
> Does that make sense?
> 
> Also, is there any good examples of using netui-data:anchorCell or
> imageAnchorCell.  I want to have a 'export' button next to each of my
> rows and was wondering vhat the best practice for associating that
> action to the object that is represented by the row in the Controller
> is.
> 
> Sorry for all the questions guys...lots to learn.  Maven plugin is still
> underway also...am using a paid project to simultanouesly develop plugin
> and learn the tech, so I'll get it released after I deliver to the
> client (hopefully next week).
> 
> Cheers
> Adam
> 
> On Tue, 2005-07-05 at 10:27 -0700, Eddie ONeil wrote:
> > Adam--
> >
> >   In that case, you should be able to use the ${bundle} data binding
> > context as in other NetUI tags.  For example:
> >
> >   <netui-data:header>
> >     <netui-data:headerCell headerText="${bundle.myPetBundle.petIdHeader}"/>
> >   <netui-data:header>
> >
> > And so on...
> >
> >   Let me know if that solves your problem.
> >
> > Eddie
> >
> >
> >
> > On 7/5/05, Adam Jenkins <ma...@adamjenkins.net> wrote:
> > > Labels...specifically the header labels.
> > >
> > > I'm working through the examples and wondering what is the best way to
> > > internationalize 'headerText' from the datagrid examples:
> > >
> > >         <netui-data:header>
> > >             <netui-data:headerCell headerText="Pet ID Number"/>
> > >             <netui-data:headerCell headerText="Name"/>
> > >             <netui-data:headerCell headerText="Description"/>
> > >             <netui-data:headerCell headerText="Price"/>
> > >         </netui-data:header>
> > >
> > > Cheers
> > > Adam
> > >
> > > On Mon, 2005-07-04 at 15:21 -0700, Eddie ONeil wrote:
> > > > Adam--
> > > >
> > > >   Hey; what specific strings are you attempting to internationalize?
> > > > Those produced by the data grid in the pager (for example) or those
> > > > related to user data, labels, etc?
> > > >
> > > > Eddie
> > > >
> > > >
> > > > On 7/4/05, Adam Jenkins <ma...@adamjenkins.net> wrote:
> > > > > Hi all,
> > > > >
> > > > > How do you access the i18n values for a datagrid?  i.e.
> > > > >
> > > > > When accessing for <netui-data:declareBundle bundlePath="myprops"
> > > > > name="app"/>
> > > > >
> > > > > I use ${bundle.app.somevalue}.  How do I access from
> > > > >
> > > > > <netui-data:dataGrid name="requestsGrid" dataSource="pageInput.requests"
> > > > > resourceBundlePath="requestsgridlabels">
> > > > >
> > > > > or is that attribute just to replace the standard labels and images and
> > > > > I should continue to use netui-data:declareBundle for my labels?
> > > > >
> > > > > Cheers
> > > > > Adam
> > > > >
> > > > >
> > >
> > >
> 
>

Re: accessing datagrid i18n

Posted by Adam Jenkins <ma...@adamjenkins.net>.
So the 'best practice' in this case would be to have another 
netui-data:declareBundle and get the values from that rather than
putting them in the bundle refered to by 'resourceBundlePath' on
netui-data:dataGrid and keep the later for messages required by thu
datagrid system (e.g. datagrid.msg.nodata)?

I wanted to have all my i18n labels for the data grid in the some bundle
if possible.  Should I declare another netui-data:declareBundle pointing
to the same place as the resourceBundlePath of netui-data:dataGrid or is
there a way I can get the reference created by the dataGrid?  Or should
I really have them separated into two different resource files?

Does that make sense?

Also, is there any good examples of using netui-data:anchorCell or
imageAnchorCell.  I want to have a 'export' button next to each of my
rows and was wondering vhat the best practice for associating that
action to the object that is represented by the row in the Controller
is.

Sorry for all the questions guys...lots to learn.  Maven plugin is still
underway also...am using a paid project to simultanouesly develop plugin
and learn the tech, so I'll get it released after I deliver to the
client (hopefully next week).

Cheers
Adam

On Tue, 2005-07-05 at 10:27 -0700, Eddie ONeil wrote:
> Adam--
> 
>   In that case, you should be able to use the ${bundle} data binding
> context as in other NetUI tags.  For example:
> 
>   <netui-data:header>
>     <netui-data:headerCell headerText="${bundle.myPetBundle.petIdHeader}"/>
>   <netui-data:header>
> 
> And so on...
> 
>   Let me know if that solves your problem.
> 
> Eddie
> 
> 
> 
> On 7/5/05, Adam Jenkins <ma...@adamjenkins.net> wrote:
> > Labels...specifically the header labels.
> > 
> > I'm working through the examples and wondering what is the best way to
> > internationalize 'headerText' from the datagrid examples:
> > 
> >         <netui-data:header>
> >             <netui-data:headerCell headerText="Pet ID Number"/>
> >             <netui-data:headerCell headerText="Name"/>
> >             <netui-data:headerCell headerText="Description"/>
> >             <netui-data:headerCell headerText="Price"/>
> >         </netui-data:header>
> > 
> > Cheers
> > Adam
> > 
> > On Mon, 2005-07-04 at 15:21 -0700, Eddie ONeil wrote:
> > > Adam--
> > >
> > >   Hey; what specific strings are you attempting to internationalize?
> > > Those produced by the data grid in the pager (for example) or those
> > > related to user data, labels, etc?
> > >
> > > Eddie
> > >
> > >
> > > On 7/4/05, Adam Jenkins <ma...@adamjenkins.net> wrote:
> > > > Hi all,
> > > >
> > > > How do you access the i18n values for a datagrid?  i.e.
> > > >
> > > > When accessing for <netui-data:declareBundle bundlePath="myprops"
> > > > name="app"/>
> > > >
> > > > I use ${bundle.app.somevalue}.  How do I access from
> > > >
> > > > <netui-data:dataGrid name="requestsGrid" dataSource="pageInput.requests"
> > > > resourceBundlePath="requestsgridlabels">
> > > >
> > > > or is that attribute just to replace the standard labels and images and
> > > > I should continue to use netui-data:declareBundle for my labels?
> > > >
> > > > Cheers
> > > > Adam
> > > >
> > > >
> > 
> >


Re: accessing datagrid i18n

Posted by Eddie ONeil <ek...@gmail.com>.
Adam--

  In that case, you should be able to use the ${bundle} data binding
context as in other NetUI tags.  For example:

  <netui-data:header>
    <netui-data:headerCell headerText="${bundle.myPetBundle.petIdHeader}"/>
  <netui-data:header>

And so on...

  Let me know if that solves your problem.

Eddie



On 7/5/05, Adam Jenkins <ma...@adamjenkins.net> wrote:
> Labels...specifically the header labels.
> 
> I'm working through the examples and wondering what is the best way to
> internationalize 'headerText' from the datagrid examples:
> 
>         <netui-data:header>
>             <netui-data:headerCell headerText="Pet ID Number"/>
>             <netui-data:headerCell headerText="Name"/>
>             <netui-data:headerCell headerText="Description"/>
>             <netui-data:headerCell headerText="Price"/>
>         </netui-data:header>
> 
> Cheers
> Adam
> 
> On Mon, 2005-07-04 at 15:21 -0700, Eddie ONeil wrote:
> > Adam--
> >
> >   Hey; what specific strings are you attempting to internationalize?
> > Those produced by the data grid in the pager (for example) or those
> > related to user data, labels, etc?
> >
> > Eddie
> >
> >
> > On 7/4/05, Adam Jenkins <ma...@adamjenkins.net> wrote:
> > > Hi all,
> > >
> > > How do you access the i18n values for a datagrid?  i.e.
> > >
> > > When accessing for <netui-data:declareBundle bundlePath="myprops"
> > > name="app"/>
> > >
> > > I use ${bundle.app.somevalue}.  How do I access from
> > >
> > > <netui-data:dataGrid name="requestsGrid" dataSource="pageInput.requests"
> > > resourceBundlePath="requestsgridlabels">
> > >
> > > or is that attribute just to replace the standard labels and images and
> > > I should continue to use netui-data:declareBundle for my labels?
> > >
> > > Cheers
> > > Adam
> > >
> > >
> 
>

Re: accessing datagrid i18n

Posted by Adam Jenkins <ma...@adamjenkins.net>.
Labels...specifically the header labels.

I'm working through the examples and wondering what is the best way to
internationalize 'headerText' from the datagrid examples:

        <netui-data:header>
            <netui-data:headerCell headerText="Pet ID Number"/>
            <netui-data:headerCell headerText="Name"/>
            <netui-data:headerCell headerText="Description"/>
            <netui-data:headerCell headerText="Price"/>
        </netui-data:header>

Cheers
Adam

On Mon, 2005-07-04 at 15:21 -0700, Eddie ONeil wrote:
> Adam--
> 
>   Hey; what specific strings are you attempting to internationalize? 
> Those produced by the data grid in the pager (for example) or those
> related to user data, labels, etc?
> 
> Eddie
> 
> 
> On 7/4/05, Adam Jenkins <ma...@adamjenkins.net> wrote:
> > Hi all,
> > 
> > How do you access the i18n values for a datagrid?  i.e.
> > 
> > When accessing for <netui-data:declareBundle bundlePath="myprops"
> > name="app"/>
> > 
> > I use ${bundle.app.somevalue}.  How do I access from
> > 
> > <netui-data:dataGrid name="requestsGrid" dataSource="pageInput.requests"
> > resourceBundlePath="requestsgridlabels">
> > 
> > or is that attribute just to replace the standard labels and images and
> > I should continue to use netui-data:declareBundle for my labels?
> > 
> > Cheers
> > Adam
> > 
> >


Re: accessing datagrid i18n

Posted by Eddie ONeil <ek...@gmail.com>.
Adam--

  Hey; what specific strings are you attempting to internationalize? 
Those produced by the data grid in the pager (for example) or those
related to user data, labels, etc?

Eddie


On 7/4/05, Adam Jenkins <ma...@adamjenkins.net> wrote:
> Hi all,
> 
> How do you access the i18n values for a datagrid?  i.e.
> 
> When accessing for <netui-data:declareBundle bundlePath="myprops"
> name="app"/>
> 
> I use ${bundle.app.somevalue}.  How do I access from
> 
> <netui-data:dataGrid name="requestsGrid" dataSource="pageInput.requests"
> resourceBundlePath="requestsgridlabels">
> 
> or is that attribute just to replace the standard labels and images and
> I should continue to use netui-data:declareBundle for my labels?
> 
> Cheers
> Adam
> 
>