Command Button - hide data

Hi All,
In my JSF application, I have two buttons BUTTON1 and BUTTON2 in same jsp page.
Onclick of BUTTON1, it will invoke METHOD1 and displays some data (let us call it as DATA1).
Onclick of BUTTON2, it will invoke METHOD2 and displays some data (let us call it as DATA2).
My concern is Onclick of *{color:#008000}BUTTON2{color}*, it has to display only *{color:#008000}DATA2{color}* and *{color:#ff0000}hide DATA1{color}*.
and OnClick of {color:#008000}*BUTTON1*{color}, it has to display only *{color:#008000}DATA1{color}* and *{color:#ff0000}hide DATA2{color}*.
Please advice me.

Create a new bean. Don't mix request scoped and session scoped data with each other in a huge bean which is potentially doing too much. If you really have a hard head in this, then just clear data2 in method1 and vice versa, so that it don't get displayed.

Similar Messages

  • Composite clients:  include command button inside data table

    Directly placing the command button into the datatable does work. However, I'd like to move it outside to another file and then include it. What's the best approach, to use ui:include? Is there a better approach?
    I'd like to have datatable.xhmtl and deletebutton.xhtml
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                    xmlns:h="http://java.sun.com/jsf/html"
                    xmlns:f="http://java.sun.com/jsf/core"
                    template="./beatlesTemplate.xhtml">
        <ui:define name="content">
            <h:dataTable value="#{beatles.list}"  var="beatle">
                <h:column>
                    <ui:include src="deleteButton.xhtml"/>
                </h:column>
                <h:column>
                     <h:commandButton id = "btnn" value="new row" actionListener="#{pc_Test.newRow}" />
                </h:column>
                <h:column>
                    <h:outputText value="#{beatle.title}"/>
                </h:column>
                <h:column>
                    <h:outputText value="#{beatle.comments}"/>
                </h:column>
            </h:dataTable>
        </ui:define>
    </ui:composition>
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                    xmlns:h="http://java.sun.com/jsf/html"
                    xmlns:f="http://java.sun.com/jsf/core"
                    template="./beatlesTemplate.xhtml">
        <ui:define name="deleteButton">
            <h:commandButton id = "btnn" value="new row" actionListener="#{pc_Test.newRow}" />
        </ui:define>
    </ui:composition>

    RaymondDeCampo wrote:
    Your approach seems reasonable, did it work when you tried it?No, it didn't. Pardon, I don't have more information on that, but will come back to the topic later (probably on the mailing list, which I prefer.)

  • JSP Data table - Rendering for command buttons.

    Hi All,
    We are designing a JSP page where results from table have to be thrown on a data table. (h:dataTable)
    Based on one column value on the data table, we need to render a command button for each row of data table.
    For example, I select the employees from a table and throw it on data table.
    Only for those employees where address is not present, I need to enable an "Update address" command button.
    (Command button "Update address" is also part of data table.)
    Is it possible to accomplish this on a data table?
    If so how should we code the "rendered" tag of the command button in data table.
    Any help would be greatly appreciated.
    Thanks.

    Sounds like the JSF forum would be a closer alignment, but in general
    - retrieve your information from the database into a list of Employee beans.
    - Have your h:dataTable use the list of Employee beans as a datasource
    - have the rendered attribute of your update button depend on the value of employee.address maybe #{empty employee.address}
    cheers,
    evnafets

  • Data block's table layout complicate command button?

    Why after I create a data block's layout using table format,
    when I try to insert a command button into the canvas, the
    button always appear like a concatenated buttons (i.e. if I have
    5 rows in the tabular format for displaying the data block, my
    command button becomes 5 buttons glued side by side together)?
    Advice, anyone?

    Hello Andy,
    See, when you are attaching a command button to the data block
    you created to show 5 rows, its definitely going to show you 5
    buttons in a stack manner.
    There are two ways to show one button.
    1> You should create a control block (non base table) in the
    form and attach the button there. Rows displayed property of
    this block should be 1.
    2> Open the property palette of the button in the data block.
    Change the value of "No. of Items displayed property" to 1.
    Hope this will solve your problem.
    Wishes,
    Anindya

  • Show/Hide Command button in ADF

    I want to hide "Command Button" based on the select of "tableSelectOne". I have tried using the following code but I am not able to do that. So pls suggest some other options.
    <af:panelGroup partialTriggers="DestRulesSelectionId">
    <af:commandButton text="..."
    disabled="false"
    shortDesc="Test"
    partialTriggers="DestRulesSelectionId"/>
    </af:panelGroup>
    <af:tableSelectOne text="Select and" autoSubmit="true"
    id="DestRulesSelectionId"/>

    Hi Didier,
    But I have also developed the same example and it is working, without putting the command button under any parent component.
    Page defination is
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <afh:html binding="#{backing_ShowHide.html1}" id="html1">
          <afh:head title="ShowHide" binding="#{backing_ShowHide.head1}" id="head1">
            <meta http-equiv="Content-Type"
                  content="text/html; charset=windows-1252"/>
          </afh:head>
          <afh:body binding="#{backing_ShowHide.body1}" id="body1">
            <h:form binding="#{backing_ShowHide.form1}" id="form1">
              <af:panelPage title="Show Hide" binding="#{backing_ShowHide.panelPage1}"
                            id="panelPage1" partialTriggers="selectOneRadio1">
                <f:facet name="menu1"/>
                <f:facet name="menuGlobal"/>
                <f:facet name="branding"/>
                <f:facet name="brandingApp"/>
                <f:facet name="appCopyright"/>
                <f:facet name="appPrivacy"/>
                <f:facet name="appAbout"/>
                <af:selectOneRadio label="Select "
                                   value="#{backing_ShowHide.radioBtnValue}"
                                   autoSubmit="true"
                                   binding="#{backing_ShowHide.selectOneRadio1}"
                                   id="selectOneRadio1">
                  <af:selectItem label="One" value="one"
                                 binding="#{backing_ShowHide.selectItem1}"
                                 id="selectItem1"/>
                  <af:selectItem label="Two" value="two"
                                 binding="#{backing_ShowHide.selectItem2}"
                                 id="selectItem2"/>
                </af:selectOneRadio>
                <af:commandButton text="commandButton 1"
                                  binding="#{backing_ShowHide.commandButton1}"
                                  id="commandButton1"
                                  partialTriggers="selectOneRadio1"
                                  rendered="#{backing_ShowHide.radioBtnValue =='one'}"/>
              </af:panelPage>
            </h:form>
          </afh:body>
        </afh:html>
      </f:view>
      <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_ShowHide-->
    </jsp:root> ~Vikram
    http://kohlivikram.blogspot.com/
    Message was edited by:
    KoVik
    Message was edited by:
    KoVik

  • Hide Exit Command Button

    Hi! Does anyone know how to hide the exit command button in the nokia series 80 which is automatically inserted by itself? I need to hide the exit command button because if the user select the default button, my application is still running at the background. I have created a new exit command button by using Command.EXIT and it end up there are 2 exit buttons in the device. Please help!
    Thanks in advance.
    YHat

    Please use the search, this has been asked many times before...

  • Data View with customized command buttons

    I would like to show data from a table in browse window and place customized command buttons such as search key, filter, etc.
    Please advise.

    What you describe is a form. And you don't want a browse window, but a grid inside this form. The only thing you set in a grid in the first degree is the recordsource, and then it will display the same data view as a browse.
    The rest of your idea can be placed into the same form as controls, textboxes, buttons, etc. and you might make use of the idea sketched by Alaa Mukhtar.
    In the second degree, right click on controls you put on a form while designing it with the form designer, and you can get a help via a builder you get offered in the context menu.
    Bye, Olaf.
    Olaf Doschke - TMN Systemberatung GmbH
    http://www.tmn-systemberatung.de

  • Using command button to select query - WAD 7.0

    Hello all
    Can anyone please tell me how to configure a command button (button group) to display a particular query in WAD 7.0?
    Here's what I mean -
    I have a web template with three queries. I have inserted 3 command buttons on the template. I want to assign one button to one query, so that the users can select which of the three they want to view. Which Command do I select in the command wizard to do this? Also, is it possible to hide the other two queries, when one is selected?
    Thanks
    Karen

    Hi,
    Here is one approach - Keep three analysis items in the WT. Assign three different data providers to all three analysis items. If you do not want to show any query when the WT first loads, don't assign any query to the data providers. When a button is pushed, you can use the command SET_DATA_PROVIDER_PARAMATERS to assign a query to a DP so that that query will show up.
    Other commands that will help you would be SET_ITEM_PARAMETERS using which you can hide analysis items and also, you can use the command BACK_TO_INITIAL_DP_STATE on data providers so that they do not show up if they were blank at the start.
    Another way to hide a query is to assign the analysis item to a data provider which is blank.
    For your requirements, you will have to put multiple commands behind each button - you can decide which of the above commands suit you best.

  • Command buttons to Assign Query / Query view with variables on Workbooks

    Hi experts,
    We want to have a workbook with buttons that will change the Query/Query view displayed in the unique grid we have.
    We've included command buttons on a workbook, as "<b>Data Provider Specific Command</b>" and chose the Queries, selecting the "<b>Assign Query / Query View</b>" option.
    When using queries without variables or just SAP exit variables it works perfectly, clicking the buttons change the table displayed accordingly. But when using queries that have at least one variable, in our test to select time interval, it doesn't work anymore.
    In our test, we're using just 2 queries and they have the same input variable (to select months interval); but when clicking the button no change/error occurs.
    Any ideas?
    Thanks in advance.

    Hi,
    Here is one approach - Keep three analysis items in the WT. Assign three different data providers to all three analysis items. If you do not want to show any query when the WT first loads, don't assign any query to the data providers. When a button is pushed, you can use the command SET_DATA_PROVIDER_PARAMATERS to assign a query to a DP so that that query will show up.
    Other commands that will help you would be SET_ITEM_PARAMETERS using which you can hide analysis items and also, you can use the command BACK_TO_INITIAL_DP_STATE on data providers so that they do not show up if they were blank at the start.
    Another way to hide a query is to assign the analysis item to a data provider which is blank.
    For your requirements, you will have to put multiple commands behind each button - you can decide which of the above commands suit you best.

  • I am attempting to upload multiple photos on a macpro from a cd.  I am used to a pc.  I tried using the command button to select multiples but it does not work.  Please advise

    I am attempting to upload multiple photos on a mac pro from a cd.  I have tried holding the "command"button down to select multiple photos but it does not work.  Please advise.  Thanks,John

    why not sort by (name, date, etc) and Click on 1st and Shift-Click on last.
    Might work better to copy or import to a project folder.
    https://discussions.apple.com/community/ilife/iphoto
    http://www.apple.com/support/iphoto

  • Adf faces command button, bindings and ejb 3.0 persisting problem

    When mapping the persist method to an adf command button it got this error:
    1. JBO-29000: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    2. java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    Is that because Departments are serialized by the container when the session bean is accessed by the data control to catch the data when the form is populating and entities are detached from the persisting context ? or something else ?
    I bind the button to the current row data provider for the departments. Is it correct, isn't ?

    When mapping the persist method to an adf command button it got this error:
    1. JBO-29000: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    2. java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    Is that because Departments are serialized by the container when the session bean is accessed by the data control to catch the data when the form is populating and entities are detached from the persisting context ? or something else ?
    I bind the button to the current row data provider for the departments. Is it correct, isn't ?

  • ADF JSF 10.13 how do you reference a binding from a command button?

    I have developed the following code as a model as I am trying to utilise ADF JSF without using a database.
    I have a collection called School. This has the appropriate operations that populate the school with a number of Child. A Child simply has a firstname and a surname.
    I have generated data controls for these collections and created two JSP pages and added a navigation link as follows:
    index.jsp --> goToSchool (navigation) --> school.jsp
    I have then added a command button to the index.jsp page. When the button is then pressed the school.jsp page is displayed. This works correctly.
    I would like to override the action of the button though so that before the navigation is executed I can get a handle on the school collection and populate it so that it will be displayed on the school.jsp page.
    I have previously done this in 10.12 when I had the following setup:
    index.jsp --> getSchool (dataAction) --> school.jsp
    by overriding the getSchool dataAction.
    I have looked through the 10.13 ADF user guides and tried various different things but have not managed to successfully acheive my goal of populating the school collection when the button is pressed prior to navigating to the school.jsp page.
    I would appreciate it if you could offer any advice, and if possible let me know the recommended best practices to acheive this.
    Thanks in advance for your help
    David

    Check out the ADF Tutorial (TopLink edition) chapter 5 has a section called:
    Adding a Drilldown Link
    I think this is what you are looking for.
    http://www.oracle.com/technology/obe/ADF_tutorial_1013/ADF_tutorial.pdf

  • Command button does not commit unless hit twice

    I'm using ADF/BC, 10.1.3.2 jdev. I have the following code in my backing bean:
        public String cardLost() {
            inputText12.setValue("1"); 
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding =
                bindings.getOperationBinding("Commit");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
    The command button is defined as follows:
    <af:commandButton
                                    text="Save" disabled="false"
                                    binding="#{find_student_mb.commandButton4}"
                                    id="commandButton4"
                                    action="#{find_student_mb.cardLost}"
                                    immediate="false"/>When I hit the Save button the first time, the input text field (inputText12) changes to 1, but the data does not get commited to the database. (I have verified this in the database) If I hit the Save button again, the data gets committed.
    Is there a way to update the field and commit the data with one button?
    Thanks,
    Bob

    Hi,
    commit doesn't execute before a field is submitted. So what you do is you submit a page then update the field (which then is not yet reflected in the submit) an call commit, which basically executes on no new data. In the second call you now submit the data shown in the field that then also gets commited. To get it commited on the first button press, set the field value to the binding layer (attribute binding or iterator binding )
    Frank

  • Af:statusIndicator does not show busy icon when a command button is click

    Hi Guys,
    af:statusIndicator does not show busy icon or motion when a command button is click
    I am working on an excel data upload functionality on .jspx page. I use “af:inputFile” file uploader to upload an excel file then process the data and store it as a list of objects in memory and display it in “af:table” table
    I added “af:statusIndicator” to the page to show the user that the page is progressing while the data is uploading and when it is saving the data to the database.
    In this case, when the “af:inputFile” is clicked to upload the excel file - the status indicator shows a progress icon (movement) which is expected and is good. However, after the data have been display in the table when I click on a command button that saves the data to the database – I expected the status indicator to start its busy motion but that is not happening. Whereas, the command button grayed out and is disable when I clicked the button until the operation is completed.
    Is there any way to start the statusIndicator when a command button is clicked?
    I tried the following options
    *<af:statusIndicator id="si1_uploadStatus" partialTriggers="pc1:cb1 pc1:table"/>*
    Where pc1:cb1 is the command button and pc1:table is the table
    *<af:commandButton text="Submit Uploads" id="cb1"*
    *disabled="#{!viewScope.batchUploadController.allSavable}"*
    *partialTriggers="::infFilePath"*
    *action="#{viewScope.batchUploadController.saveUploadedData}"*
    *blocking="true"/>*
    Thanks,

    Can somebody please address this?
    Thanks,

  • ADF/JSF page loads when any command button is clicked

    Hello All,
    I am lost in the ADF/JSF page flow (using Jdev 10.1.3). Following are the tags (in order) in my page;
    (WHEN THIS PAGE LOADS, IT GOES TO THE DATABASE TO GET VALUES (for the drop down lists that will appear on the page); THIS SHOULD HAPPEN JUST ONCE AND AT THIS POINT)
    <f:view>
    <afh:body>
    <afh:html>
    <af:form>
    <af:panelpage>
    <f:facet name="contextSwitcher">
    <af:panelHorizontal> has a af:commandLink </af:panelHorizontal>
    </f:facet>
    <f:facet name="messages">
    <af:messages/>
    </f:facet>
    <af:panelform>
    <h:panelGrid columns="2" cellspacing="14">
    has 2 panelgroups (one group has *2 SelectOneChoice lists (that need to be populated by fetching data from database* and the other group has 2 CommandButtons - 'Go' and 'Cancel") (GO BUTTON SETS THE SHOWPANEL() TO TRUE)
    (WHEN GO BUTTON IS CLICKED, THE PAGE GOES TO THE DATABASE (AS IT DID ON PAGE LOAD). *THIS SHOULD NOT BE HAPPENING*. ONLY THE METHOD (action="#{muBean.doWork}" )THAT IS ASSOCIATED WITH GO BUTTON ACTION SHOULD BE CALLED)
    </h:panelGrid>
    <h:panelGrid columns="2" cellspacing="14" rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
    has 3 inputText fields
    </h:panelGrid>
    <af:table var="someTable" rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
    has a bunch of af:columns
    </af:table>
    <af:panelHorizontal rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
    has 3 af:commandButtons - submit, save, add row
    (WHEN submit or save or add row BUTTON IS CLICKED, THE PAGE KIND OF LOADS AND GOES TO THE DATABASE (AS IT DID ON PAGE LOAD). *THIS SHOULD NOT BE HAPPENING*. ONLY THE METHOD THAT IS ASSOCIATED WITH submit/save/add row BUTTON ACTION SHOULD BE CALLED)
    </af:panelHorizontal
    </af:panelForm>
    </af:panelPage>
    <!-- Footer -->
    <jsp:include page="/pages/includes/footer.jspx"/>
    </af:form>
    <f:verbatim>
    <script type="text/javascript" src="../script/tree.js"></script>
    </f:verbatim>
    </afh:body>
    </afh:html>
    </f:view>
    </jsp:root>
    _*why is it that when the command buttons are clicked, the whole page is loaded? Only the methods associated with the action (action="#{newMapRequestItem.addARow}" ) should be called.*_
    _*IS THERE A WAY TO AVOID THIS WITHOUT USING PARTIAL PAGE RENDERING ?*_
    _*DOES MY TAG NESTING LOOK OK?*_
    Edited by: user12054715 on Mar 24, 2010 12:00 PM

    Can somebody please address this?
    Thanks,

Maybe you are looking for

  • XI examples step by step screen shots

    hi experts, i am new in XI. i want to learn XI so any one plz help me how to create,how to install,connect,and SLD,ID,IR,ADAPTER,BPM,MAPPING plz send any documents for XI step by step examples with screen shots.it's really helpful for my carrier. tha

  • Flickr sync changing static urls in sets

    When I share photos from iPhoto to a previously created Flickr set, the sync changes all of the static urls on my previously uploaded pictures in that same set. This is frustrating because it breaks all of the links to photos on my prior blog posts.

  • Typing going crazy in MS Word 2008 under Bootcamp

    I have a minor issue wondering if anyone has seen it before: Just created a new iMac 21inch running SNL 10.6.2. and Bootcamp with Windows XP SP3 installed, along with MS Office 2008. In MS Word, when trying to type in a document the first couple of l

  • Servlets , Commons FileUpload , MySQL and large file trouble

    Hey Guys, I am trying to upload files from a servlet handled page using jakarta commons file upload library into MySQL. I could not upload a 40M file . I can upload smaller size, 1-5 M , haven't tried 10-20 M sizes. MySQL variable for size is set to

  • Adding a 2D image into a 3D scene

    hey guys probably a very fast simple question. I would like to add a 2D image to my 3D scene, so is there an existing object ready for use, or do i have to create my own quadArray and apply texture with the image? thanks