voyent
Can we override dataexporter class?  XML
Forum Index -> Components
Author Message
atomz4peace

Joined: 20/Nov/2006 00:00:00
Messages: 121
Offline


Is there any way to override any of the methods in DataExporter? The problem is that when you export a datatable that has links in it, the html link comes through as well. So if I just want the text that is displayed on the screen, there seems to be now way to strip out the link part.

The change would be to do something like adding another tag, maybe "textOnly" and then in DataExporter.encodeParentAndChildrenAsString() where we have:
Code:
         if (value != null)
             str.append(value);
         else {
             ValueBinding vb = uic.getValueBinding("value");
             if (vb != null)
                 str.append(vb.getValue(fc));
         }
 


Add some other thing like:

Code:
 if (TEXTONLY) {
   if (uic instanceof UIGraphic) {
     ValueBinding vbAlt = uic.getValueBinding("alt");
    // add the alt tag only
   } else if (uic instanceof UIOutput && !(uic instanceof javax.faces.component.html.HtmlOutputLink)) {
    // add the value here
   }
 } else {
 
 // do original work here
 
 }							
 


I would rather avoid custom source and I can probably create my own custom tag, but is there a way to override just this method/class in my app?

Thanks!
raymundogj

Joined: 05/Nov/2010 13:02:10
Messages: 3
Offline


Hi.

I am facing the same problem and I was wondering if you were able to find a solution. I already tried a custom OutputHandler but it doesn't help since the cell value is already mixed up at that point.

Thanks.
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team