How to use renderer feature easily?

Hi, i have read a lot about renderers and i think it is much more complicated than converters and validator for example.
For example i would like that the inputText that come by default with jsf don't be gray but red. I know that i can fix its css attributes and every thing ok, but what i want is that when i pick on the component toolbar the inputText and drag it into the page the component shows itself red.
So, to do that i have to write a Renderer subclass, define a new jsp tag and its handler class, i think this is a lot of work just to change a default color.
There is another way to do that?
I think for instace, extend the default renderer class of the inputText component of jsf and in some way define the new color the component will be rendered.

Hi,
i had a similar problem. I wanted to render the rows and columns of my dataTable dependend on the underlying data. So i just did what you mentioned:
Extend the renderer for this component and decide what to do to its attributes.
Example:
public void encodeChildren(FacesContext context, UIComponent component)
        throws IOException
        if(context == null || component == null)
            throw new NullPointerException(Util.getExceptionMessageString("com.sun.faces.NULL_PARAMETERS_ERROR"));
        if(log.isDebugEnabled())
            log.debug("Begin encoding children " + component.getId());
        if(!component.isRendered())
        String columnClasses[] = getColumnClasses(data);
        int columnStyle = 0;
        int columnStyles = columnClasses.length;
        String AllrowClasses[] = getRowClasses(data);
        // Clean AllrowClasses for iteratable rowStyles (without 'Feiertage')
        String rowClasses[] = shiftStylesforActWeekday(AllrowClasses,data);
        do
            if(rows > 0 && ++processed > rows)
                break;
                // If act. row is 'Feiertag' include style for all columns for this row
                columnCount++;
    if ((tagN != null && !tagN.equalsIgnoreCase(""))|| (tagS != null && !tagS.equalsIgnoreCase("")&& isSaarWorker))
                if(columnStyles > 0)
                 writer.writeAttribute("class", columnClasses[columnStyle++], "columnClasses");
                 if(columnStyle >= columnStyles)
                  columnStyle = 0;
            // Insert extra row after "So"
            if (wtag.equalsIgnoreCase("So")){
             InsertExtraRow(writer, columnCount);
        } while(true);
...   I had to change the column and rowClasses array depending which row is first in dataTable. So i shift this array and the renderer uses the shifted array to style each row and column.
I hope that may help!? Regards,
ak

Similar Messages

  • How to use autosuggest feature in adf?

    how to use autosuggest feature in adf?

    You can refer below link
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/004-auto-suggest-169120.pdf
    Thanks
    AJ

  • Can someone tell me please how to use the features...

    Hi all,
    Can someone tell me please how to use the features on the HS-47 headset?
    That is, what functions does the button control and how many presses of the button for each function, etc?
    The headset was as supplied with my 6200.
    I've tried looking for a user guide but I don't think there is one.
    Many thanks,
    Steve.

    I think it's pretty basic.
    If you are listening to music on your phone, it should automatically mute it when a call comes in. A basic press of the call answer / end button should then do just that.
    Have a go! You could try experimenting with a quick double press, that may recall the last number you dialled, but otherwise that's probably it.

  • How to use highlighter feature

    I have Adobe Acrobat Professional 8. I want to search an existing document and have it automatically highlight all words in my search and save the document with those words highlighted so I can print it that way.
    I see how to highlight them one at a time but there must be a way to have it highlight all the words for me?
    Rae

    Hi,
    I provide technical support for all adobe acrobat related questions... even those that adobe support fails to answer... if your work is interrupted because you have problems with how to use acrobat features or its giving you errors or its crashing on you... just let me know... I charge very less and support is provided!

  • I am using Photoshop CC2014 15.00.  In the pop-up menu for the Fill command there is a place for Scripted patterns.  Within that part, the tree and the picture frame are grayed. Why?   I've seen demonstrations on how to use the feature but mine doesn't wo

    I am using Photoshop CC2014 15.00.  In the pop-up menu for the Fill command there is a place for Scripted patterns.  Within that part, the tree and the picture frame are grayed.
    Why?   I've seen demonstrations on how to use the feature but mine doesn't work.  I checked the updates and I have the current version.
    Thanks.      LM

    I am running CC 2014.2.1 and I've updated to Yosemite. Not seeing tree or frame as an option in the menu. Coworker still on Mavericks has it.

  • How to use the feature of ajax in visual web jsf

    Hello,everyone!
    I want to use the feature of ajax in visual web jsf,but the program encountered a error. I want refresh the dropdownlist once the javascript captured the refresh message,they both behaved asynchronously. However, the textField1 rendered with a blank box,while the dropDown1 had no change. The code as follows:
    <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
    <webuijsf:page binding="#{Page1.page1}" id="page1">
    <webuijsf:html binding="#{Page1.html1}" id="html1">
    <webuijsf:head binding="#{Page1.head1}" id="head1">
    <webuijsf:link binding="#{Page1.link1}" id="link1" url="/resources/stylesheet.css"/>
    <webuijsf:script>
    var processEvents = {                                                
    update: function(props) {
    var combo=document.getElementById("form1:dropDown1");
    combo.refresh();
    // Subscribe to refresh event.
    function refreshme(){
    var dom=document.getElementById("form1:textField1");
    dom.refresh();
    dojo.subscribe(webui.suntheme.widget.textField.event.refresh.endTopic, processEvents, "update");
    </webuijsf:script>
    </webuijsf:head>
    <webuijsf:body binding="#{Page1.body1}" id="body1" style="-rave-layout: grid">
    <webuijsf:form binding="#{Page1.form1}" id="form1">
    <webuijsf:textField binding="#{Page1.textField1}" id="textField1" onBlur="refreshme();"
    style="position: absolute; left: 168px; top: 144px" valueChangeListenerExpression="#{Page1.textField1_processValueChange}"/>
    <webuijsf:textField binding="#{Page1.textField2}" id="textField2" style="left: 168px; top: 96px; position: absolute"/>
    <webuijsf:dropDown binding="#{Page1.dropDown1}" id="dropDown1" items="#{Page1.dropDown1DefaultOptions.options}" style="position: absolute; left: 192px; top: 216px"/>
    </webuijsf:form>
    </webuijsf:body>
    </webuijsf:html>
    </webuijsf:page>
    </f:view>
    </jsp:root>
    /**********************************java******************************************/
    the function textField1_processValueChange didn't been invoked
    public void textField1_processValueChange(ValueChangeEvent event) {
    DropDown dd=getDropDown1();
    Option op1=new Option();
    String addText=(String)getTextField1().getText();
    op1.setLabel(addText);
    op1.setTooltip("tooptip");
    op1.setValue(addText);
    ArrayList <Option> l=null;
    Iterator <Option> i = dd.getListItems();
    while(i.hasNext()){
    l.add(i.next());
    l.add(op1);
    dd.setItems(l);
    thanks In advance all of your replies.

    Hi there,
    Take a look at this, will help you
    http://developers.sun.com/jscreator/learning/tutorials/2/textcompletion.html
    Thanks
    K

  • Can you please help me figure out my i phone and how to use the features

    i need some help on figuring out my phone can you please help me figure out how to use my i phone and the blue tooth features to listen to music or how can a friend or a relative send me songs for me to listen to.....                   

    To listen to music with a headset or earbuds via bluetooth requires a bluetooth stereo headset.
    File transfer via bluetooth is not supported. A friend or relative can purchase music for you via the iTunes music store with an iTunes store gift card or by sending you the music gift via email from iTunes.

  • How to use renderer for a Jtree Element

    Hi all,
    i have been told to use Renderer for drawing a JTree on a JPanel.
    I mean, i want to draw each element of the JTree as a rectangle with a label inside it.....each element of my JTree contains an UserObject with a string inside it.
    Any suggestions ?
    Cheers.
    Stefano

    read the link below it shows how to use trees and tree renderer.
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

  • Is there a place summarizing How To use new features?

    I upgraded to Lion, but now I'm searching everywhere ho to use each new feature.
    Apple's "Lion"'s page is just showing what features are new but now how to use/activate them.
    Any place where I can go to see them all explained as to how to use, implement, activate?

    http://www.apple.com/macosx/whats-new/#video-lion

  • How to use search feature in my JSP?

    Hi all,
    In my struts application, there is one Jsp page which receives some keyword and based on that keyword it searches the local file system(all diskslike C:\,D:\,E:\.....). how to implement this feature and should display only the latest 10 records. How to implement this.Help me with step-by-step procedure/code help is highly appreciated.
    Thanks a lot

    Are you searching by the content of a file, or by the name of the file? If you're searching by content..it seems like a search on all the disks will take a very long time.
    Here's some rough code:
    ArrayList<File> list = new ArrayList();
       File startdir =new File("C:\\");
       recurseFiles(startdir, keyword, list);
       public static final int MAXSIZE = 10;
      private void recurseFiles(File currfile, String keyword, ArrayList<File> list){
           if (currfile.isDirectory()){
                 File[] fileset = currfile.listFiles();
                 for (int i =0; i<fileset.length; i ++){
                         recurseFiles(fileset, keyword, list);
    }else{
    try{
    boolean found=false;
    BufferedReader testread = new BufferedReader(new InputStreamReader(new FileInputStream(currfile)));
    while (testread.ready() && !found){
    String currline = testread.readLine();
    if (currline.indexOf(keyword)!=-1) found = true;
    testread.close();
    if (found){
    int loc = 0;
    //most recently modified files are at the end.
    while (list.size() > loc && list.get(loc).lastModified() <currfile.lastModified()
    loc++;
    list.add(loc, currfile);
    if (list.size() > MAXSIZE) list.remove(0);
    That code should work, I think. I'm a little skeptical of the while loop--can someone verify that?

  • How to use RCIEV feature to trigger mail to a particular mail id in M0001

    Hi,
    I'm trying to trigger mail for any marital status change in personal data infotype for employee through dynamic action. Kindly help me in using RCIEV feature in M001 feature in detail for triggering mail to a manager other than administrator.
    Thanks,
    Kalai.

    Check this documentation.
    RCIEV  Defining a Distribution List or Mail Address
       you can define a feature that sets the parameters for a
        mail to be sent when changes are made to an infotype record. In the
        standard system, this involves feature M0001. You can also specify a
        feature within this feature to determine possible recipients of the mail
        according to the control values in the organizational assignment.
      Use
        Mail connection for master data infotype changes for employees and
        applicants.
      Procedure
        The return matrix of the feature has the following structure: X-VVVVVVVV
        with the following meanings:
        o   X - Indicator 'M' for mail or 'V' for distribution lists
        o   VVVVVVVV - Valid mailing name or distribution list, which is stored
                       in a shared folder in SAPoffice (transaction so04).
      See also
        Feature TEXT1

  • How to Use Cutaway Feature in iMovie '11

    Hi.
    I am attempting to make a farewell movie for a retiring colleague. I have video and digital photos, but here is the clincher: My video is of people talking and it is boring to watch. Therefore, I want to run video and photo "slides" in the same project, In addition, I want to have background music.
    How can I transition from the individuals talking (the video) to photos, back to video? All the while when the photos are shown I want the audio from the video to still be heard. (in addition to my changing background music)
    Can I do this? Meaning is this level of editing possible with imovie. And of course how?
    I am a fast learner and can pick up these type of things easily just need a few tips.
    I am concerned that I will have to some how rip the audio from all of my video clips and make one big file then just cut and splice the video and pictures I want to see in the order I want. If I could manage to do that how difficult would it be to match the audio with the visual.
    I hope you understand. And i hope some of you experts can help.

    Yes, this is quite simple.
    First go to iMovie/Preferences and make sure the Advanced Tools are enabled.
    Next drag your photo (or a different video clip) onto the video clip in the project and drop it on the frame where you want the photo to start. A pop-up menu will appear. Choose CUTAWAY.
    Here is a [Tutorial by Ken Stone on the Cutaway feature|http://www.kenstone.net/fcphomepage/imovie_09stone.html#cutaway%20pip] for iMovie 09. It hasn't changed very much in iMovie 11, so it may be helpful.

  • Wrv210 How to use vlan feature?

      Hi people.
    I have 1 WRV210 Wireless Router, this device have the vlan feature, I have read about this feature that u could have separate networks example:
    192.168.10.X net-1
    10.0.8.x net-2
    My ISP use pppoe, is working, but I dont know how to setup 2 networks with this device? The manual just tell u how to create vlans but is all nothing more.
    Can someone help me with this?
    Suppose that I have 1 computer wired and some clients wireless, I want to have net-1 for my wired clients and net-2 for my wireless clients, but separate and using both networks the same ISP.
    Thanks!!!

    Go to the Setup page of the wrv210. On the sub-tab click on Vlan. Select enable on the Port-Based Vlan.  Check the box of the desired vlan that you want to assign to the port and ssid.

  • How to use new feature "New Picture"?

    SDDM 4.1.0.866 has a new feature ("New Picture"), icon to the right of "New Note" icon. Using this icon, I can insert an external image in a relational diagram, but when I go through the same motions on a logical diagram, the image does not show up. Am I not using the new feature correctly, or does it apply only to relational diagrams? Thanks.

    Hi Patrick,
    it should be possible to add image to diagrams in all models. It appears there is a problem for diagrams in logical model.
    Thanks for reporting the problem, I logged a bug.
    Philip

  • Upgraded to ios4, confused how to used ipod feature now?

    after recently installing the new software im now confused as to how i can use my i pod. When i go into it the 'songs' it says i have none, all my music is still available to view as albums but you seem to have to create playlists from the 'songs' section. i used to just go onto 'all songs' press shuffle and let it play through but now i only have the option to do 1 artist at a time.
    if anyone could help me out that would be great.
    Thank you
    Helen

    Try resetting the iPhone with it being disconnected from the computer. Hold down the sleep/wake button and home button until you receive the apple logo and then let go.
    This happened to me with photos.
    Hope this helps!!

Maybe you are looking for

  • White pages in pdf

    When i distilling from ID CS3 on Leopard 10.5.2 a document then i have white sides in my pdf and acrobat say that an graphic error ist occurred.

  • Help. New to Photoshop

    Hi, I own tanning salon in Dallas which provice spray tan, body wrap, teeth whitening and tanning products in Dallas Area. I would like to create advertising material using photoshop myself. Can anyone please guide me to right dirction about lessons

  • How can I work with LoaderInfo.content while loading?

    I'm trying to implement the display of a loading swf into a papervision scene, as outlined by Paul Spitzer in his devnet about video in papervision. This requires updating a bitmapdata object to reflect the playhead position of the swf being loaded.

  • What does "Owners Enabled" mean in Disk Utility

    Hi - Not an emergency - I'm not having any issues at this time - but a matter of curiosity. I have 5 Firewire drives hooked into my G5 and only the main HD and the Time Machine drive say "Yes" next to "Owners Enabled" in Disk Util. The other external

  • BusinessObjects Enterprise SDK登录CMC出错

    BusinessObjects Enterprise SDK登录CMC出错:All the servers with APS 10.16.11.83, cluster  and kind aps are down 请问是什么原因?