Skip to main content

Problem with rowClasses probably caused by changes from 1.2_09 to 1.2_11

2 replies [Last post]
wise_guybg
Offline
Joined: 2007-07-25

Hello,

I'm developing an application using JSF (Mojarra) and Facelets. I had some code written that display some h:dataTable with different styles for odd and even rows using the rowClasses attribute.

I think it was after I updated my libraries from 1.2_09 to 1.2_11 that the code stopped working. When I check the generated html for a table with several rows, it has only odd class styles.

After some debugging I noticed that there is a problem with the counter for the rows. My opinion is that creating a TableMetaInfo for each row (each with its own rowStyleCounter) is the reason why there is no switching between styles. It's always the first one that is used. The code for creating the meta info is as follows:

protected TableRenderer.TableMetaInfo getMetaInfo(FacesContext context,
UIComponent table) {

String key = createKey(context, table);
Map reqMap = context.getExternalContext().getRequestMap();
TableRenderer.TableMetaInfo info = (TableRenderer.TableMetaInfo)
reqMap.get(key);
if (info == null) {
info = new TableRenderer.TableMetaInfo(table);
reqMap.put(key, info);
}
return info;

}

The key that is generated is something like mainForm:table:0, mainForm:table:1, etc.

The code is different from 1.2_09 where you'll find:

protected TableRenderer.TableMetaInfo getMetaInfo(UIComponent table) {

TableRenderer.TableMetaInfo info = (TableRenderer.TableMetaInfo)
table.getAttributes().get(TableRenderer.TableMetaInfo.KEY);
if (info == null) {
info = new TableRenderer.TableMetaInfo(table);
table.getAttributes().put(TableRenderer.TableMetaInfo.KEY, info);
}
return info;

}

And don't want to get to any more details as I'm not sure what exactly went wrong. Is there anyone that knows something about the issue. I couldn't find anything on Google or the other forums so any suggestions are welcome.

Thank you for the attention,
Alex

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
wise_guybg
Offline
Joined: 2007-07-25

Waiting for version 1.2_12 to be released. Thanks

Ryan Lubke

This is a known issue and is already fixed in the 1.2 nightly builds.
We'll be releasing 1.2_12 soon.

webtier@javadesktop.org wrote:
> Hello,
>
> I'm developing an application using JSF (Mojarra) and Facelets. I had some code written that display some h:dataTable with different styles for odd and even rows using the rowClasses attribute.
>
> I think it was after I updated my libraries from 1.2_09 to 1.2_11 that the code stopped working. When I check the generated html for a table with several rows, it has only odd class styles.
>
> After some debugging I noticed that there is a problem with the counter for the rows. My opinion is that creating a TableMetaInfo for each row (each with its own rowStyleCounter) is the reason why there is no switching between styles. It's always the first one that is used. The code for creating the meta info is as follows:
>
> protected TableRenderer.TableMetaInfo getMetaInfo(FacesContext context,
> UIComponent table) {
>
> String key = createKey(context, table);
> Map reqMap = context.getExternalContext().getRequestMap();
> TableRenderer.TableMetaInfo info = (TableRenderer.TableMetaInfo)
> reqMap.get(key);
> if (info == null) {
> info = new TableRenderer.TableMetaInfo(table);
> reqMap.put(key, info);
> }
> return info;
>
> }
>
> The key that is generated is something like mainForm:table:0, mainForm:table:1, etc.
>
> The code is different from 1.2_09 where you'll find:
>
> protected TableRenderer.TableMetaInfo getMetaInfo(UIComponent table) {
>
> TableRenderer.TableMetaInfo info = (TableRenderer.TableMetaInfo)
> table.getAttributes().get(TableRenderer.TableMetaInfo.KEY);
> if (info == null) {
> info = new TableRenderer.TableMetaInfo(table);
> table.getAttributes().put(TableRenderer.TableMetaInfo.KEY, info);
> }
> return info;
>
> }
>
> And don't want to get to any more details as I'm not sure what exactly went wrong. Is there anyone that knows something about the issue. I couldn't find anything on Google or the other forums so any suggestions are welcome.
>
> Thank you for the attention,
> Alex
> [Message sent by forum member 'wise_guybg' (wise_guybg)]
>
> http://forums.java.net/jive/thread.jspa?messageID=325934
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net