Updating a localized StaticTextField within a TiledView
I have a ViewBean which holds an embedded TiledView and this TiledView
has an embedded TiledView. In my last Tiled View I'm updating a
StaticTextField object within my nextTile() method. This
StaticTextField object is constructed with a ResourceBundleModel for
localization. Here's my constructor....
StaticTextField child = new StaticTextField(this, rbModel, name, null);
name = "label_queue";
and this string is in my Resource.properties file like this:
label_queue=?
My problem is that my TiledView is looping 4 times and the value of my
StaticTextField is not getting updated. I receive the following on my
JSP page:
?
?
?
?
Here is my nextTile() method:
Keep in mind that I'm updating the CHILD_LABEL_QUEUE with a String
called 'key'. 'key' changes for every loop and it's value has
references in my Resource.properties file. But the only value I'm
getting is the label_queue value that I specified in my
Resource.properties file. So it seems that it's only showing what I
registered the StaticTextField as and not updating its value within my
nextTile() method.
public boolean nextTile() throws ModelControlException {
boolean bContinue = super.nextTile();
if(bContinue) {
try {
String key = (String) itQueueKeyIter.next();
int iCount = ((Integer) mapQueues.get(key)).intValue();
setDisplayFieldValue(CHILD_LABEL_QUEUE, key);
setDisplayFieldValue(CHILD_LABEL_QUEUE_NUM, iCount);
} catch(IndexOutOfBoundsException iobe) {
System.out.println("@@ Error accessing the
AssetManager from the alAssetManagers.get() method @@");
iobe.printStackTrace();
}
}
return bContinue;
}
Any help would be appreciated since I'm stuck at this point and can't
move forward.
Thanks a lot.
- bacon -
[2001 byte] By [
Guest] at [2007-11-25 9:28:48]

The key/value pair you should be picking up from the
ResourceBundleModel is the one specified by the "bound field"
property of the field. Therefore, if you expect the value to change
per tile, you will need to change the bound field name per tile by
calling setBoundName() with a key value specific to that tile.
For example:
label_0=Zero
label_1=One
label_2=Two
label_3=Three
public boolean nextTile()
{
boolean result=super.nextTile();
if (result)
{
String keyName="label_"+getTileIndex();
((StaticTextField)getDisplayField(<field name>)).setBoundName
(keyName);
}
result result;
}
Todd
In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, "chubbykidd" <<a href="/group/SunONE-JATO/post?protectID=014166219007078048234218065036129208"&g t;bacon33@o...</a>> wrote:
> I have a ViewBean which holds an embedded TiledView and this
TiledView
> has an embedded TiledView. In my last Tiled View I'm updating a
> StaticTextField object within my nextTile() method. This
> StaticTextField object is constructed with a ResourceBundleModel for
> localization. Here's my constructor....
>
> StaticTextField child = new StaticTextField(this, rbModel, name,
null);
>
> name = "label_queue";
>
> and this string is in my Resource.properties file like this:
>
> label_queue=?
>
> My problem is that my TiledView is looping 4 times and the value of
my
> StaticTextField is not getting updated. I receive the following on
my
> JSP page:
> ?
> ?
> ?
> ?
>
> Here is my nextTile() method:
>
> Keep in mind that I'm updating the CHILD_LABEL_QUEUE with a String
> called 'key'. 'key' changes for every loop and it's value has
> references in my Resource.properties file. But the only value I'm
> getting is the label_queue value that I specified in my
> Resource.properties file. So it seems that it's only showing what I
> registered the StaticTextField as and not updating its value within
my
> nextTile() method.
>
>
> public boolean nextTile() throws ModelControlException {
> boolean bContinue = super.nextTile();
>
> if(bContinue) {
> try {
> String key = (String) itQueueKeyIter.next();
> int iCount = ((Integer) mapQueues.get(key)).intValue
();
> setDisplayFieldValue(CHILD_LABEL_QUEUE, key);
> setDisplayFieldValue(CHILD_LABEL_QUEUE_NUM, iCount);
> } catch(IndexOutOfBoundsException iobe) {
> System.out.println("@@ Error accessing the
> AssetManager from the alAssetManagers.get() method @@");
> iobe.printStackTrace();
> }
> }
>
> return bContinue;
> }
>
> Any help would be appreciated since I'm stuck at this point and
can't
> move forward.
>
> Thanks a lot.
>
> - bacon -
Guest at 2007-7-1 16:34:28 >
