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.)

Similar Messages

  • Command button inside header column in ADF table

    Hi all,
    I want to insert two command buttons inside the header column of an ADF table.
    In my mind these buttons should replace the two default buttons (small triangles) to sort the column in ascending order or descending order.
    Do you know any solution ?? Because it is 2 days that i am trying , but no way .
    Thanks in advance
    Stefano

    Use as mentioned below:
    <af:table value="#{bindings.AllEmployees.collectionModel}" var="row"
    rows="#{bindings.AllEmployees.rangeSize}"
    emptyText="#{bindings.AllEmployees.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.AllEmployees.rangeSize}" rowBandingInterval="0"
    selectedRowKeys="#{bindings.AllEmployees.collectionModel.selectedRow}"
    selectionListener="#{bindings.AllEmployees.collectionModel.makeCurrent}" rowSelection="single"
    id="t1">
    <af:column sortProperty="#{bindings.AllEmployees.hints.EmployeeId.name}" sortable="true"
    headerText="#{bindings.AllEmployees.hints.EmployeeId.label}" id="c1">
    <af:outputText value="#{row.EmployeeId}" id="ot1">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.AllEmployees.hints.EmployeeId.format}"/>
    </af:outputText>
    </af:column>
    *<af:column id="c2">*
    *<f:facet name="header">*
    *<af:group id="g1">*
    *<af:panelGroupLayout id="pgl1" layout="horizontal">*
    *<af:commandButton text="Ascending" id="cb1" icon="" iconPosition="trailing"/>*
    *<af:commandButton text="Descending" id="cb2" icon="" iconPosition="trailing"/>*
    *</af:panelGroupLayout>*
    *</af:group>*
    *</f:facet>*
    *<af:outputText value="#{row.FirstName}" id="ot2"/>*
    *</af:column>*
    </af:table>
    Thanks,
    Navaneeth

  • Generating dynamic command links in data table

    Hi,
    I have a requirement to generate dynamic number of columns in a datatable. Also these columns should contain a command link.
    I have written following piece of code to do so...
    public UIData getDataTableBinding()
         UICommand comm = null;
         UIColumn col;
         UIOutput out = null;
         Application app = app = FacesContext.getCurrentInstance().getApplication();
    // Suppose I want to generate 7 columns
         for(int j = 0; j < 7; ++j) {
         out = new UIOutput();
         col = new UIColumn();
         comm = new UICommand();
         ValueBinding vb = app.createValueBinding("#{" + j + "}");
         out.setValueBinding("value", vb);
         out.setRendererType("javax.faces.Text");
         comm.setRendererType("javax.faces.Link");
    comm.getChildren().add(out);
         MethodBinding mbButton = app.createMethodBinding("#{pc_File1.doLink1Action}",
    null);
         comm.setAction(mbButton);
         col.getChildren().add(comm);
         dataTableTemp.getChildren().add(col);
         return dataTableTemp;
    I have bound the "binding" attribute of the data table to getDataTableBinding()
    method.
    If I remove all the references to UICommand i.e comm variable, table is displayed properly, but if
    I try to include a command link component as mentioned above I get "Assertion failed error"
    SRVE0068E: Could not invoke the service() method on servlet Faces Servlet. Exception thrown :
    javax.servlet.ServletException: javax.faces.el.EvaluationException: Error getting property
    'dataTableBinding' from bean of type pagecode.File1: javax.faces.FacesException: Assertion Failed
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:638)
         at com.ibm._jsp._File1._jspService(_File1.java:92)
         at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
    Any kind of help on this issue would be appreciated,
    Thanks in advance,
    Raina

    Hi,
    I solved my problem just by replacing UIOutput component with HtmlOutputText component and then making it as a child component of UICommand component.
    Now I am facing a new problem. Whenever I try to refresh the page I get following exception
    "SRVE0026E: [Servlet Error]-[Faces Servlet]: java.lang.IllegalStateException: Duplicate component ID 'form1:table1:cmd0' found in view."
    I am explicitly setting the component id of the UICommand component using the setViewId() method.
    This problem is observed only when I refresh the page. In case I navigate to another page and then again come back to this current page, then I don't get this exception.
    Your help would be appreciated,
    Raina

  • Regarding visibility on/off of inputText bos inside data table

    Hi
    i taken one check box in the first column of data table in JSF,and based on click event of check box i want to enable or disable inputText box/outputText box which is there in other columns in the dat table.
    please help me how to enable or diable the inputText box on the click event of check box.
    Thanks
    Ramakant

    Hello Again,
    I am in the process of writing a custom validator that generates the client side validation for me so I don't have to do anything more the use a tag and give it an error message and it will validate.
    So far things fave been going well except when I use a data table and have the components that are being validated inside the data table.
    In the validator tag I have
      protected FacesContext context = null;
      protected Application application = null; 
      protected UIComponentTag parentTag = null;
      protected UIComponent parentComponent = null;
      public int doStartTag() throws JspException {
        this.context = FacesContext.getCurrentInstance();
        this.application = this.context.getApplication();
        this.parentTag = UIComponentTag.getParentUIComponentTag(pageContext);
        this.parentComponent = parentTag.getComponentInstance();
        return super.doStartTag();
      public int doEndTag() throws JspException {
        String id = parentComponent.getClientId(context);
        /***** Output script that uses the id goes here *****/
    Accourding to the UIComponent JavaDoc getClientId() method should return a consistant value but it is not. When called from within the jsf components renderkit it provides
    [i]Form:Datatable:Row:Component
    But from in my validator it returns
    Form:Datatable:Component
    Which is obviously incorrect. I'm not sure why this is occurring or if it is fixable.
    Thanks again for any help that can be provided.

  • Radio button in data table

    Hi,
    In continuation to my previous post, i have another requisite.
    I have a pop and get my data from a data table.for each of my row in datatable i need to get a radio button.
    presently am using f:selectoneradio.
    At a time only one radio has to be selected.I understand jsf radio button does not support this.
    Is there anyway that i can achieve this?
    Does tomohawk tags support this feature?or shud i have to go only for some custom component?

    Here is an example. I uploaded mock html so that you can actually try this code. I think this does exactly what you are asking.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    Dim rButton As HTMLInputElement
    ' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
    strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
    ' Strip out the ; for inner text comparison
    strValue = Replace(strValue, ";", "")
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    ' then clicks the radio button. Findelements allows you to specify a root element
    ' once the correct root row is found, FindElemets can get the correct radio button
    For Each tblRow In tbl.rows
      If tblRow.innerText = strValue Then
        Set rButton = RSWApp.om.FindElement("account", "INPUT", "NAME", , , tblRow)
         rButton.click
       End If
    Next
    End Sub
    I also uploaded the script I created. You should be able to run it and see how it works.
    This should get you going.

  • Add Command when selecting data tables

    I've been playing with the Add Command option that allows you to enter an SQL statement to select data for the report.  I was wondering what people use this type of command for?  I've used Crystal over 10 years but while I've been using Crystal XI for only about 3 years, I have never used this option.
    So what advantages does it have over the graphically selection and linking of data tables?
    What types of reporting is usually done with them?
    TIA, rasinc

    You have to know your database well and have fairly good SQL skills, but I've found that there are things I can't do directly in Crystal that I can do when I use a command as the data source.  A couple of examples are:
    1.  When I want to use cross-server joins (MS SQL) or dbLinks (Oracle) to get data from a second (or third!) database, this is the only way to do it short of using a stored procedure, which has it's own issues.
    2.  When I want to do something complex in the SQL, such as using a set of selects with Unions to "pivot" data without using a cross-tab.
    Also, Crystal doesn't always create the most efficient SQL so if I'm having problems with query performance in a report, I'll re-write it using a command so that I can tweak the performance.
    -Dell

  • 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.

  • 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

  • Command Link inside table to external website in popup window

    Hi,
    I am trying to have a command link inside a table which is on the tables id. I know that if I have control of the destination page I can use setCurrentRowKeyValue. However I do not have control of the external website. So I cannot add it into my faces-config.xml file? I have tried putting a GoLink and a GoButton but I get the following Illegal character in fragment error, when I put my destination URL in. An example of the format the URL is:
    http://www.bbc.co.uk/radio?&music=#{row.PrimaryKey}&adf=123
    Where I am adding in #{row.PrimaryKey} which is the Id of the row. I would like to have the new page opened into a pop up window if this is possible.
    I am not sure if this can be done in the backing bean or whether my approach is the correct one?
    Many Thanks
    Steve

    something like...
    <af:goLink text="#{row.PrimaryKey}"
               destination="http://www.bbc.co.uk/radio?&amp;music=#{row.PrimaryKey}&amp;adf=123"
               targetFrame="_blank"/>Regards,
    Neeraj

  • 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.

  • 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,

  • Problem with command buttons in jsf

    how to position or allign command buttons inside a page?
    for example if i include reset command button inside my page using,
    <h:commandButton value="#{form.buttonText}" type="reset"/>
    they are placed towards a corner only, how to bring them to the center of a page in jsp? or how to set the location of it?

    Use CSS for layouting and positioning. All JSF HTML components provides at least two attributes where you can set the CSS: the 'style' attribute accepts raw CSS and the 'styleClass' attribute accepts predefinied CSS classes from a stylesheet file (recommended).

  • How do I control the size of a command buttoon in a table control?

    Hi,
    I was wondering if there is a way to control the height of a command button in a table control.
    There does not appear to be a column or cell attribute that can achieve this.
    Thanks!
    --Bill

    Hi Wolfgang,
    Thanks for the reply, I came to that conclusion as well. What I have is a mixed table with instructions that word wrap in one cell, a command button to log step completion, and I needed the row height to be set to the tallest cell contents, so all I really needed to do was set the word wrap for my text instruction cell, and then as each row is programmatically inserted and the table is populated call:
    SetTableRowAttribute(panel, table, row, ATTR_SIZE_MODE, VAL_USE_EXPLICIT_SIZE);
    SetRowHeightToTallestCellContents(panel, table, row);
    That will allow the row to be sized accordingly without having to worry about the number of visible text lines for the text cell.
    Thanks!
    --Bill

  • Conditionally Display ADF Command Button

    I have an ADF table with a select option. I have a command button that executes a query titled "View Detail". I want the button to display but I only want it enabled when the Item Name column in the selected row of the table appears in a separate view object which takes the Item Name as a parameter.
    Thank you for your help.

    Thank you Frank,
    Let me be more clear - I hope this is not too confusing.
    I have an adf table (ID ItemsTable) that has the following columns:
    Select, Object Name, Sequence, Item Name, Source
    I set autosubmit on the Select column to true
    I set the ID to Select
    The partialtrigger value on the table is ItemsTable:Select
    I have a command button in the table header labeled "View Details".
    I have a view object (Obtotal) with the following syntax
    select object_name from
    objects
    where object_name = :vitem;
    In the page def, I created an action to execute the VO and pass #{row.ItemName} into the vitem bind variable. I also invoke the action.
    The disabled property of my View Details button is
    #{bindings.Obtotal.estimatedRowCount >=1}
    The partialtrigger value is ItemsTable:Select
    I would expect that each time I select a different row, the row.ItemName would be passed to the view object which would execute and return different results based on the vitem passed.
    I would expect my View Details button to toggle (enabled/disabled) based on the whether or not there are results in the Obtotal iterator.
    I must be missing something because My View Details button is always enabled.
    Thank you for your help.

  • Radio button in a Table -Only one row/radio button selection to be possible

    Hi experts,
    I have a requirement from customer to have a radio button inside a table of a WebDynpro ABAP application. For example, a table containing list of mobile numbers.
    The columns has
    Mobile Model, Cost, Company name, and a radio button named choice.
    Only one record and hence one radio button can be chosen at a given time.
    When the user clicks on the radio button choice corresponding to the row of the mobile of his choice, the row should get lead selected .
    When the user chooses a different choice radio button (corresponding to another mobile) the old radio button choice should get deselected, new row and its radio button should be lead selected.
    Can you give me the code how to deselect the remaining radio buttons when a user selects on one Radio button

    Hi Sandeep ,
    Have a look at the events of table UI element and its paramaters , Here's the link.
    [Link|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2d/390e422dfcde2ce10000000a1550b0/content.htm]
    The event 'Onselect' or 'OnLeadSelect' provides 4 standard paramaters , out of which , OLD_LEAD_SELECTION/OLD_ROW_ELEMENT is one of them.
    So you could use this element and set the attribute value (Which is bound to the radio button) to abap_false.
    Although I am not sure as to which event ight trigger ( ON_LEAD_SELECT / ON_SELECT ).:)
    Thanks,
    Aditya.

Maybe you are looking for

  • ORA-12154 Error

    Hi there, I am having a problem connecting to a database that we have just created on a new server. The connection is fine using SQL*PLus, Enterprise Manager or SQL Developer, but we have an application that connects to this database sitting on the s

  • Copy and paste without font & size attributes

    isn't there a way to copy and paste text so that it takes the attributes of the recipient app instead of the "copied" attributes? ie: I want a copied 12pt Times Word sentence to appear as the defined Filemaker field font/size when pasted into Filemak

  • Cannot re-unite T3 data with Palm Desktop! Please helP!

    Hi folks I would be very grateful for some help with restoring my data. After a laptop rebuild by my company Helpdesk-er, my self-installed Palm Desktop stopped working with an "invalid configuration message. It had previously been working - for year

  • MacBook Pro 15" not responding after boot-up?

    My MacBook Pro 15" has an issue and won't work! Yesterday I went to my MB to load it up for my daily commute into the city. As I was loading my bag I tried to disconnect my ext. backup drive that works via Time Machine. When I left it the night befor

  • Export Web Gallery

    Is there a way to export your photos to a web gallery (not web page) and host it yourself? I like the flash of the web galleries, but I want to use my own server.