Use dpendent dropdowns in dataTable

The problem is how to populate/refresh the item list of a dropdown menu in a row af a dataTable according to the changes of an other component in the same row.
As an example consider the case when the rows of the table corresppond to Project entities, and for each project we can assign a departement and a project leader among the employees of the selected departement. NOw if the user select a departement for a project then the dorpdown for project leader should be populated with the employees of the selected departement.
I had two ideas but unfortunately none of them works. The first one is to generate the list of SelectItems in the Project entity (not a good programming practice). That is
<f:selectItems value="#{project.projectLeaderSelect}">so in the getProjectLeaderSelect() method of the entity we have information about the selected project leader.
The problem of this solution that the JSF framework does not allows us to bind input elements to none managed bean properties. I got exception - I suspect that was the reason.
The other way would be to send request parameters when populating dropdowns, but unfortunately getters are called several times, and the sent request parameters may be not living at any call.
At the end I solved the problem a bit strange way. I generated a prepopulated project leader dropdown for each possible departement, and rendered only one according to the present value of the departement attribute of the project. Of course, it is not a general enough way but for our problem was working, the possible values of both dropdowns were static.
I am still looking for a better solution.

Hi,
Please go through the sample application AppModel which is available at:
http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
Hope this helps.
Thanks,
RK.

Similar Messages

  • How to use a dropdown in a workbook which can work in different queries?

    Hi Experts,
            I have created a workbook which can display the query by using the 'Push Button'. One query is based on material analysis and another one on product analysis.
            It works good..
            In that workbook, I want to use a dropdown so that it can display the required key figure. (Note : In both the queries, key figures are same.)
            While selecting the keyfigure option in the properties of dropdown, the target data provider is not visible.
            So, pls help me to use the dropdown which can work in both the queries.
    With Regards,
    Yokesh Kumar.

    Hi,
    After fixing the error in the role I noticed that all I should do is to publish the querry in a new role.
    From that moment a user that is tied to new role can read the old report using the rights associated in a new role.
    Thanks for help.
    Regards. Leszek

  • What is the use of  dropdown box in wad in bi-7

    what is the use of  dropdown box in wad in bi-7

    Hi,
         Dropdown box in WAD is for changing the output of full or particular part of template at runtime.
    For Eg. suppose u have states in dropdown box and u want the output of according to particular state then u select that state from dropdown box. so the output comes accordingly.
    For doing these u have to assign a data provider to dropdown box which query give the output of states. and in the property of dropdown box u hav to assign the item which will affect by this dorpdown box.
    I think it will help u.
    Assign Point if it helps.
    Regards,
    Ravi

  • Using Cascading Dropdown Boxes

    hi all:
          how to using Cascading Dropdown Boxes in visual composer?

    not clearly understand what i mean?
    for example there are two drop-down list,when I choose one for product group ,then in the second one only i can choose the product of the group i choose.

  • Using a dropdown box to change the specified value of a radio button?

    I have a form that generates the body text for an email.
    First there is a dropdown box in which the choices are either "red" or "blue"
    Further down the page, there is a radiobutton list with 2 items "available" and "unavailable".
    The specified values for these items (as defined on the binding tab) are "have blue hats" or "do not have blue hats".
    This value is concatenated in the email body textfield which is to be copied by the user to an email body:
    Concat("Dear", NameField, "," We ", RadioButtonList, " today. ")  // Dear Persons Name, We have blue hats today.
    Is there any way to change the value of the selected radio button based on the selected dropdown choice?
    So if the user selected "red" in the dropdown field, the radio button values could become  "have red hats" or "do not have red hats"?
    Or perhaps there is a better way from the start?
    Thanks!

    Ok, so now I've done that...
    But is there a way to change that value with another field (ie when a user chooses "red" or "blue" in a dropdown box) so that the concatenated message reflects both the users choice of color and the availibility?
    I'm guessing I should probably use an intermediary text box and put
    InterText.rawValue = Concat ("We have ', dropdown1, " hats today") in the change event of the available radio button and:
    InterText.rawValue = Concat ("We do not have ', dropdown1, " hats today") in the change event of the unavailable radio button.
    then concatenate that box in the final textbox.

  • Using a dropdown to set a radio button

    I've been searching and searching in vain, trying many different things can I cannot seem to find an answer already or stumble on similar code to help.
    I've got a dropdown, then when you select different values set different fields on the form. That part works fine stuff like this in the custom validate:
    if (event.value == "Thing1") {
      this.getField("DESC01").value = "Words that fill in a desciption box.";
      this.getField("DESC02").value = "More words that fill in another descrption box";
      this.getField("F_SKILL1").value = "1";
      this.getField("RB_SKILL1").isBoxChecked(1);
      this.getField("F_SKILL2").value = "1";
      this.getField("F_SKILL3").value = "1";
    } else if (event.value == "Thing2") {
      this.getField("DESC01").value = "Different words that fill in a desciption box.";
      this.getField("DESC02").value = "More different words that fill in another descrption box";
      this.getField("F_SKILL4").value = "1";
      this.getField("RB_SKILL1").isBoxChecked(0);
      this.getField("F_SKILL5").value = "1";
      this.getField("F_SKILL6").value = "1";
    etc, etc. I've got a few different else ifs but they all follow this kind of format. There is are also radio button next to the skills on the sheet to visually display that skill is known. So I'd like to turn that radio button on. My isBoxChecked isn't working, and I expect that's because it doesn't work that way. I have a lot of radio buttons on the form, but they all have 1 choice in them none are groups. Again, I'm using this as a visual display that SKILLX is known. The area I've dropped the radio button onto the sheet is a very small circle which is why I am trying to use a radio button as it's visually similar.
    If there is a better solution to what I'm trying to do I'm happy to try that, or if someone can tell me what I'm doing wrong that'd be super
    Thanks!

    Not quite sure I'm getting what you are laying down...
    So in the dropbox, under options I should set the export value of Thing1 choice to RB_SKILL1 and then in my validate I should include this.getField("RB_SKILL1").value = 'Yes' ?
    Or I should just set the export value of Thing1 to this.getField?
    Thanks
    Oh, using a check box I was able to get this working using the export values set for Thing1 option, most excellent! Thank you very much!

  • How to use 2 Dropdown box in webapplication for date range selection

    Dear all,
    I am working on a report that will show 2 drop down boxes. These should be used as a date range.
    This works fine if I use 2 variables as a date range on 0CALYEAR. However I dont want the user to fill in the dates but selecting the dates with 2 drop down boxes.
    I cannot manage to get this to work. I saw some comments about user exits in the forum but I cannot figure it out if there is an easier way.
    Could you give me an idea of what to do?
    Thanks a lot,
    Andreas

    Hi,
    If you want the user to select the date directly rather than entering, you need not to have a dropdown menu in WAD. Directly go to the query which you have selected for the object in WAD, there create a variable with calendar. Put it mandatory, so that the user selection of the date will be mandatory. The variable will be automatically be available when you execute the template inn the browser.
    Assign points if this helps u.
    Regards,
    Koundinya.

  • Using a Dropdown Value to Set Criteria for Queries

    Hey,
    I am first trying to create a Dropdown box, should I just use HTML or should using APEX components... The values are stored in a table.
    I want to have the users have the ability to select a value from the drop down, and depending on what value they picked, it would display reports for that value selected either on a seperate tab or the same tab.
    Could you guys help me figure this one out?
    Basically I don't want to change my queries everymonth, since the value that users would select is a month value. Any ideas?
    Any help is appreciated... Thank you.

    Hi Max,
    First, if you are using an APEX development environment, by all means, use the APEX components. They make life a lot easier compared to hand coded HTML.
    Next, the ability to configure an SQL WHERE clause with the selection from a drop down list is a "bread and butter" APEX function. For example, if you have an LOV with the months in it (P10_MONTH), then you could put the following line in your report's WHERE clause:
    AND :P10_MONTH = EXTRACT (MONTH FROM YOUR_DATE_COLUMN)
    This assumes that the LOV that is bound to P10_MONTH has an ID and a DESCRIPTION where the ID is configured to be the month's number (1 for Jan, 2 for Feb etc).
    Note that for production code you would also have to handle the year as well.
    It sounds like you are new to APEX. If so, take some time to work through the two day developer document. This is a very quick (couple of days) way to get up and running with APEX. In general, the learning curve with APEX is much much easier that with environments like J2EE and .NET.
    For your immediate project, look explicitly for the terms "bind variable" and List of Values (LOV).
    Hope this helps,
    Cheers,
    Patrick Cimolini

  • Vector or ArrayList  use for dropdown with more than 1000 entries

    Hi Friends
    I am having more than 1000 entries of different TimeZone's which i need to display in a dropdown list.
    i am not able to decide whether i need to use a Vector or Arraylist for storing these values.
    please let me know which one will be best suited to use in case the list entry is more than 1000 characters.
    waiting for a positive reply from your side.
    Thanks & Regards
    Vikeng

    A JComboBox can be constructed from a Vector (rather than any other sort of List) without having to implement your own ComboBoxModel. (JList is similar).
    I agree with kajbj - a control like this with a thousand entries is rather poor interface design. One exception might be if the entries are sorted in some way, and you "jump" to the appropriate place in the list as the user types.

  • Using table in h:dataTable

    I'm trying to use <table> tags inside an h:column tag in an attempt to control formating with colspan and rowspan attributes like this:
    <h:dataTable var="data" value="#{upConference.conferences}" columnClasses="vert"
    rowClasses="evenrow, oddrow">
    <h:column>
    <table border="1" width="800">
    <tr>
    <td><h:outputText value="#{data.START_DATE}"/>
    <h:outputText value=" - #{data.END_DATE}"/></td>
    <td><h:outputText value="#{data.Some_other_field}"/></td>
    <td><h:outputText value="#{data.Some_other_field}"/></td>
    </tr>
    <tr>
    <td rowspan="3"></td>
    <td rowspan="3">
    <h:outputText value="#{data.Some_other_field}"/>
    Address1
    Address2
    city, state, zip
    </td>
    <td><h:outputText value="#{data.Some_other_field}"/></td>
    </tr>
    <tr>
    <td><h:outputText value="#{data.Some_other_field}"/></td>
    </tr>
    <tr>
    <td>Come see us! NPP Booth Number: </td>
    </tr>
    </table>
    </h:column>
    </h:dataTable>
    The <h:outputText> field are rending outside the tables so, I'm wondering if this can be accomplished or if it's a pipe dream.
    Thanks

    You may use verbatim tags to enclose html tags.
    <h:dataTable ...>
    <h:column>
    <f:verbatim>
    html codes here ...
    </f:verbatim>
    <h:outputText ...>
    <h:outputText ...>
    <h:outputText ...>
    <f:verbatim>
    more html codes here ...
    </f:verbatim>
    </h:column>
    </h:dataTable>
    Hope that helps.
    Billy

  • JavaScript: Use a dropdown to change visibility of other fields

    Hello
    I'm new here and hope you can help me.
    I have no JavaScript experience. I've tried a lot, but it doesn't work so far.
    I use Adobe Acrobat X (Version 10.1.9).
    My idea:
    A User should select his country in a dropdown. Depending on the user's selection, appears another dropdown. If no country is selected, no other dropdown is visible.
    When the user select the country "England" the dropdown "EnglandAreas" should get visible.
    When the user select the country "Scotland" the dropdown "ScotlandAreas" should get visible.
    etc
    Now I think there are two ways.
    1. For each country it has an own area dropdown. When the user opens the document, all area dropdowns are hidden. The User select his country and a JavaScript set the correct area dropdown visible.
    2. For all countries there is one area dropdown. When the user opens the document, the area dropdown is hidden. The User select his country and a JavaScript fills the area data of the selected country in the area dropdown and set the area dropdown visible.
    Which method makes more sense or is there a third method?
    One of my non-working code (try method 1):
    var co = this.getField("Country");
    var aren = this.getField("AreaEN");
    if (co== "England") {
    event.value = (aren.display = display.visible)
    } else {
    event.value = (aren.display = display.hidden)
    Thanks for all the help.

    Where is that code placed, exactly? It should be something like this:
    // Get a field value and a field object
    var co = this.getField("Country").valueAsString;
    var aren = this.getField("AreaEN");
    // Set the visibility of the AreEN field based on the selected value
    if (co == "England") {
        aren.display = display.visible;
    } else {
        aren.display = display.hidden;
    But the correct code does depend on where it's placed.

  • Using the SAPbobsCOM.Recordset & DataTables

    I'm trying to find the best way to tie the SAPbobsCOM.Recordset object (based, for example, on a query to return all Employees) to a more .NET compatible data object such as a datatable or dataset.
    In other words, for things such as combo boxes, datagrids etc in .NET how are you guys usually binding data from SBO?
    I can just write a call directly to the DB, but wanted to go through the SDK if possible.
    Thanks!

    I actually ended up putting this into a utility .dll, but here's the function...
    Public Function ConvertRecordset(ByVal SAPRecordset As SAPbobsCOM.Recordset) As DataTable
            '\ This function will take an SAP recordset from the SAPbobsCOM library and convert it to a more
            '\ easily used ADO.NET datatable which can be used for data binding much easier.
            Dim dtTable As New DataTable
            Dim NewCol As DataColumn
            Dim NewRow As DataRow
            Dim ColCount As Integer
            Try
                For ColCount = 0 To SAPRecordset.Fields.Count - 1
                    NewCol = New DataColumn(SAPRecordset.Fields.Item(ColCount).Name)
                    dtTable.Columns.Add(NewCol)
                Next
                Do Until SAPRecordset.EoF
                    NewRow = dtTable.NewRow
                    'populate each column in the row we're creating
                    For ColCount = 0 To SAPRecordset.Fields.Count - 1
                        NewRow.Item(SAPRecordset.Fields.Item(ColCount).Name) = SAPRecordset.Fields.Item(ColCount).Value
                    Next
                    'Add the row to the datatable
                    dtTable.Rows.Add(NewRow)
                    SAPRecordset.MoveNext()
                Loop
                Return dtTable
            Catch ex As Exception
                MsgBox(ex.ToString & Chr(10) & "Error converting SAP Recordset to DataTable", MsgBoxStyle.Exclamation)
                Exit Function
            End Try
        End Function

  • Getting the selected row (selected using radio button in dataTable)

    I have problem getting the selected row.
    If not mistaken, the way used in BalusC's website sets the value to the backing bean using the valueChangeListener.
    Can I set the value to the DTO instead?
    using something like
    private boolean selected;
    public void setSelectedItem(ValueChangeEvent e){
    this.selected = true;
    }  If i use this way it throws NoSuchMethodException. I have no idea why. I did this for the checkbox and it works fine. I don't know why it doesn't work for radio buttons.

    The DataTable is below :
    <h:panelGrid columns="1" columnClasses="table_align">
              <t:dataTable id="table1" value="#{sysMgrBean.locationList}"
                   var="location" rows="5" styleClass="table" headerClass="tableHeader"
                   rowClasses="tableRowOdd, tableRowEven" width="500">
                   <t:column>
                        <f:facet name="header">
                             <h:outputText styleClass="lbl" value="#{lbl['no']}" />
                        </f:facet>
                        <h:outputText value="#{location.id}" />
                   </t:column>
                   <t:column>
                        <f:facet name="header">
                             <h:outputText styleClass="lbl" value="#{lbl['slct']}" />
                        </f:facet>
                        <h:selectOneRadio  value="#{location.selected}"
                             onfocus="dataTableSelectOneRadio(this);"
                             onclick="enableInput(this.form,this)" valueChangeListener="#{location.setSelectedItem}">
                             <f:selectItem itemValue="" value="true" />
                        </h:selectOneRadio>
                   </t:column>
                   <t:column>
                        <f:facet name="header">
                             <h:outputText styleClass="lbl" value="#{lbl['cd']}" />
                        </f:facet>
                        <h:outputText value="#{location.loccd}" />
                   </t:column>
                   <t:column>
                        <f:facet name="header">
                             <h:outputText styleClass="lbl" value="#{lbl['desc']}" />
                        </f:facet>
                        <h:inputText id="Description" value="#{location.descr}" disabled="#{location.disabled}" />
                   </t:column>
              </t:dataTable>In the DTO :
    private boolean selected;
    public void setSelectedItem(ValueChangeEvent e){
    this.selected = true;
    }

  • How to use SelectOneRadio within a DataTable

    Hi,
    I have a requirement to have a radio button for each row in the datatable. It is to enable selecting one row(only one row) from the table and proceed to the next page. The table should look like
    o Name1 address1 city1 state1
    o Name2 address2 city2 state2
    o Name3 address3 city3 state3
    o Name4 address4 city4 state4
    Next>>
    The data structure I have is a collection on objects of type person.
    Class person
    String id;
    String name;
    String address;
    String city;
    String state;
    getters and setters
    I tried to use SelectOneRadio within a Column, but that didnt help. As obvious it treats each rows radio button as a seperate radio group.
    <h:datatable var="person" value="#{personList}>
    <h:column>
    <h:selectOneRadio>
    <f:selectItem itemValue="#{person.id}"/>
    </h:selectOneRadio>
    </h:column>
    <h:column>
    <h:outputText value="#{person.name}"\>
    </h:column>
    </h:datatable>
    I am new to JSF. I searched thru some JSF websites and book, but couldnt find a solution. Can someone help me solve this.
    Thanks in advance
    Rani

    Hi,
    after some time probing into this issue I think none of the many proposed sollutions really solves the underlying problem: Working around the issue becomes much to complicated for JSFs stated design goal of easing development. Certainly for such a common case scenario no workaround should be neccessary, especially given the fact that JSTL is easily able to model this without the need for workarounds!
    In my opinion JSF TagLib implementations should attempt to solve this in a coming version.
    One part of the sollution might be to make <f:selectItem> search it's parent element recursively, i.e. allow the expected container element to be the nearest direct or indirect parent that's suitable. This would allow developers to envelope a <h:dataTable> tag with a <h:selectOneRadio> element. Any <f:selectItem> element inside would therefore be part of a single choice radio button selection, regardless of them being distributed over multiple rows or columns.
    Another part of the sollution might be to allow <h:selectOneRadio> and similar tags to be substitutes for <h:column> tags inside tables. This way a complete column of radio buttons could be used to chose a single value, thereby allowing multiple columns of radio buttons to choose multiple values within the same table.
    Please forward this suggestion for enhancement in kind to the expert group working on the further development of the JSF taglibs. I guess many people besides me already use it as a classical example of complications using JSF during lectures about the tomic, and at least in this case the problem seems completely solvable.
    Kind regards,
    Sascha Baumeister
    software architect, university lecturer and former JCP spec lead JSR086

  • Possible to allow the user to navigate to form sections using a dropdown?

    I am designing a realtively long PDF form that has many sections.
    I am hoping that I can create a TAG inside the PDF form that I can reference using drop downs that the free Reader will support
    The desired functionality is :
    User activates drop down - selects the section they want to see if it is not already visible - and the reader moves them to that location -
    so they can read the data at that location -
    Can you please help me by indicating :
    1. Is this possible ?.
    2. Where I can find a useful example for doing something of this sort ?
    Thank You very much

    Fundamentally, you have two possibilities:
    a) create Named Destinations where you want the user to get to, and then make your drop so that the destination name will be defined as return value, so that you can go to it.
    b) define the first field of a section, and put its name as return value in the drop down (aka combo box). Then set the focus to that field.
    HTH.
    Max Wyss.

Maybe you are looking for

  • How to disable the future dates in Date pick calendar - SQL Server Reporting Services

    Hi All,           I have a scenario to run the report only for the Past days, and i have datepick calendar as a parameter for selecting Start Date and End Date. I want to control the Users by not to select the Future Dates in the End Date. In Other W

  • Using Motorola I870 as modem for Macbook

    Does anyone have any idea how to use my Nextel Motorola I870 as a modem to connect my MacBook to the internet through Bluetooth? I am having big problems making that happen. I have been on the phone with Apple, Motorola, Bluetooth and Nextel and they

  • Unaligning background behind text

    I put a background behind my headline text, but when i preview, the background jumps about 4 rows away from the text, whats going on I had initially applied character style before dropping the coloured box behind.

  • File has to be converted by BinHex 4.0.

    Hello, My boss is using a 8703.  From time to time he is getting an error message when opening attached files out of e mail.  The error says the file has to be converted by BinHex 4.0.  In this particular case it was a PDF document I sent to him.  An

  • Apps crashing on ipod touch..? (4th gen)

    I've had this problem for two weeks. I try to open the apps, it looks as if it's going to open, then crashes and the device returns to homescreen. Fair enough, I've had this problem before. All of those times, however, I simply turned the iPod off an