tag:blogger.com,1999:blog-3283609923804350642.post7671623631193450251..comments2023-06-05T23:03:15.094-07:00Comments on Tor Norbye's Blog: Creator: How To Highlight Specific Data Table RowsTor Norbyehttp://www.blogger.com/profile/00746799716822637466noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-3283609923804350642.post-35920815262759833622006-07-10T16:51:04.000-07:002006-07-10T16:51:04.000-07:00Hi,I have a similar requirement.In the data-table ...Hi,<br>I have a similar requirement.<br>In the data-table , i want to diplay an UP/DOWN arrow to indicate an ASC/DESC sort,next to the field on which the data-table is sorted.<br>Can this be accomplished by using the rendered attribute on the outputText.<br>Please help.<br>viewclearednoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-14039159728752688192006-05-14T00:39:46.000-07:002006-05-14T00:39:46.000-07:00Hello Tor :)I was wondering if there could be a wa...Hello Tor :)<br>I was wondering if there could be a way of setting a new style class for an entire row... I'm currently using HtmlDataModel to get the selected row when deleting, but is it possible to know at which row the rendering iteration is at a current moment and return this row with HtmlDataModel's .getRow();, when the styleClass="#{myBean.nameStyle}" is called.<br>Thanx in advance<br>javabashnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-61793917861141241232006-04-18T18:52:32.000-07:002006-04-18T18:52:32.000-07:00In order to get this to work, I had to use#current...In order to get this to work, I had to use<br>#currentRow.value['JOBTITLE']<br>What's going on?<br>Also, is there someplace that all the faces context variables are listed, or do I have to hunt through each component's doc to find out what they put in the context?<br>Larrynoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-8003010127040000172006-02-02T14:45:53.000-08:002006-02-02T14:45:53.000-08:00Winston has posted a solution for that:http://blog...Winston has posted a solution for that:<br>http://blogs.sun.com/roller/page/winston?entry=setting_table_column_style<br>Tor Norbyehttp://blogs.sun.com/tornoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-35139960961035822392006-02-01T18:30:33.000-08:002006-02-01T18:30:33.000-08:00Hi Tor,is there a way to do the same with acom.sun...Hi Tor,<br>is there a way to do the same with a<br>com.sun.rave.web.ui.component.Table ?<br>Thanks<br>Franconoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-85617229035080469032005-12-01T18:53:28.000-08:002005-12-01T18:53:28.000-08:00Oh, sorryevery code i've written didn't ap...Oh, sorry<br>every code i've written didn't appear...<br>Andreasnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-82022632002365053732005-12-01T18:51:53.000-08:002005-12-01T18:51:53.000-08:00Hi Tor,sorry i'm a noob in JSF ( and in speaki...Hi Tor,<br>sorry i'm a noob in JSF ( and in speaking english, too )...<br>I'm trying to hide one specified row in a DataTable.<br>For example :<br><h:dataTable var="x" value="... ><br>if the property called show of the object "x" is false, i dont want to show this row.<br>I don't know how to do this, because if i use the rendered Attribute auf h:column JSF renderes only<br>a "<tr></tr>" and this doesn't work.<br>All i want is, that this "<tr></tr>" doesn't appear in my table.<br>Do u hava any ideas how to managed that?<br>Andreasnoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-9007275887748739682005-05-01T05:18:00.000-07:002005-05-01T05:18:00.000-07:00Hi Tommy,let's make a deal.I'll tell you h...Hi Tommy,<br>let's make a deal.<br>I'll tell you how to do this, if you will tell me the top 5 reasons why you chose to use WebSphere instead of Creator (getting feedback from people who chose to use another tool is always very valuable.)<br>Ok, here's how you do it:<br>protected Object getValue(FacesContext context, String expr) {<br>ValueBinding vb = context.getApplication().createValueBinding(expr);<br>return vb.getValue(context);<br>}<br>You find the FacesContext by FacesContext.getCurrentInstance().<br>Tor Norbyehttp://blogs.sun.com/tornoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-48517498859174667602005-04-26T06:39:26.000-07:002005-04-26T06:39:26.000-07:00thanks for replying Tor.The problem is I'm not...thanks for replying Tor.<br>The problem is I'm not using Sun Creator; I'm using websphere..that's why i don't know where the getValue() come from.<br>Is getValue() inside back-bean of a jsp file?<br>Can you show me getValue()'s code?<br>Thank you for your time and assistance..<br>Tommynoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-31910591010709418342005-04-25T10:15:02.000-07:002005-04-25T10:15:02.000-07:00If you look at your page bean (the Java class) you...If you look at your page bean (the Java class) you'll see that it extends a class (you can go to it, press Alt-G if I remember correctly when the caret is in the class name). It in turn extends another class - FacesBean.<br>These classes provide a lot of convenience methods to your java code, so your own code is simple. getValue() is implemented there - you can see exactly what it does.<br>I just now see Mark's question above - sorry I missed it below. What you want to do is call intValue() on the Integer objects. So in your example, yuo'd so if (i.intValue() > 23)) ...<br>Hope that helps.<br>Tor Norbyehttp://blogs.sun.com/tornoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-7900367906389145562005-04-25T08:45:45.000-07:002005-04-25T08:45:45.000-07:00Hi,I don't understand where the getVaule(Strin...Hi,<br>I don't understand where the getVaule(String) comes from? Can you explain to me what it does?<br>Tommynoreply@blogger.comtag:blogger.com,1999:blog-3283609923804350642.post-87118761770010034012005-03-15T04:40:17.000-08:002005-03-15T04:40:17.000-08:00Tor:Your examples on your Weblog are very helpful....Tor:<br>Your examples on your Weblog are very helpful. I have a question about to highlight specific rows...your example works fine for strings, however when I use numbers I run into all types of troubles...below is my code which works fine for identifying if 23 is in the row...what I would like to know is how to do greater than or =, as well as less than or =:<br>public String getNameStyle() {<br>Object o = getValue("#{currentRow['TotalPoint']}");<br>Integer i = new Integer(23);<br>if (o.equals(i)) {<br>return "highlighted";<br>}<br>else { return "normal";<br>}<br>Thanks in advance...I will publish this in the forum and see if I can get an answer as well. Thanks<br>Mark Downernoreply@blogger.com