ADF Faces  IF statement available within the  page?

I am making a page using ADF Faces.
I want to create an IF statement in a page that will display some markup on one condition and on another display some other markup.
For example, I am using an iterator to build a table. I would like to have the background color of the row alternate based on the iterator count % 2 ( also how can I get the count of the iterator).
Also, I would want to make the text color highlight based on some condition such as is foo==bar make the text red etc.
Anyone know how to do this simple simple task in ADF Faces?
**Note the if from JSF core is not available in Jdeveloper for whatever reason. Any help would be appreciated.
Also, I don't want to just set some property of some element based on a condition with EL.
Lets say there is a whole section of the page that I only want to show is a condition is true. Is this impossible in ADF Faces? Is there something fundamental I am missing about this framework?
Edited by: user2809800 on Dec 6, 2010 12:49 PM

For conditional rendering of group of fragments, you can use switcher component.
See the sample for switcher here: http://jdevadf.oracle.com/adf-richclient-demo/faces/components/switcher.jspx
Code:
<af:switcher id="s1" defaultFacet="#{<CONDITION> == 'true' ? 'two' : 'three'}">
<f:facet name="two">
<af:outputText id="ot2" value="Two"/>
</f:facet>
<f:facet name="three">
<af:outputText id="ot3" value="Three"/>
</f:facet>
</af:switcher>
For changing the text color based on the condition, you could use the EL expression in InlineStyle (it is a simple case) Otherwise, you can use skinning to change the same.
Sample:
<af:outputText id="ot4" value="#{bindings.FirstName.inputValue}"
inlineStyle="#{bindings.FirstName.inputValue == 'Steven' ? 'color:red' : null}"/>
Thanks,
Navaneeth

Similar Messages

  • JS to check whether a link is within the page or PB

    need JS to check whether the link object is it within the page or pasteboard.
    Thanks so much. 

    Hi Snaf,
    Try this below js code, otherwise can you post the snapshot of the problem you face.
    var myDoc = app.activeDocument;
    for (var i=0; i<myDoc.links.length; i++) {
        var myPage = myDoc.links[i];
        while (myPage){
            if (myPage instanceof Document || myPage instanceof Spread || myPage instanceof Page)
            break;
            myPage= myPage.parent;
        if(myPage.constructor.name=="Spread"){
            alert("Object in Pasteboard");
        else{
            alert("Object in Page");
    thx
    csm_phil

  • HT2534 none option is not available in the page

    none option is not available in the page. Kindly help me to review my apple id without giving credit card details. Thank you.

    Welcome to the Apple community.
    Open iTunes and navigate to the app store. Select a free app to download. A simple way to do this is to scroll down to the top free apps box on the right hand side, hover your mouse over the first item and click on the free button that appears when you hover over it.
    A pop up will open asking you to sign in with your Apple ID click "create new account", click continue to create your account. Check the box to accept the store terms and conditions and click continue.
    Enter your email address, password, security question, and date of birth, click continue. Now, you will be asked to provide a payment method. Note now that the last option says "none".

  • Setting "inside" bleed within the page size

    Hello,
    I'm using InDesign CS3 for a book layout and I'm trying to set the inside bleed so that it is 0.25" within the page size (trim size) of 8.5". I've tried putting -0.25" but it only accepts positive numbers.
    The reason I want the bleed within the trim size is so that the ink doesn't interfere with the adhesive when it's bound.
    Thanks for any help.
    Mark

    Expanding on Bob's suggestion, you could put a white rectangle on a top layer and then turn off its visibility. Then you could work away without having to worry about fitting everything to the guide, and just turn on the layer visibility when you've finished to blot out anything that spills over.
    k

  • I updated my ipad mini to iOS 6.1.2 and have not been able to update my apps in the AppStore since. It say I have updates available but the page remains blank. I have tried switching the unit off and on and to no avail. Can anyone help?

    I updated my ipad mini to iOS 6.1.2 and have not been able to udate my apps in the AppStore since. It say I have updates available but the page remains blank. I have tried switching the unit off and on and to no avail. Can anyone help?

    Try this:
    1. Close all apps in the Task Bar. Double-click the Home button and hold apps down for a second or two. Tap the minus sign to close app.
    2. Hold the Sleep and Home button down until you see the Apple Logo.

  • Is Lightroom available within the adobe cloud subscription?

    I do not see it available within the list of downloads.  I am using Windows 7.

    Yes
    http://blogs.adobe.com/creativecloud/lightroom-5-is-now-available-on-creative-cloud/
    Are you using the new Creative Cloud app (available via logging in to the Cloud)?
    If you're using the old Application Manager (AAM) it may not appear. That's what happened here. Once I installed the Cloud app, Lightroom  5 appeared.

  • Changes made to .css file in adf application, Does need to run the page again

    Hi Gurus,
    Please explain me, Changes made to .css file in running adf application, Does need to run the page or just refreshing page from browser will pickup the changes for oracle ADF 11g R2.
    Warm Regards,
    Md Jahangir Pasha

    Hi,
    you have to set CHECK_FILE_MODIFICATION parameter value to "true" on web.xml file.
    <context-param>
        <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
        <param-value>true</param-value>
      </context-param>

  • TS1702 i made an in app purchase and the purchase is listed on my billing statement but the in application purchase is not available within the app?

    i made an in app purchase and the purchase is listed on my billing summary but i cannot access the purchase within the app.  I have tried deleting the game and reloading the app and the purchase, nothing seems to work.

    I've had this with games, I had to contact support via the 'problems with this app' link on the receipt & they refunded my money.

  • Adf faces table and applet in jsf page navSubmit not working in IE

    Hi
    I have a jsf page with adf faces table and applet , previous / next navigation is not working for my table when i add the applet to the same page , it is working in firefox but not in IE .
    I have no clue what to change , can any one help. below is the sample code for my jsf page
    Best regards
    Srinivas
    Code follows, not sure how to format the code here
    <h:form>
    <af:panelPage title="Test Adf faces table and applet">
    <af:panelHeader text="Orders">
    <af:table value="#{bindings.Orders.collectionModel}" var="row"
    rows="#{bindings.Orders.rangeSize}"
    first="#{bindings.Orders.rangeStart}"
    emptyText="#{bindings.Orders.viewable ? 'No rows yet.' : 'Access Denied.'}"
    id="orders" >
    <af:column sortProperty="order"
    headerText="#{bindings.Orders.labels.order}">
    <af:commandLink text="#{row.order}"
    id="orderNumber"
    onclick="showOrder(#{row.order})"
    disabled="false"/>
    </af:column>
                   </af:table>
    </af:panelHeader>
    <af:objectSpacer width="10" height="10"/>
    <af:panelBox>
    <f:verbatim>
    <div id="appletDiv">
                        <applet here />
                        </div>
    </f:verbatim>
    </af:panelBox>
    </af:panelHorizontal>
    </af:panelPage>
    </h:form>

    Sorry about the format, it looked okay when i previewed it , now it looks like terrible

  • How To pass the value within the page using jsp?

    How to passing the textbox value within the jsp page without using javascript or reload the page.
    I have a scenario like this:
    I have a textbox named as "accno" which allow user to key in the accno. After key in the accno, this accno value will used to do a query from database using jstl.
    here is part of my code
    <input name="accno" type="text" onChange="checkLC()"/>
    <sql:query var="results" dataSource="${db}">
    select accno,name from account where accno = '<%=value get from accno textbox%>'          
    </sql:query>
    <c:out value="${result.rows[0].name}"/>
    note that onChange() is the javascript when user key in accno then automatically go to check database then only show out the name. So how can i get the '<%=value get from accno textbox%>' from accno textbox.

    How to passing the textbox value within the jsp page
    without using javascript or reload the page.No, jsp executes on the remoter server, the text box is on a client machine, you need to send information to the server over the network, http does this with a request, which will reload the page.....................

  • Producer Consumer with a state machine within the consumer

        Hi All,
    I have been trying to develop a data acquisition system with the producer consumer architecture.  To the left of the two main loops I initialize the serial port and any constants and variables im using.  I also have an obtain queue VI needed for enqueue and dequeue. Then in the producer loop i have a state machine.  The first state is where I wait for a button press on the front panel to write a GO signal on the serial line which will tell the device connected to the serial port to begin sampling data.  After this button press I go into the next state which is called my read state.
    In the read state I use a property node to read all of the available bytes at the serial port and then enqueue this collected data into a queue.  The state machine then is directed to continously go to the read state again and collect more data.
    Now this is where my dilemma is......  The consumer loop has the dequeue VI inside it and after this VI i have a state machine (while loop and case structure) which contains the following states
    1.  Build Array - build an array from the dequeue element and if there is any left over data from the parsing states it will build an array with the left over data and the dequeued data
    2.  Determine packet type - this state looks for the packet type byte(not necessarily the first byte in the message) and also check the next byte (packet length) to ensure that I am at the begininng of this chunk of data.  This state may be a little slow because there can be three different packet types and based on this byte and the packet length it may have to search the array several time to find the valid starting point.  This state also determine the next state to go to based on the packet type.
    3 packet type 1 parsing - parse data and store the remaining data it leftOver array.  Go to exit state.
    4 packet type 2 parsing - "" ""
    5 packet type 3 parsing - "" ""
    6 exit - leave this state machine and fall back to the consumer while loop.
    After it exit I think it should fall back to the consumer while loop and dequeue more data and enter the state machine again to build a new array with the dequeued data and leftover data.  It seems to work when I trace the execution using the Highlight execution feature, however when I run this all at full speed, it seems to go into the consumers 1st and 2nd states back and forth and not completely go through the state machine.
    I tried adding in a delay in the producer loop to give the consumer loop time, but I didnt notice any difference.  Is it possible that my dequeue element is retreiving more data while im still in the state machine, causing the execution to leave the state machine before it finished all states?
    Is there a better approach to take to solve this problem. Basically I need to read data at a 1,000,000 baudrate and parse it as quickly as possible so that I can break it up into 3 different packet types, write the data to a file, and graph the actual data (header info removed) in realtime.  I need to also ensure that I am not losing any of the collected data.  Data loss cannnot occur.

    A couple of things more to go along with Ben's pointers:
    You convert your data from a string, to a U8 array, to a Hex string array in the producer loop, then convert back to a integer to determine what to do with it.  In the process, you create two or three copies of your data, slowing yourself down quite a bit.  The code would be quite a bit more efficient if you left the data as a U8 array.  You can change the format of the controls and indicators to show hex values instead of integer by right clicking on them and selecting Format and Precision...
    Your search code is fairly inefficient.  I made a whack at making it a bit better.  See attachment below.
    If you continue to run into race conditions, you can debug them using a calls to the Windows debug write sprinkled liberally about your code.  Check out the post here for more information.
    Don't let your lack of format LabVIEW training stop you.  The biggest thing to get is the data flow paradigm (aka data is wires, not registers).  Once you get past that and learn how to pass data around using shift registers, queues, events, etc, you are most of the way to mastering LabVIEW.  The rest is just learning the plethora of functionality LabVIEW gives you (yes, I have reimplemented LabVIEW native code more than once in the process of learning).
    Let us know if you need more help.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    serialUtil_V3_DFG.zip ‏137 KB

  • [ADF Faces] How to open a jsf page in a new window.

    I need to open in a new window a page....
    I have used the Dialog Framework, but it does not work, because the objects is never reseteds, the frameworks was saving the states of it.....
    Then I need only to open the page in a new window, a pop up.
    The CommandButton has not the Target property :(
    thanks

    I discovered it
    private String goPohecamp() {
            FacesContext context = FacesContext.getCurrentInstance();
            // Create the dialog UIViewRoot
                ViewHandler viewHandler = context.getApplication().getViewHandler();
                UIViewRoot dialog = viewHandler.createView(context, "/access/ecamp.jsp");
                HashMap properties = new HashMap();
                //properties.put("width", new Integer(250));
                //properties.put("height", new Integer(150));
                AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
                afContext.launchDialog(dialog,
                                        null, // not launched from any component
                                        null, // no particular parameters
                                        true, //show in dialog
                                        properties);
            //return "goPohecamp";
            return null;
        }Like this is better to me

  • Can I develop an iOS app that can download multiple free iBooks that I publish and make them available within the iBooks app?

    Is it possible for a self-developed iOS app to download iBooks from our server and make the books available to the iBooks app?
    My organization is evaluating publishing some free training manuals / textbooks as iBooks made with Apple's "iBooks Author" software. We don't necessarily want to use the iTunes Store for distribution because of the semi-sensitive nature of the content. To distribute the books to users with iPads, we've thought of using MDM software, a webpage, or an iOS app. The reasoning behind an iOS app is that the app would be a "download manager", making it much easier for a user to download all 42 books all at once. A user would install our "free training manual download manager" iOS app and use it to authenticate to a our server app that would serve the books, the end result being the books available via the iBooks app.
    Thanks,
    Ted

    Hi Kappy,
    Actually Apple lets self-publishers distribute iBooks outside of the iTunes Store, as long as the iBooks are free (no cost to user).
    What I'm wondering is if it's possible for a custom iOS app to side-load iBooks so that they're available to a user within the iBooks app.
    If not, we'll either post the iBooks for download from our website or we'll use MDM software to push the iBooks to MDM-enrolled iPads.
    Ted

  • TFS 2012 - How to Import bulk of historical WI's via EXCEL, with already progressed values in State field within the excel

    A user wants to import into TFS, ~ 500 historical bugs that were created and maintained in an excel template outside TFS. While they were maintained outside TFS, the user changed among others, the value of their Status field as well, i.e. there are bugs
    in a progressed state e.g. already in status Closed.
    Since normally in TFS, one could not directly create a new bug in State = Closed, an error would be yielded when trying to import them as is into regular Team Project. Can u please advise how to easily solve this, without hindering the state diagram of the
    model in TFS, and as possible by utilizing GUI of Excel / TFS / other available tool for this purpose ?
    Kind thx,

    Hi!
    You may use excel features for this. Simply copy & paste the state column:
    Publish 500 new bugs.
    Copy & paste the state column from your source table and publish.
    But the reason for state may not be correct. So you may use the more difficult way:
    For Source table create the custom state columns (for the cmmi template states Proposed->Active->Resolved->Closed) by this rules:
    (Active state column) if (source state == "Active" || source state == "Resolved" || source state == "Closed") { value = Active } else { value = source state }
    (Resolved state column) if (source state == "Resolved" || source state == "Closed") { value = Resolved } else { value = source state }
    (Closed state column) if (source state == "Closed") { value = Closed } else { value = source state }
    Then Publish new bugs.
    Copy&paste (Active state column) values and publish.
    Copy&paste (Resolved state column) values and publish.
    Copy&paste (Closed state column) values and publish.

  • After installing 4.0 try to play games on Facebook by following another players request. The game page starts to load and then the information within the page disappears or goes white. I am still able to see facebook menu but not anything within page.

    I installed 4.0 on two computers and they both are unable to access the Facebook game page. I have another computer with 3.6 and don't have a problem with it. On Facebook players send request to join them on games. When I go to that game the page begins to load information and then it just disappears or goes white. I still have a Facebook menu on top of page.

    Because I am having issues with Norton Security Suite with the upgrade to Firefox 4.0.1, I have been dealing with that as well, with no success to-date. However, I did notice today when I was looking in my trash, an interesting thing occurred with the upgrade that MAY have something to do with the apps. in Facebook not working correctly now with Firefox.
    In my trash, there are several folders of 'Recovered Files'. Two of them are loaded with Internet Plugins for Facebook and were all dumped on May 1st, the day I upgraded to v. 4.0.1 Firefox and began having all my problems. For example, they are plugins like: plugin-cross domain.xml, plugin-gateway-1.php, plugin-102452128776.gz-72.json, just to name a few of them. Now, I am wondering if they were inadvertently removed during the upgrade process, or if they are in conflict with the new upgrade. Should I put them all back into Library -->Internet Plug-Ins to see if that resolves the problems? There are so many of them, I wish there was a way to mark them in some fashion in case I would have to remove them and not take the wrong ones out! Maybe there is a way I can color code them before I move them. I hate using 2 browsers!
    I notice that 2 other people have this problem but I don't see where they left any post. I really wish Norton, Firefox, and Facebook would get this ironed out. I never had a problem with anything until this and I don't like to spend all my time trying to troubleshoot something I don't understand! Anyway, thanks for listening.

Maybe you are looking for