datatable - wicket manipulating DefaultDataTable -


i creating web application in wicket , had created table shows user information. wanted manipulate table if cell contained "n" background color red , if contained "y" background color green. @ moment having trouble determine inside cell. create table following:

datatable = new defaultdatatable<tablemodalint, string>("table", columns,             new tablemodalprovider(), 100000){         @suppresswarnings("rawtypes")         @override         protected item newcellitem(string id, int index, imodel model) {             item item = super.newcellitem(id, index, model);              if (id == "3"){                 item.add(attributemodifier.replace("align", "center"));             }             return item;         }     }; 

i capable of determining cell wanna check being displayed user. on how can this? change color know i'll have add item.add(attributemodifier.replace("bgcolor", "red")); don't know how tell whats inside cell

you should checks in icolumn implementation. https://github.com/apache/wicket/blob/24e9db6c8af85043ce36e4d25a0e8a2d8dc2f49e/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/propertycolumn.java#l94 populates item label. need add attributemodifier label.

you can achieve goal pure javascript and/or css @ client side.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -