Expand and collapse link in jsf datatable

Hello all,
Initially i am displaying 5 rows per page. when user clicks expand link the table should display all the records in the page.when collapse is clicked vice versa
Thanks
K Ramu

Hi Balu,
Sorry for that, here is my code snippet. the problem i am getting is if i click the expand link it is expanding bids for all the projects, i want the expand feature for a selected project only. please help me where did i mistake.
          <t:dataTable id="openForBidsTable" rowIndexVar="row"
               value="#{OpenForBidsBean.openForBids}" var="projects" border="1"
               cellpadding="1" cellspacing="1" first="0" rows="5">
                    <t:outputText value="#{projects.nameOfTheProject}" />
               </t:column>
               <t:column>
                    <t:outputText value="#{projects.description}" />
               </t:column>
               <t:column>
                    <tr>
                         <td colspan="12"><h:panelGrid
                              binding="#{OpenForBidsBean.gridPanel1}" rendered="true">
                              <t:dataTable id="BidTable" value="#{projects.bids}" var="bids"
                                   border="2" cellpadding="2" cellspacing="2" first="0" rows="5">
                                   <t:column>
                                        <t:outputText value="#{bids.vendors.userName}" />
                                   </t:column>
                                   <t:column>
                                        <t:outputText value="Title" />
                                   </t:column>
                                   <t:column>
                                        <t:outputText value="Notes" />
                                   </t:column>
                              </t:dataTable>
                              <h:commandLink action="#{OpenForBidsBean.expandProjects}"
                                   value="Expand Link" />
                         </h:panelGrid> <h:panelGrid binding="#{OpenForBidsBean.gridPanel2}"
                              rendered="false">
                              <t:dataTable id="BidTable1" value="#{projects.bids}" var="bids"
                                   border="1" cellpadding="1" cellspacing="1" first="0">
                                   <t:column>
                                        <t:outputText value="#{bids.vendors.userName}" />
                                   </t:column>
                              </t:dataTable>
                              <h:commandLink action="#{OpenForBidsBean.collapseProjects}"
                                   value="Collapse Link" >                                   
                              </h:commandLink>
                         </h:panelGrid></td>
                    </tr>
               </t:column>
          </t:dataTable>
managed bean code:
public HtmlPanelGrid getGridPanel1() {
          return gridPanel1;
     public void setGridPanel1(HtmlPanelGrid gridPanel1) {
          this.gridPanel1 = gridPanel1;
     public HtmlPanelGrid getGridPanel2() {
          return gridPanel2;
     public void setGridPanel2(HtmlPanelGrid gridPanel2) {
          this.gridPanel2 = gridPanel2;
public String expandProjects() {
          getGridPanel1().setRendered(false);
          getGridPanel2().setRendered(true);
          return "selected";
public String collapseProjects() {
          getGridPanel1().setRendered(true);
          getGridPanel2().setRendered(false);
          return "selected";
Thanks
KRamu

Similar Messages

  • Adding a link to expand and collapse all DHTML drop downs

    Hi, can anyone help me adapt the "Skinny on Skins" example "Add a Toolbar button to expand and collapse all DHTML drop downs" so that it will work with just a simple HTML link in RH8, instead of being attached to a custom skin button?
    The example looks like this:
    Step 1. Open the Skins Editor for the skin where you want to add the button.
    Step 2. After the preview loads into the window, ensure that the Toolbar tab has focus, then click the plus symbol. The Custom Toolbar Item dialog should display.
    Step 3. Type the Item Name (This is simply an internal reference for the button).
    Step 4. Type the Text (This is the text that will be seen by the end user. The field must contain something. So if you don't want any verbiage to display for your toolbar item, simply type a space.)
    Step 5. Choose your Image Options, then click the Action tab.
    Step 6. Click the JavaScript option button.
    Step 7. Enter the following code in the OnClick field:
    javascript:toggle()
    Step 8. In the JavaScript area, ensure the Inline JavaScript option button is selected, then click the edit (Pencil) icon located to the right.
    Step 9. Enter the following code in the Inline JavaScript dialog
    var show = "false";
    function toggle() {
    parent.frames[1].bsscright.focus();
    var arrayofDivs = parent.frames[1].bsscright.document.all.tags('DIV');
    if (show == "false") {
    for (x=0;x<arrayofDivs.length;x++) { arrayofDivs[x].style.display = "block";}
    show = "true";}
    else {
    for (x=0;x<arrayofDivs.length;x++) { arrayofDivs[x].style.display = "none"; }
    show = "false"; }
    Step 10. Click the OK button to close the Inline JavaScript dialog.
    Step 11. Click the OK button to close the Custom Toolbar Item dialog.
    Step 12. Click the OK button to close the Skin Editor.
    Step 13. Generate WebHelp via File > Generate > WebHelp and ensure that you have the new button selected with a check mark. This will probably require stepping through some screens to see the place where you can select it.
    Many thanks
    Jonathan

    Hi again
    I want to use it in the header of one of my Master Pages, so it will only be created/maintained once. Not all my pages have drop downs in so rather than have a toolbar button available for every page, I was trying to be a bit cuter by having two Master Pages - one for normal pages and one for pages with drop downs in.
    I'm no javascript expert so I'll see if one of my developers can help.
    Thanks anyway
    Jonathan

  • How to perform expand and collapse operation on click of link or button

    Hi
    Is there anyway by which i can perform expand and collapse operation over a table on click of a command link or button without using show details component.
    Is there any other alternative to show detail.
    I do not want to use show detail because of the following reason.
    I have got a page where in i pass some parameters to the URL based on which details get displayed on the page.
    Now when i pass a parameter, change the parameter, once again send the previously used parameter(i,e the parameter that i passed initially), values in the table under show detail do not show any change in values.
    Once i pass values which i have already passed, values in the table under show detail component do not refreshed.
    If anyone has encountered with similar situation, then please post me reply's as to how you could over come the problem??

    Hi
    Perhaps you could use an on-demand application process instead - you can specify these in the URL.
    The URL syntax (for your link) would be like...
    f?p=application_id:page_id:session:APPLICATION_PROCESS=process_idIs this what you mean?
    Cheers
    Ben

  • Can please tell me how to implement expand and collapse table row data?

    i am trying implement expand and collapse table row data but i do not get any ideas..can please any one help me its an urgent requirement

    Yes, we can.   
    I think the best place for you to start for this is the NI Developer Zone.  I recommend beginning with these tutorials I found by searching on "data log rio".  There were more than just these few that might be relevant to your project but I'll leave that for you to decide.
    NI Compact RIO Setup and Services ->  http://zone.ni.com/devzone/cda/tut/p/id/11394
    Getting Started with CompactRIO - Logging Data to Disk  ->  http://zone.ni.com/devzone/cda/tut/p/id/11198
    Getting Started with CompactRIO - Performing Basic Control ->  http://zone.ni.com/devzone/cda/tut/p/id/11197
    These will probably give you links to more topics/tutorials/examples that can help you design and implement your target system.
    Jason
    Wire Warrior
    Behold the power of LabVIEW as my army of Roomba minions streaks across the floor!

  • How to create labeled table of Content with expand and collapse

    Hi All,
    Can somebody help me how to create labeled table of Content with expand and collapse as example given below:
    User1
    Template1
    Template2
    User2
    +
    User3
    Template1
    Template2
    Like when we see expand (+) and collapse (-) button when we click on 'about this page' link.
    Thanks
    Bhupendra

    Hi,
    Tou can use Table inside table to show the details this way but I'm not sure about Expand/Collapse.
    Expand/Collapse are part of HGRID.
    I think we can develop this functionality with little manipulation.
    Regards,
    Reetesh Sharma
    Edited by: Reetesh Sharma on Jun 28, 2010 4:56 AM

  • Expand and Collapse(+/-) option in a Matrix SQL Reporting Services 2008

    Hello All,
    I am having Expand and Collapse(+/-) option in a Matrix SQL Reporting Services 2008. It's not working when it is havnig a Row Group and Column Group.
    Does reporting services has this flexibulity?? It's working fine if it's only have a Row Group an it's not working if it is having Row and a Column Group. Can any one suggest how to work aroung with this.
    any help much appriciated.
    Thanks & Regards,
    Jeevan Dasari.
    Dasari

    Drill-down feature is a basic requirement, it is concluded in Reporting service from SSRS2000 to SSRS2008 R2, To
    your scenario I think the root cause is relevant to your incorrect steps. Please follow the steps below and then give the feedback:
    1.     Right-click the child groups in the
    Row Groups panel which is at the left-bottom of the BIDS, and then select
    Group Properties…
    2.   
    Switch to Visibility tab, and then select
    Hide Radio-button, click the checkbox of Display can be toggled by this report item.
    3.   
    Then select the parent group datafield in the drop-down list.
    4.   
    Click OK.
    Thanks,
    Challen Fu
    Challen Fu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Trying to override the default af:tree expanded and collapsed icons

    Hi,
    I initially hijacked a thread from 2010 that was vaguely similar to what I need to ask, but a kind forum moderator split my post out to stand on its own merits.
    I am trying to override the default af:tree expanded and collapsed icons I am using the following styles for my af:tree but they are not reflecting any thing on my tree with the styleclass orgType.
    af|tree.orgType::expanded-icon {
    content: url("../images/ac-expand.png");
    cursor: default;
    af|tree.orgType::collapsed-icon {
    content: url("../images/ac-collapsed.png");
    cursor: default;
    af|tree::expanded-icon {
    content: url("../images/folder_open.png");
    cursor: default;
    af|tree::collapsed-icon {
    content: url("../images/folder_close.png");
    cursor: default;
    After working for long hours I realized that there is some problem with af:tree and treeTable. They are not taking the styles where as for the other components, every thing works fine. Is there any way to achieve the task. Could you suggest any alternative way to do this. Thanks in advance. Your suggestions for this task can really help me and my team a lot.
    Regards,
    Krishna Sumanth.

    Hi,
    do the icons show without the style class reference used in the skin file? If so, then the style class for this component might be rendered differently for the tree, e.g.
    .orgType af|tree ...
    Frank

  • Expand and collapse button in maintenance view

    hi all,
               i want help for functionality of expand and collapse buttons present there in maintenance view. delimit button is also there what is the functionality for these buttons.
    u ppl can see these buttons while enetering values in standarad maintenance view V_T510
    my requirement is to create same buttons and their working in user defined maintenance view.

    Hi Chavi,
    check the PDF document
    Module Poolo tuorials
    regs,
    Hema sundar.

  • How to expand and collapse af:showDetailItem in keyboard Tab navigation

    i would like  to expand and collapse <af:showDetailItem/> by keyboard  tab navigation. is there any default functionality is available to achieve it.
    Thanks

    Hi,
    can you try with below config in your web.xml. It specifies where to store the view state of your application
    <context-param>
          <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
          <param-value>client</param-value>
       </context-param>regards,
    Rajan

  • Drill down expand and collapse feature not available  Crystal Reports Desig

    Hi,
    Am I right in my understanding that drill down feature opens in a new tab and it cannot be made expand and collapse even using JRC.
    Please advise & thank you
    Selvi

    Hi Slevi,
    You are right with the understanding of the Drill down function. To have a drill down function available the minimum requirement is have at least a single group in the report.
    When we have a group with some underlying data and then when we would like to see data for a particular group, we can see a u201Cmagnifying glassu201D symbol which indicates that there is data for this group and we can use the Drill down function.
    When you drill on a particular group, the data for that group is shown in a new tab.
    I hope this provides some information about the Drill down function used in Crystal Reports.
    Regards,
    Prashant Saduwale.

  • Is it possible to make the TOC expand and collapse icons larger?

    OR to have the TOC expanding and collapsing by usage of a self made buttons?

    You can use graphics that are slightly taller, but not wider.
    If you go to this page and take a look at the example named Supply Chain Management, you will see that I have used a different TOC expand image that is slightly taller:
    http://www.infosemantics.com.au/portfolio
    I had originally tried to use a larger image but it appears that Captivate limits the width.
    You can use the On Success action of a button to assign the value of the cpCmndTOCVisible system variable to 1 or 0 to open or close the TOC.  You can create a toggle action using a Standard or Conditional action to make the same button alternately open or close the TOC each time it is clicked.

  • Expandable lists that expand and collapse with one click and edit in wysiwyg

    I have a lot of text based lists on one page, so I threw them into content editor web parts so i can expand / minimize the lists. However, two clicks (one on the arrow and then one on "restore") is becoming really tiresome. How can I make expandable
    lists that expand and collapse with one click? AND they are still editable from the wysiwyg browser editing tool?
    I have already tried using Jquery to create expandable content, but the problem here is that the content can't be edited in the wysiwyg browser based editor - the expand or collapse button doesn't "work" when you are in the edit mode, so you can never
    see the expandable content to edit. I can change the content in the code but it's no good if my non-coder co-workers can't also edit it.
    I am in 2010.

    I just found the answer myself here: blog (.) pathtosharepoint.com/2008/10/25/expandcollapse-buttons-for-your-web-parts/
    Worked perfectly. Allows open and close of CEWP with one click, and you can still edit their content in the wysiwyg editor.

  • WRE54G expander and D-LINK 624 router

    Note: DI-624 has 4 lines ethernet wired connectors and 1 wireless antena.
    With WRE54G powered and ethernet connected to the router line 2, the CD used to setup the expander did not worked at first time and resulted in a message in the computer: The WRE54G can not associated this AP in repeater mode.  The next step was to change the configuration of DI-624 by accessing the IP address of the router (Web page of D-link). I put security desable and applied the new configuration to the router but loss the wired (line 1) connection to the internet by DI-624. I reboot the computer and internet came back. I started again with CD setup and the message desappeared but the red light still ON even with the message congratulations in my screen for Linksys setup. When I disconnected the ethernet cable to the expander and after few seconds, for my surprise the both leds went to blue light. When I returned to secure mode in the router, the expander return to red light. Then I decided to run setup with WPA enable until final with congratulations in my screen of Linksys setup wizard but with red light on the expander. After removing the ethernet cable, then after few seconds the Expander turn both leds to blue color. I sent this mail by a computer in the lower floor using this WRE54G expander.

    Well is your D-Link router supports WDS (wireless distribution system), if yes… WRE54G may work with this router…

  • Changing JTree Expand And collapsed Icons

    Hi,
    can anyone tell me how to change the expanded and collpased icons on a JTree, i am using windows look and feel, and i don't know how to change the '+' and '-' icons, the other icons are changed using the DefaulTreeCellRenderer, but i haven't found a way to achieve my goal....
    thanks

    In the beginning of your main method you write :
    try {
         UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
         UIManager.put("Tree.collapsedIcon",new ImageIcon("plus.gif");
         UIManager.put("Tree.expandedIcon",new ImageIcon("minus.gif");
    catch (Exception exc) {
         System.err.println("Error loading L&F: " + exc);
    }And you change the name of the images with the wanted ones.
    Denis

  • Expand and Collapse within JSP

    Fairly new to JSTL so please excuse my ignorance. I am creating a button(link) that will expand to show rows of data when clicked or collapse when clicked again. I already have a bean populated from the backend that contains a collection of my data. Want to know the best way to access and display the data using Struts tags or JSTL? Have performed similar code using scriplets but my form or collection is not in 'session' and would like to keep it that way.

    Ok, I was trying to avoid reloading because there are multiple areas on the page that require this functionality and it may get messy. AJAX was a consideration, started looking into AJAX Anywhere, heard it works well with Struts or JSF.
    Is it possible to reference Struts or JSTL tags within the JavaScript? I tried writing a scriplet to handle this but I cannot get to the FormBean because it is not in session.

Maybe you are looking for

  • Nvida GT 610 nouveau support

    Hello all, I am currently trying to find a setup with a working graphics card (no 3D required). I got myself a GT 610 from Nvidia, specifically this one here: https://www.asus.com/Graphics_Cards/GT610SL1GD3L/ I tried using nouveau with it. Bootup wor

  • Cant get out of SRV Diag Boot

    I have a 30gb video ipod. when I try to recharge it, the apple appears very faintly, then it pops into SRV Diag Boot (Mar 01 2006), and no matter how I reset it, it always boots back to the screen, and my computer won't recognize it. I have tried usi

  • 10Gr3 OSB business service is unable enqueue to 11Gweblogic server

    Hi we have configured business ervice in 10GR3 OSB to send the message to the queue which is on 11G weblogic server(10.3.1) and always geting the error connection not found jms://remotIPaddress:7001/cnf/Qjndiname. any help regarding this would be gre

  • IPhone 4 replaced battery 100% charged, but shuts down unless plugged into wall charger

    Hi everyone, I've had my iPhone 4 (AT&T) for almost 2 years now so the battery life is rather terrible and I decided to replace the battery. I ordered a battery from PhonePartsUSA and followed the instructions on ifixit. I had some minor issues with

  • Safari with no windows

    First let me say this may not be exclusively a Safari question because I've seen similar behaviour with Google Chrome. I like to set my browser as a Login Item so it automatically loads every time I login. I have a MBPR 13" with Mountain Lion, but al