ADF Faces < IF > statement available on the page?

I do a page using ADF Faces.

I want to create an IF statement in a page that will display a markup on one condition and another display, some other tags.

For example, I use an iterator to generate a table. I would like to have the background color of the alternative line based on the iterator No. 2 (also how can I get the count of the iterator).

Also, I don't want to make the highlight of text color based on some such condition as is foo == bar make the text red etc.

Someone knows how to do this simple task in ADF Faces?



* Note that the basic JSF fi is not available in Jdeveloper for some reason any. Any help would be appreciated.

In addition, I don't want to just set a property of an element based on a State with EL.

Lets say there is a part of the page I want to only show is a condition is true. Is it impossible in ADF Faces? Is there something fundamental that miss me on this frame?

Published by: user2809800 on December 6, 2010 12:49

Made conditional group of fragments, you can use the component switcher.

See the example for switch here: http://jdevadf.oracle.com/adf-richclient-demo/faces/components/switcher.jspx

Code:







To change the color of the text according to the requirement, you can use the EL expression in InlineStyle (it's a simple case) otherwise, you can use the count to change the same.

Sample:


inlineStyle = ' #{bindings. " FirstName.inputValue == 'Steven '? "{" color: red ": null}" / >

Thank you
Nini

Tags: Java

Similar Questions

  • Local service of custom data not available in the page template

    Hi guys,.

    I created a custom service that is return of Image in response as shown below:
    public void GetImage
    Producer = config.getProducerImpl () (producer);
    String capText = producer.createText ();
    m_binder.putLocal ("capText", capText);
    BufferedImage bi producer = .createImage (capText);
    m_binder.setContentType("image/JPEG");
    m_binder.m_contentType = "image/JPEG";
    AA ByteArrayOutputStream = new ByteArrayOutputStream();
    Wrapper DataStreamWrapper = new DataStreamWrapper();
    Wrapper.m_dataType = "image/JPEG";
    Wrapper.m_clientFileName = "image.jpg";
    ImageIO.write (bi, "jpg", aa);
    wrapper.initWithInputStream (new ByteArrayInputStream (aa.toByteArray ()), aa.toByteArray () .length);
    This.m_httpImplementor.sendStreamResponse (m_binder, wrapper);
    }

    I call this service into the page as a template below:

    & lt; img src = "http://localhost/ucm/idcplg?IdcService=getJcaptchaService" / & gt;

    & lt; input type = "text" name = "capText" value = "<!-$capText - > ' / & gt;"


    <!-$capText-> capText value is empty here. It is not available here.

    Please suggest how capText value may be available in the page template.

    Thank you

    Your custom class must extend a class of Service. Then use this line of code to access the value of the variable capText:

    String lCapText = this.m_binder.get ("capText");

    Let me know if it works!

  • [Table ADF Faces component] How to save the current state?

    Hello

    the ADF faces table component is great!
    You can drag-and - drop columns, sort columns...

    Now, we have an obligation to save the State of the table for subsequent sessions.
    The return of the user wants to get the same State as last time (order requirement or sort of column), even if he comes back a few days later.
    Is this possible?

    I discovered, that this information is stored in the session cookie. But this cookie is discarded in a few minutes...

    Any tips?

    fschulze,

    If you use 11 GR 1 material - you can read about MDS in chapters 33 and 34 of the Fusion for the ADF Developer's Guide - it does exactly what you ask... an update, don't know if it will save the sort order, but the documentation specifically mentions column reorganization as being recorded.

    John

  • An attempt was made to update me with firefox 15.0b6 two days ago but it's still not available on the page of version beta of firefox. Why?

    Is firefox beta 15.0b6 a true liberation? After 2 days, I still haven't seen on the page of beta version of firefox, so I don't let the update happens.

    It is a real update. I don't know why it is not available on the beta page, but the latest beta is beta 6.

  • Declarative component are not available in the page fragment

    Hello

    I created the declarative component... But it can only access *.jsf page not page fragment...

    Hello

    Had in fact I created declarative component by using the page faclet (*.jsf)...  If I create DC using .jspx page... It's work

    Thank you

    Nitesh

  • Not available in the Page properties of fonts pulldown

    When I create a new html document, and then click Modify > Page Properties is not the drop fonts.

    I don't know what preferences I changed and does not know how to get it back. I noticed that when I change now, background color and margins that they appear in the body instead of css tag also which is weird.

    DAN

    I'm guessing that you do not have "Use CSS instead of HTML tags" selected in the General preferences.

  • How to change the ADF Faces component visibility in changing the comboBox value?

    Hi all
    I want to change visibility panelGoupLayout true false when I choose a comboBox value, I can do this by using a commandButton control, but my question is how to change using the comboBox to the bean to support value, can anyone help me? Besides my English is not enough, I hope that I could say to my problem.
    Thank you.
    Ali

    Published by: user12246056 on November 23, 2009 09:01

    Hello

    You must add the id of the selectOneChoice as partialTriggers to the panelGroupLayout - check my example above.

    partialTriggers="soc1"
    

    Also, you seem to keep the selectOneChoice inside the panelGroupLayout (who you want to fake visible). So, once you make the invisible panelGroupLayout, the selectOneChoice (which is inside your panelGroupLayout) will become also invisible. Cordially (put out the panelgrouplayout if she not how you wanted it to be).

    Arun-

  • JDeveloper 10.1.3 ADF Faces &amp; BC: how to get the hostname of h

    Hi all

    How can I get the hostname of the server that your application is deployed via the request form?

    I know that on a javax.servlet.ServletRequest class, the method is called getLocalName(). Is there a way to access this information in the am?

    Thank you
    Wes

    Wes,

    Something like that?

    try {
            InetAddress addr = InetAddress.getLocalHost();
    
            // Get IP Address
            byte[] ipAddr = addr.getAddress();
    
            // Get hostname
            String hostname = addr.getHostName();
        } catch (UnknownHostException e) {
        }
    

    John

  • Refer to the ADF faces RC component of programming client-side

    Hello
    One tried to access component customer adf in a taskflow-ADF using javaScript with its id
    I have an ADF taksflow including a pagefragment. The taskflow is encapsulated by a region r1 in a jspx page.
    I'm trying to access the component of

    document.getElementById("r1:componentName"); or
    AdfPage.Page.findComponent ("r1:componentName");
    AdfPage.Page.findComponent("::componentName");

    None works. The only way that works is to use
    var firingComp = event.getSource ();
    ...
    firingComp.findComponent ("componentName");

    However, as I call the function javascript from an Applet, I get entry to the event of shooting. So if I have to do it this way, I need to define a global varibale, assign him when another JS function called during an event of the ADF is triggered (for example, adf button click...)
    Then use this variable in the JS function called from cmdlet to locate the required component. It is quiet that annoying the user needs to interact with the adf page before that.
    Any suggestion?

    Hello

    ADF faces has an API on the client side. Please take a look at

    http://download.Oracle.com/docs/CD/E15523_01/Web.1111/b31973/af_event.htm#BABIDEGA
    http://download.Oracle.com/docs/CD/E14571_01/apirefs.1111/e12046/TOC.htm

    The starting point for a search is AdfPage.PAGE.findComponentByAbsoluteId (namingcontainer_id:component_id);

    Frank

  • Error in the page when the ADF security enabled

    Hello

    I created an example page JSF with only a text to output "Hello World!"

    When I run the page without activating the safety of the ADF, it works fine.

    I activated the ADF security according to the "Enabling Oracle ADF security 29.3" in Guide of Dev for the ADF.
    Now when I run the page, it shows the default login page. I enter username and password and 'send '.

    After that, it shows an error with the following error page:
    --------------------------------------------------------------------------
    Error 500 - Internal server error
    java.lang.RuntimeException: cannot find FacesContext
    at javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1855)
    at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1672)
    at jsp_servlet.__testpage1_jspx._jspService(__testpage1_jspx.java:85)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3588)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    ------------------------------------------------------------------------------------------------------

    Any suggestion/help in this regard is appreciated.
    Thank you

    Hi vbokar! ;)

    I check your application and I noticed that the political ADF seems be grayed in JDev so I re - run the Configuration Wizard for the ADF security.
    Other changes were:

  • user "vbokar" was added to the application role 'testRole1 '.
    <>changed the password of the user vbokar for "password1" (so I can test it)
  • changed the home page or from the success_url of ' / TestPage2.jspx ' to ' / faces/TesPage2.jspx.

    Run and Viola! It works!
    Here is the updated file...
    https://docs.Google.com/leaf?ID=0b-coz_ZFqg5XMmQyNGZiNTAtY2YwZC00YWMwLWIxNWItM2ExZWVlOTFjN2Ri&hl=en

    Kind regards

    Pino

    PS. as I also proposed Vikram wire, please build > CleanAll your app. Or better yet, remove it and load the one you sent me.

  • PHP pages: output error check available and continues to save the page

    Hello

    I noticed that the error output check (green or red) in the Dreamweaver footer bar (on the left of "glimpses of the unit", "browser preview" and icons 'size of windows') is not available in the pages with the .php extension, .html to.

    In addition, Dreamweaver ask me to save the page whenever I change something.

    For example, if I use 'commands-> format source' in a .php page, Dremweaver ask me each time to save it to complete this command.

    Is this a normal behavior?

    I use the latest version, CC 2015 (7714 build), OS X Yosemite.

    Thank you

    Michele

    No, this isn't a bug, it's how DW. DW needs to have the file saved to be able to produce live view, and Yes, it sucks that the characteristics of the Live view mode are lost when in Design mode.

    Live view is still in its infancy since Adobe has begun to put the elements in Live view mode. If all goes well, they will see a way to overcome the ongoing pop-up from happening.

    Regarding the PHP support, this has always been a minimum feature. If you want a good PHP editor, then there are a lot of options such as

    IDE PHP that goes beyond the language: JetBrains PhpStorm

  • Can't access: REQUEST in the page before the process of the header

    4.2.1

    THM: 2

    Hello world

    I have a button on a page with all pages to submit and demand set to "RESET". I want access to this: ASK the sur-avant charge that the process the header, but cannot. In fact, when I click the button, it submits the page. and on the load, I should see the: ASK as "RESET", but it seems to be empty.

    I do wrong?

    Thank you

    Ryan

    ryansun wrote:

    I have a button on a page with all pages to submit and demand set to "RESET". I want access to this: ASK the sur-avant charge that the process the header, but cannot. In fact, when I click the button, it submits the page. and on the load, I should see the: ASK as "RESET", but it seems to be empty.

    By default, the value of the CLAIM is reset before show page processing begins. To apply a value available in the page see the transformation, it must be defined in the URL of the page when a request or redirect or specified in the property of the request of an industry. In both cases, the current value of the APPLICATION can be stored by reference using the substitution of static text ( &REQUEST. ), or the value of an element of a page or application session state provided using static text substitution ( &P101_FOO. )

    In this case, you will need to create a branch and make it conditional on the submit button.

  • Combination of ADF Faces and JSTL is advisable or trap?

    Dear all,

    Our applications(ADF/Webcenter) of fusion using JSTL and ADF Faces inside is advisable or pitfall. ADF Faces features are enough or do we need to rely on the JSTL functions? I prefer to use ADF Faces/JSF functions without the combination with others.

    for example 1


    < 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:af = "http://xmlns.oracle.com/adf/faces/rich".
    xmlns:fn = "http://java.sun.com/jsp/jstl/functions" >

    for example 2

    < jsp:root xmlns:jsp = "http://java.sun.com/JSP/Page" version = "2.1".
    xmlns:af = "http://xmlns.oracle.com/adf/faces/rich".
    xmlns:f = "http://java.sun.com/jsf/core".
    xmlns:h = "http://java.sun.com/jsf/html".
    xmlns = "http://java.sun.com/jsp/jstl/core" >


    Best regards
    KT

    Hello

    Our applications(ADF/Webcenter) of fusion using JSTL and ADF Faces inside is advisable or pitfal?

    To suggest a rule: feature edge try ADF Faces before reaching out to the JSTL. The difference between JSTL and JSF in general, is that the JSTL expressions are evaluated in compiling page while JSF expressions are evaluated deferred. This difference can have an impact on the PPR updates and data rendering (which, in many cases I guess you can fix by defining the ADF Faces, content delivery component immediate instead of deferred). On a light background, I scored with a JSTL alert 'heads up' for this reason

    Frank

  • Mix ADF Faces with HTML, JavaScript, CSS, JSTL question

    Dear all,

    The project is now starting to deploy to the production server. When we try to deploy to the production server who made a lot of mistake. As this used widely used project mix ADF faces with
    HTML/JavaScript/CSS/JSTL. I would like to know what are the most error when we have mixed to use each one and how can we overcome them there?
    There is in the project

    1 mix of tags html with ADF Faces components
    2. the use of JavaScript/CSS inline
    3. mix the JSF/ADF Faces and JSTL tags

    Help me how to address this issues as well as links to useful blog.

    JDeveloper IDE version: 11.1.1.5.0 with Webcenter
    WebLogic version: 10.3



    Best regards
    KT

    Published by: KT on May 16, 2013 21:23

    Hello

    In addition to this project widely used mixture ADF faces with HTML, JavaScript, CSS, JSTL.

    JavaScript, CSS, and JSTL is not a problem, whereas - according to the JSF version - HTML is. JSF 2 is the first version of the JSF, which allows you to mix HTML with less side effects, if you use Facelets as view declaration language.

    I would like to know what are the most error when we have mixed to use each one and how can we overcome them there?

    There is in the project

    + 1. mixture of html with ADF Faces components tags +.

    This could ruin your pages, lead to update issues and - in case of frequent use in the trees - even destroy the functionality

    + 2. online use of JavaScript / CSS +.

    Poor performance because of heavy weight pages. If you were using ADF Faces and your JS addresses the DOM instead of the architecture of client cJavaScript ADF Faces then chances are JS will fail for the components that have changed their HTML output (which has an impact on the DOM structure) or changes are not submitted to the server.

    For CSS, CSS inlineStyle not applay to the DOM element that is external, which means for example af:input the background text color will color the lavel

    + 3. mix JSTL and JSF/ADF Faces tags +.

    Dependa on how you do. JSF has postponed EL syntax, which means that EL resolves at run time, whereas JSTL resolves at compile time. So the race conditions could become a problem

    Overall, it is difficult to say if things were coded wrong in the project (although for the use of HTML you can be sure) without seeing the code. It seems that the team that built the application however did not dare to the suite of recommended practices

    Frank

  • ADF Faces: refreshment at one point

    Hello

    (using JDeveloper 11.1.1.3.0 and ADF Faces and perhaps elsewhere in the ADF)

    -(q1) how can I refresh (part of) a page at a specific moment in time on the server (without user interaction)?

    It seems to be possible using the vote (with the af:poll component), but since it is based on the interval it seems less appropriate refresh at a specific point in time on the server.

    Also, using a component of af: activeOutputText that something seems possible to display the current time on the server (automatically changing) without user intervention.

    See the sample application
    at http://www.consideringred.com/files/oracle/2010/PointInTimeRefreshApp-v0.01.zip
    and the screencast
    at http://screencast.com/t/ZTE0MGY3Mzkt

    I was wondering if a response to (q1) might be somewhere in a kind of combination between the component af:activeOutputText and the af:poll component.
    But any suggestions for answer (q1) are welcome.

    Thank you very much
    Jan Vervecken

    I think that you have the code that calculates how much time left between now and the time you want to do a refresh.
    Then set this interval as interval for the component af:poll - in the event of expiry of survey, you can disable or set another interval.

Maybe you are looking for

  • Loss of Wifi on all apple products

    Hello I have a problem that my apple products keep loses the WiFi at home, even if the signal is showing on the product. It happens randomly and is really annoying. It's 2 iphone 5 s and 4 ipads. I can be on the internet and suddenly it says that the

  • Questions write equations to existing variables in Hp 50 g

    Hello I'm studying for the exams in June and I'm writing long equations in my HP (algebraic, std, degrees, rectangular), but whenever I try to write a new one, if there is a variable with the same name, it displays its value, not the name I typed. I

  • LabVIEW 64 or 32-bit labview?

    Hello, I have a new 6-bit pc and an old 32-bit pc, and I have to use two of them. If I install on the 64-bit 64-bit machine labview, when I save a vi, it can be opened on the 32-bit computer? With this kind of problem, do you suggest me to install la

  • pavalion g6: sound

    I have a 3-4 years old pavalion g6 laptop.its speakers are not working.from a year it lost its sound force slowly and slowly.now sound does not come from the speakers.

  • I m get problem when running IE, Chrome or firefox

    Signature of the problem: Problem event name: APPCRASH Application name: rundll32.exe Application version: 6.0.6000.16386 Application timestamp: 4549b0e1 Fault Module name: sprote ~ 1.dll Fault Module Version: 0.0.0.0 Timestamp of Module error: 50212