How to convert div to JSF tag ?

Hi guys,
I got a problem on using the following code:
                                   <c:if test="${requestScope.error == 'errLogin'}">
                              <div class="error">
                              <h:graphicImage styleClass="imageStyle" value="/images/iconWarning.gif"/>
                         <h:messages styleClass="errorMessage" globalOnly="true"/>
                    </div>
                    </c:if>
to be display correctly with the whole page. I really don't know how to descripe the weird result. Anyway, anyone know how to put the above <div> into JSF tag type?
I put the above code within <h:form id="loginForm">.... </h:form> is there a problem?
Thanks !
regards,
kmthien
regards,
Mark

Hi,
I had a requirement to use the Div in my code and here is the sample of the code and it is working fine.
and I am using WASD 5.1.2.
<h:panelGrid columns="1" border="1" styleClass="scrollPane">
               <h:panelGroup>
                              <f:verbatim>
                                   <DIV STYLE="overflow: auto; height: 100px; width: 400px">
                              </f:verbatim>
                              <h:selectManyCheckbox id="userRoles" layout="pageDirection"
                                   valueChangeListener="#{pc_UserPage.handleUserRolesValueChange}"
                                   value="#{pc_UserPage.searchBean.userRoles}">
                                   <f:selectItems value="#{pc_UserPage.dataTable.userRoles}" />
                              </h:selectManyCheckbox>
                              <f:verbatim>
                                   </DIV>
                              </f:verbatim>
                         </h:panelGroup>
</h:panelGrid>

Similar Messages

  • How to lookup what datatype JSF tag component requires?

    Kinda beginner question following on my part and not sure I'm asking this in the correct web-page speak?
    I just happen to know if I have a tag such as <af:tree>, I know its value attribute requires an instance of oracle.adf.view.faces.model.TreeModel at runtime.
    However how do I determine specifically the datatype that the tag-attribute requires at design time? For the majority of tags in JSF/ADF Faces this will be strings, but for tricky tags like <af:tree> how can I work this out?
    The tag doco doesn't mention this. Do I need to go to the tag libraries? How would I do this in JDeveloper? Does JDeveloper provide any other help on looking this up?
    Any help appreciated.
    Regards,
    CM.

    The tagdoc for tree at
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/tree.html
    says about the value attribute:
    "the hierarchy of tree data - must be of type oracle.adf.view.faces.model.TreeModel"
    As to how I found that? Google. I find ADF documentation very hard to find any other way and often end up googling things like:
    adf af:tree value site:oracle.com
    Not exactly what you were looking for, I know, but hope it is of some help.

  • Converter for converting all HTML tags to JSF tags

    hai all,
    i am new to JSF. i need a suggestions to convert all my HTML pages to JSF pages bcoz i was already created more pages in HTML and now i want to convert all the pages to JSF. can u give any suggestion plz post it here or send me a mail to [email protected]
    thanks in advance,
    regards,
    V.Sabarish

    hi roman,
    thanks for ur reply. it converts the file but the links r not converting....so can u suggest me another way for converting a HTML tags to JSF tags.

  • How to create a new custom tag in JSF 1.2

    Hi there,
    In JSF 1.2, all the classes (CommandButtonTag, CommandLinkTag, DataTableTag,...) in package com.sun.faces.taglib.html_basic are defined as final class. In JSF 1.1, we can create a custom tag that extends the tag in JSF taglib; it save us lots of time.
    Could anybody know how to create a new custom tag in JSF 1.2?
    Many thanks,
    Emily

    If I recall, it was done because how tags were to be handled in 1.2 was very different from 1.1 and it was felt that developers shouldn't rely on implementation specific classes (unless they were SPI) for several other reasons (application portability being the big one here).
    If it's felt that this was the wrong decision, please feel free to log an issue [1] against the RI (to date, no one has).
    As to the 'borked' dependency URLs, please log an issue [1] if you find these. We have nightly builds going that work from a clean workspace and checking today's result, it seems ok.
    [1] https://javaserverfaces.dev.java.net/issues

  • Jsf 1s phase of life cycle how knows ths components of the jsp with jsf tag

    i wish to know how faces servlet knows the jsp s view components while creaTI NG component tree at first request to input jsp which may have jsf tags.in the first phase faces servlet doesnot know input jsp with jsf tags what componnets it has. it is actually atthe response send or forward time which is the final phase when the tag ge executed and output is sent to client.i did understandin jsf life cycle in 1 st phase component tree is created at first request in 1 st phase .

    Hi,
    though a FacesContext holds the values used by a request, it doesn't mean it lives for as long as the request. The best explanation I found is from the JavaDocs
    release
    public abstract void release()
    +Release any resources associated with this FacesContext instance. Faces implementations may choose to pool instances in the associated FacesContextFactory to avoid repeated object creation and garbage collection. After release() is called on a FacesContext instance (until the FacesContext instance has been recycled by the implementation for re-use), calling any other methods will cause an IllegalStateException to be thrown.+
    The implementation must call setCurrentInstance(javax.faces.context.FacesContext) passing null to remove the association between this thread and this dead FacesContext instance.
    Throws:
    java.lang.IllegalStateException - if this method is called after this instance has been released
    Frank

  • Error Accessing JSF Tags in html div

    Hi,
    I am getting an error when trying to access <h:outputTest from within div. I am trying to embed a style sheet dynamically into the div.
    Following is my code:
    <div class="headerSDPLogo <h:outputText value='#{nlsSupport.align_logo}'/> ">The JSF tag isnt parsed at all. Accessing <h:outputText returns me this error.
    com.sun.facelets.FaceletException:
    Error Traced[line: 13] The value of attribute "class" associated with an element type "div" must not contain the '<' character.What could be the possible turnaround to this.
    Thanks.

    Mujju101 wrote:
    <div class="headerSDPLogo <h:outputText value='#{nlsSupport.align_logo}'/> ">What could be the possible turnaround to this.This perhaps?
    <div class="headerSDPLogo #{nlsSupport.align_logo}">

  • How to add raw HTML tags inside JSF tags...

    Hi
    I would like to use <input type = text > inside my project in some area..The following code hides the input = type html tag and forwards the click event to jsf command button...After selecting the file,it should forward the value to jsf textfield....
    My code seems as below.
    <h:form id="detailForm" onsubmit="printElements(detailForm,this)">
    <f:verbatim>
    <input id="uploadFile" type="file" style ="dispaly:none"size="100" />
    </f:verbatim>
    <h:inputText id="docName" style="width:650px;" maxlength="100"/>
    <h:commandButton id="visibleBrowseButton" value="Select File..." onclick="'detailForm:uploadFile'.click();callClick();">
    </h:commandButton>
    </h:form>
    <script type="text/Javascript">
    function callClick()
    var val = document.detailForm.uploadFile.value;
    document.getElementById('detailForm:docName').value = val;
    </script>
    While running this page it works fine in IE but in Mozilla firefox it troubles me during detailForm:uploadFile'.click().
    I suspect the jsf page cannot able to detect the raw html tag inside jsf tags...Eventhough i tried using inside<f:verbatim> it wont works..
    I would like to know
    1.Whether the code is right,,if the code goes wrong why it got runned in IE not in firefox....
    2.How can raw html tags can be integrated inside JSF tags....

    First of all, why are you ignoring valuable answers about a JSF fileupload component in your previous topic?
    Second, you can just nest raw HTML anywhere in your JSF page. Your problem is rather related to JavaScript. It has completely nothing to do with Java nor JSF. Learn JavaScript -there is a nice tut at w3schools.com- and look for a JavaScript forum if you still stucks. There are ones at webdeveloper.com and dynamicdrive.com.
    The f:verbatim is only required if you was using JSF 1.1 or older, which is not the case. You would have occurred completely different problems.

  • How to add fragment in jsf page using include tag in jdeveloper

    Hi all
    Can you tell me wat is syntax of using include tag .or how to add fragment in jsf page ..
    Edited by: 947228 on Jul 18, 2012 5:01 AM

    Hi,
    Why do you want to do that?
    Check [url https://blogs.oracle.com/jheadstart/entry/avoid_use_of_jspinclude_where]this out before proceeding further.
    Btw, always mention your JDev version, clear usecase to get help.
    -Arun

  • How we can use jsf tags in included jsp enclosed in subview tags

    Hello everybody,
    I am developing web app by using jsf. I am including a jsp page "header.jsp" into another jsp page "main.jsp". The header.jsp page is enclosed in jsf subview tag on main.jsp page. The header.jsp contains some static html code and some jsf tags like "outputText". When i added tag library url in header.jsp then my app was not even not initiating and i was getting following exception
    ERROR [UIComponentTag] Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml.
    16:22:16,890 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    java.lang.NullPointerException
    at javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:929)
    at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:310)
    ....Now i removed jsf tag library url from included jsp "header.jsp" so now my app is running but only static html data is being displayed but the value in the jsf tag "outputText" is not being printed in the browser
    kindly help me. i would be very thankful....

    Your question has nothing to do with Sun Java System Directory Server.
    Please use the right forum(s).
    Thanks

  • How to run generated JSF tags ?

    I am beginner in JSF. I would like execute JSF tags generated dynamically by XSLT, but in the JSP page,
    these tags are not interpreted. Does anyone has the solution ? Thanks a lot.
    Example below is only a simple test,
    ResearchBean.java :
    public String researchAction() {
        // Actually, htmlResponse is the output string after the XSLT transformation, and it contains JSF tags
        htmlResponse = "<h:outputText value=\"Text\"/>";
        return "response";
    }response.xhtml :
    <f:view xmlns:f="http://java.sun.com/jsf/core
    xmlns:h="http://java.sun.com/jsf/html
    <html>
    #{researchBean.htmlResponse}
    </html>
    </f:view>In the page received by the browser, <h:outputText value="Text"/> isn't replaced by the html code.
    Edited by: wondergarance on Jul 2, 2009 1:24 PM

    The JSF tags are apparently generated after the FacesServlet has done its work. You in fact need to pass the generated output through the FacesServlet again. If you're using a servlet/filter to run XSLT, you need to run it before the FacesServlet kicks in. You can control the servlet/filter invocation order in the web.xml.

  • How do i get all the tags i see in the iTunes library to be the ID3 tags?

    I have a huge collection of mp3 in iTunes (the latest version), and they are all perfectly organized, but when i open those mp3 files in any other player i see old tags or no tags, because the id3 tags on the mp3 files are not the same as the ones i see on itunes. I've tried the "convert id3 tags" tool but it does not seem to help. How do i get the id3 tags to be the same as iTunes tags?

    +HEy any reason why you pick version 2.3,+
    itunes didn't work well with 3rd-party plugins and v2.4, and former forum regular Otto told me to use v2.3
    +what is the difference between the different id3 tag versions..+
    read up on it using google

  • How to convert a PDF file into a full editable WORD file?

    Hi,
    I tried to convert a pdf file into word but it is not fully editable. I can edit the title from the main page and that's it. The rest of the word document is saved as image. I tried editing teh pdf file but that one is not working either.
    Please help on how to convert a PDF file into a full editable WORD file.
    Thank you

    Not all PDF files are created equal.  When a PDF file is created with Adobe Tools it is usually "tagged" with information about the fonts the images, the layout etc...    This way when the PDF is saved to a new format like PPT or DOC then the results are usually usable.  However, if you have a PDF file that was not tagged for some reason then run the Accessibility tools on the PDF to acquire some basic tagging.  This may get you a better result.  Also if you have a PDF that is an image, then you may want to run OCR on it.

  • JSF tags are not rendered in error page

    I have configured error page for HTTP 404 error in web.xml like this
    <error-page>
    <error-code>404</error-code>
    <location>/Common/error.jspx</location>
    </error-page>
    Faces Servlet is configured as follows
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    My error page (error.jspx) looks like this
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html" xmlns:trh="http://myfaces.apache.org/trinidad/html"
    xmlns:tr="http://myfaces.apache.org/trinidad" xmlns:c="http://java.sun.com/jsp/jstl/core">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <html>
    <head>
    <title>Error Page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    </head>
    <body id="b1">
    <h4 style="color:red">An Error Occured. Please click Back button or Signout.</h4>
    <input type="button" value="Back" onclick="history.back()"/>
    <tr:commandButton id="cb1" text="SIGN OUT" action="exit" actionListener="#{Login.LogOut}"/>
    </body>
    </html>
    </jsp:root>
    When I deploy application and run into 404 error, page displays error message with only Back button. I don't see SingOut button. I have checked url and it follows /faces/* pattern. Still to double check, I made a change and configured servlet mapping in web.xml as
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    <url-pattern>*.jspx</url-pattern>
    </servlet-mapping>
    Still commandButton is not rendered. I understand that my error page don't have access to FacesContext or not going through Faces Servlet. I know this is a small issue, but couldn't figure out what can be done. I have also tried using .xhtml and .jsf as per googled suggestion. But no luck
    I have tried different solutions to my problem and googled for solutions. But I couldn't get it resolved.
    So can you please provide any suggestions...
    Edited by: user1818355 on May 22, 2013 2:29 PM

    I think my faces servlet is configured to handle URLs having /faces/* pattern. I don't have any folder named with faces but I can access all my web pages which have /faces/ in their url. All jspx pages in application are configured in task flows. So I think they have access in FacesContext. But error page is configured in only web.xml and some how it is missing access to FacesContext and not rendering JSF tags. Any help?

  • Replace JSF tag by an own tag

    Hi,
    I'm trying to replace a <h:inputText> by my own tag. The used HtmlInputText component should not be replaced.
    The reason is, that i want to pass permissions to the tag and map them to readonly and rendered attributes. My Problem is, that my own tag doesn't reolv bean values. If i use the <h:inputText> the bean values show up correctly. If i use my own tag, the input text shows "#{myBean.value}".
    What could be the problem?
    Thx in advance
    Henrik
    Here is my tag:
    import javax.faces.component.UIComponent;
    import javax.faces.component.html.HtmlInputText;
    import javax.faces.context.FacesContext;
    import javax.faces.webapp.UIComponentTag;
    import com.arvato.jsf.security.JSFSecurity;
    import com.arvato.jsf.security.Permissions;
    import com.sun.faces.taglib.html_basic.InputTextTag;
    public class ArvatoTextFieldTag extends InputTextTag {
        private String role;
        private String onkeypress;
        private String id;
        private String value;
        public String getRole() {
            return role;
        public void setRole(String permissions) {
            this.role = permissions;
        protected void setProperties(UIComponent component) {
            super.setProperties(component);
            if(id != null) {
                component.getAttributes().put("id", id);
            if(onkeypress != null) {
                component.getAttributes().put("onkeypress", onkeypress);
            if(value != null) {
                component.getAttributes().put("value", value);
            if(role != null) {
                FacesContext facesContext = FacesContext.getCurrentInstance();
                Permissions p = JSFSecurity.getInstance().getPermissionsForRole(role, facesContext);
                if(!p.isWritable()) {
                    component.getAttributes().put("readonly", true);
                if(!p.isReadable()) {
                    component.getAttributes().put("rendered", false);
            } else {
                component.getAttributes().put("readonly", false);
                component.getAttributes().put("rendered", true);
        @Override
        public String getComponentType() {
            return "javax.faces.HtmlInputText";
        @Override
        public String getRendererType() {
            return null; // no standalone renderer
        @Override
        public void release() {
            super.release();
            role = null;
        public String getValue() {
            return value;
        public void setValue(String value) {
            this.value = value;
        public String getOnkeypress() {
            return onkeypress;
        public void setOnkeypress(String onkeypress) {
            this.onkeypress = onkeypress;
        public String getId() {
            return id;
        public void setId(String id) {
            this.id = id;
    }and my tld definition:
    <taglib>
       <tlib-version>0.03</tlib-version>
       <jsp-version>1.2</jsp-version>
       <short-name>arvato-jsf</short-name>
       <uri>http://arvato.com/jsf/component/tags</uri>
       <description>Arvato JSF tags</description>
       <tag>
          <name>textfield</name>
          <tag-class>com.arvato.jsf.tag.ArvatoTextFieldTag</tag-class>
          <attribute>
             <name>id</name>
          </attribute>
          <attribute>
             <name>role</name>
          </attribute>
          <attribute>
             <name>value</name>
          </attribute>
          <attribute>
             <name>onkeypress</name>
          </attribute>
       </tag>
    </taglib>

    In the setProperties method, you've got to resolve the valuebinding (#{blah.whatever}) to get the actual value. But you only want to do that if the attribute is set to a valuebinding.
    Here's an example:
          * @see javax.faces.webapp.UIComponentTag#setProperties(UIComponent)
         protected void setProperties(UIComponent component) {
              super.setProperties(component);
              //Set the field reference property
              if (fieldRef != null) {
                   if (UIComponentTag.isValueReference(fieldRef)) {
                        ValueBinding vb = getFacesContext().getApplication().
                             createValueBinding(fieldRef);
                        component.setValueBinding("fieldRef", vb);
                   } else {
                        component.getAttributes().put("fieldRef", fieldRef);
         }This example shows how to determine if the "fieldRef" attribute is a value binding, and extracts the value accordingly. But there's one more step. In your component class, or anywhere you access the attributes of your custom tag, use the following code:
         public String getFieldRef() {
              if (fieldRef != null)
                   return fieldRef;
              ValueBinding vb = getValueBinding("fieldRef");
              if (vb != null)
                   return (String)vb.getValue(getFacesContext());
              else
                   return null;
         }The above snippet is what you would put in your custom component getter method.
    JSF is open source. Something I found very helpful while learning how to create custom components was looking at how the JSF developers created theirs. You should go ahead and download the JSF source code.
    CowKing

  • What does the scriptcollector do and how does it related to jsf lifecycle?

    hi,
    i want to know what does the scriptcollector do and how does it related to jsf lifecycle? and also in the scriptcollector if i call this,
    preRender=#{myBean.onPageLoadBegin}
    postRender=#{myBean.onPageLoadEnd}
    how my page will react?

    The hx:scriptCollector is part of the IBM Faces Client Framework and has nothing to do with Sun JSF RI.
    Lot of the hx components require specific Javascript and those hx components should be placed inside a single hx:scriptCollector which on its turn checks the nested hx components and renders the desired Javascript for it at the end of the tag. Check the HTML source for that Javascript.

Maybe you are looking for

  • My ipod touch is stuck on recharge mode even when it isn't connected to the computer???

    Right now my Ipod touch is in the charging / recharge screen and it won't leave that screen even when I unplug it. And it don't seem to be charging the red part on the battery indicator is flashing red and not moving into the green at all I have trie

  • Sending Command Window Output to File

    Okay, I'm guessing the "New to Java" is where I need to be for this kind of new programmer question. I'm working on a program for an assignment and I've completed the entire program and going back over the assignment I've realized that my quick readi

  • Memory flush for a DOMTree?

    hi everybody out there! Does anybody know, whether there is a possibility do delete a DOMTree, which is not needed anymore after a certain time, out of the memory? Do i just have to kill the RootElement or does Java provide any other functionality? T

  • Production order changes through sales order

    Mine is a MTO business process. I am using strategy 50. when ever I create a production order from the planned order its getting attached to the sales order which is  expected and obivous. when ever the sales order gets rescheduled its also re schedu

  • Why can,t i sign up for a new you tube account

    I'am having trouble trying to set a account on my new imac. I go the you tube web site there no option to sign up