Custom UIInput with more than one bean bound value

Hi Experts,
I'm creating a custom component which will act as a search bar (thus it will contain a text input area) and which contains a css dropdown menu from which the user will be able to select the type of search. In other words this component should have two value bindings, one for the search string and one for the selected search mode. I've managed to get the search working by extending UIInput and binding the search string to my component's value attribute, but I can't get the selected search mode to reflect in the bean. In my decode() method I retrieve the value from the post and it's correct and everything, but if I call the setter on my component that value is never propogated to the value binding and thus the bean.
Please have a look at some of my code below:
The component tag looks something like this:
<my:component value="#{bean.searchString}" searchOptions="#{bean.searchOptions}" selectedOption="#{bean.selectedOption}" actionListener="#{bean.search} />
{code}
My decode method in the renderer is as follow:
{code}
public void decode(FacesContext context, UIComponent component) {     
  if (!component.isRendered()) {
    return;
  SearchBoxComponent searchBox = (SearchBoxComponent)component;
  String clientId = searchBox.getClientId(context);
  Map<String,String> requestParameterMap = context.getExternalContext().getRequestParameterMap();
  // Set the search string - this works fine
  String searchString = (String)requestParameterMap.get(clientId + ":searchString");
  searchBox.setValue(searchString);
  // Set the selected option which is stored in a hidden field - this works fine
  String selectedOption = (String)requestParameterMap.get(clientId + ":selected_option");
  searchBox.setSelectedOption(selectedOption); // This is called correctly, but it doesn't update the value binding's value?
  // Check whether the search button was pressed and queue action
{code}
The component's code is below:
{code}
public class SearchBoxComponent extends UIInput {
  // getValue and setValue is inherited
  public String getSelectedOption() {
    if (selectedOption == null) {  
      ValueExpression valueExpression = getValueExpression("selectedOption");
        if (valueExpression != null) {
          selectedOption = (String)valueExpression.getValue(getFacesContext().getELContext());
     return selectedOption;
  public void setSelectedOption(String selectedOption) {
    this.selectedOption = selectedOption;
    // Tried this - didn't help
    // ValueExpression valueExpression = getValueExpression("selectedOption");
    // valueExpression.setValue(getFacesContext().getELContext(), selectedOption);
{code}
And finally part of the tag class:
{code}
protected void setProperties(UIComponent component) { 
  super.setProperties(component); 
  SearchBoxComponent searchBox = (SearchBoxComponent)component;       
   if (selectedOption != null) { 
          searchBox.setValueExpression("selectedOption", selectedOption); 
// Standard getter and setter
{code}
Thank you,
Ristretto
Ps. When and where should setSubmittedValue() be used, and what should I do like in this case if there are two "submitted values"?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Could you describe more in your selectable choices in your combo box?
If you ask user about which are their favourite fruits,
You can use checkbox for selecting.
If you ask user about their gender,
You can use radio button.
You can even use more than one combo boxes for displaying result.
Could you describe your requirement in detai? If we do not know your choice for selecting, you cannot suggest which
component to use and how to implement.

Similar Messages

  • BizTalk:How to share customized pipeline with more than one BizTalk Application

    I have a new BizTalk application which will use a customize generic pipeline . This pipeline has been used in an existing BizTalk application.
    When I use BizTalk Server Administration to add this pipeline assembly as a resource for a new BizTalk application, it shows error message: "this biztalk assembley has already in store and is either associated with another application or another type".
    My questions is how to share the generic pipeline component with many BizTalk application?
    Many Thanks.

    Hi,
    If you plan on using the deployed pipeline across multiple applications in BizTalk you have two options:
    1) The Current Application (in BizTalk Server Administration Console) should have the other application [where the pipeline
    is deployed] as reference.
    right click the "Current Application" and select "Properties"
    on the "Properties" page, left hand side, select "References"
    On the right-hand side, use "Add" to add the "Other Application" as a reference.
    Refer: How
    to Add a BizTalk Assembly to an Application
    Doing so will ensure that ALL resources (maps, schemas, orchestrations, send ports, receive locations, rules, etc.) deployed
    for "Other Application" are available/reprehensible in "Current Application".
    2)  Create a common BizTalk application on BizTalk Admin Console and add your custom pipeline assembly in that new application
    as a resource. With this, you don't need any other application to be started apart from this common application. Any other application who wants to use this pipeline will refer this common application.
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • Fill BEx Variable with more than one value via Custom Exit

    Dear SDN comunity,
    I want to fill a BEx Variable via a custom exit. My problem is, I don't know how to fill this variable with more than one value.
    I try to give you some background info based on an exaple:
    <u><b>Variable-Details</b></u>
    <b>Type of Variable:</b> Characteristic Value
    <b>Variable Name:</b> ZCCD
    <b>Description:</b> Company Code Selection
    <b>Processing by:</b> Custom Exit
    <b>Characteristic:</b> Company Code
    <b>Variable Represents:</b> Multiple Single Values
    <u><b>This is the used ABAP code:</b></u>
    WHEN 'ZCCD'.
    CLEAR l_s_range.
    l_s_range-low = '2002;2004'.
    l_s_range-sign = 'I'.
    l_s_range-sign = 'EQ'.
    APPEND l_s_range TO e_t_range.
    <u><b>The system returns this message:</b></u>
    Value "2002;2004" is too long for variable ZCCD
    appreciate your help!
    //michael

    Eugene, Marcus
    it works now, thx a lot!
    Please find attached the final code:
    CLEAR l_s_range.
    l_s_range-low = '2002'.
    l_s_range-sign = 'I'.
    l_s_range-<b>opt</b> = 'EQ'.
    APPEND l_s_range TO e_t_range.
    CLEAR l_s_range.
    l_s_range-low = '2004'.
    l_s_range-sign = 'I'.
    l_s_range-<b>opt</b> = 'EQ'.
    APPEND l_s_range TO e_t_range.
    (Delta to Marcus's code is bold)

  • Get the data with more than one of the desired value

    Hi,
    I need to pull the records with more than one value of 'Other' on the delivery days fields.
    The delivery fields are mon,tue,wed,thu,fri and sat that tells the where the item will be delivered. The value can be Home, Work, or Other.
    Here is the Sample data:
    cust_id: 123
    item: newspaper
    mon: Home
    tue:Work
    wed: Other
    thu: Home
    fri: Other
    sat: Other
    And here is my query so far.
    select
    cust_id,
    item,
    mon,
    tue,
    wed,
    thu,
    fri,
    sat,
    sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1
    else 0 end) as day_ctr
    from customer
    Could you please help me with the right formula I need to get this?
    Thank you in advance..

    First
    DESC customer
    Second
    Can you explain what you are trying with
    sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1 else 0 end) as day_ctr
    Third
    Usually it's helpful a example of the result you want...
    Perhaps you want this
    select DECODE(mon,1,(select distinct mon from customer), 'OTHER') mon,
            DECODE(tue,1,(select distinct tue from customer), 'OTHER') tue,
            DECODE(wed,1,(select distinct wed from customer), 'OTHER') wed,
            DECODE(thu,1,(select distinct thu from customer), 'OTHER') thu,
            DECODE(fri,1,(select distinct fri from customer), 'OTHER') fri,
            DECODE(sat,1,(select distinct sat from customer), 'OTHER') sat from
    select
    COUNT(DISTINCT mon) mon,
    COUNT(DISTINCT tue) tue,
    COUNT(DISTINCT wed) wed,
    COUNT(DISTINCT thu) thu,
    COUNT(DISTINCT fri) fri,
    COUNT(DISTINCT sat ) sat
    from customer
    )

  • Reversing Landed Cost document with more than one vendor

    Hi Experts,
    Reversing Landed Cost document with more than one vendor:
    My client can reverse a landed cost document with One Vendor, but cannot with multiple vendors. I have also tested this in 8.8 PL10. Here is a brief description:
    Created Landed cost by selecting 2 vendors in the Vendor field.
    After you picked one vendor, you go to the vendor code/name again then choose another vendor you
    need, once you picked, the system will ask you whether you want to delete the previous data, then
    you say no, after then you will see the vendor name became "different vendors" and code be "********"
    (on the vendor tab: you will see two vendors)
    To Reverse Landed Cost we do the following with Landed Cost documents that only have one vendor:
    I can copy from the Landed Cost document (on the right-bottom corner) while creating new one with
    zero amount to reverse, which is ok; but for multiple vendors, the list of vendors onlyshows one of
    the vendors for Good Receipts & Landed Cost.
    Cannot copy from a Landed Cost document wioth more than one vendor to reverse this Landed Cost.
    To be albe to copy from a previously created Landed Cost document (with multiple vendors) as you
    can with one vendor to reverse the transaction.
    Can this functionality be added to future versions?

    Take a look at business area and groupings in they payment program settings...
    I am not sure what version you are on but the following link for 4.7 should provide some valuable information...
    http://help.sap.com/saphelp_47x200/helpdata/en/01/a9be64455711d182b40000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/01/a9be64455711d182b40000e829fbfe/frameset.htm
    Grouping Open Items and Individual Payments
    Wherever possible, the payment program will always group items together for payment.
    The payment program can only group together open items for payment if the open items in an account have the same:
    1. Currency
    2. Payment method in the item
    3. Bank in the item
    4. Contents of the grouping fields (if a grouping key is specified in the customer or vendor master record)
    You can also pay open items from different company codes together, as well as customer and vendor line items.
    Items in an account are not grouped together if you:
    1. Make payments separately per business area. This procedure entails separate payments being created per business area.
    2. Want to make individual payments
    Items in which a payment method is specified are not grouped with items in which no payment method is specified.
    You define the required grouping key in the IMG for Financial Accounting under Accounts Receivable and Accounts Payable -> Business Transactions -> Outgoing Payments -> Automatic Outgoing Payments -> Payment Method/Bank Selection for Payment Program -> Define Payment Groupings.
    In our system, if the business area is the same, there will be one ZP document with one line with a posting key of 25. Otherwise there will be many individual 25 posting key lines with.

  • Function with more than one return value

    Hi
    Please let me know how to write a function with more than one return value and in what scenario should we go for this option.
    Thank you

    user12540019 wrote:
    Please let me know how to write a function with more than one return value and in what scenario should we go for this option.Yes. And the following is the correct approach (using OUT variables is not!) - you deal with the multiple values as a data structure. This example uses an custom (user-defined) SQL data type as the structure.
    SQL> create or replace type TXYcoord is object(
      2          x       number,                  
      3          y       number                   
      4  );                                       
      5  /                                        
    Type created.
    SQL>
    SQL>
    SQL> create or replace function fooCoordinate( someParam number ) return TXYCoord is
      2  begin                                                                         
      3          -- doing some kind of calculation using input parameters              
      4          --  etc..
      5
      6          -- returning the multiple return values as a proper data structure
      7          return(
      8                  TXYcoord( 0, 0 )
      9          );
    10  end;
    11  /
    Function created.
    SQL>
    SQL> -- selecting the data structure
    SQL> select
      2          sysdate,
      3          fooCoordinate(123)      as XY
      4  from       dual;
    SYSDATE             XY(X, Y)
    2010-02-01 08:49:23 TXYCOORD(0, 0)
    SQL>
    SQL> -- selecting the properties/fields of the data structure
    SQL> select
      2          sysdate,
      3          treat( fooCoordinate(123) as TXYcoord).x        as X,
      4          treat( fooCoordinate(123) as TXYcoord).y        as Y
      5  from       dual;
    SYSDATE                      X          Y
    2010-02-01 08:49:23          0          0
    SQL>

  • Is there a stereo bluetooth headset that can pair with more than one device at a time?

    Is there a stereo bluetooth headset that can pair, i.e. multipoint, with more than one device at a time?
    Are the MacBook and iPhone 4 capable of multipoint bluetooth technoloagy?
    The goal is for my wife to be able to watch her Korean TV soap operas on her MacBook and still receive a call on her iPhone 4 via a stereo bluetooth headset.
    I was looking at the Motorola S10-HD but after further review saw that it only pairs with one device at a time.
    Appreciate any and all input. My Googling has returned no results.
    Rick

    TeslasBB wrote:
    pairing my BB8330 with my blue tooth earphone(TM:jawbone) and my microsoft sync thats in my car simultaneously? if i pair with the car, will i have to pair my jawbone all over again?
    You can only pair one device at a time to your 8330, or any other phone for that matter.  The "pairings" are saved to the phone, you can use one or the other and you won't have to pair it again.  Once you turn your bluetooth device on and the phone is on, they will find each other again.
    Hope this helps,
    John
    Stevie Ray! 1954-1990
    ** Don't forget to resolve your post with the accepted solution.

  • Can I use a magic trackpad with more than one Mac at a time?

    I am attempting to pair a MTP with a second MacBook Pro.  So far I can't get system preferences to find the MTP.
    I am wondering whether the MTP can be paired with only one Mac at a time, and that this is why my MBP won't find it.
    The reason I am thinking this is because the little booklet that comes with the MTP says 'after you pair your MTP with a Mac, you can pair it again with a different Mac.  To do this, you first remove the existing pairing and then pair the trackpad again'.
    Can anyone advise, please?
    If it can be paired with more than one MBP at a time, any suggestions why my system preferences search for the MTP is not producing any results?
    Thanks

    Yes, your keyboard, mouse or trackpad can be paired with multiple Macs.  You can even have multiple keyboards, mice or trackpads paired with one Mac.  The caveat is that the device can only be connected to one Mac at a time.  The device can't be paired or connected with a Mac while it's currently connected to another.
    Pairing a device with 2 Macs will be troublesome if the Macs are located within 33 ft of each other.  The device will connect with the first available paired Mac and then unavailable to the second.   If the Macs are located outside the 10meter range, it's quite easy to power off the keyboard (forcing a disconnect) then walking the keyboard to Mac 2 and powering the keyboard on.   I do this with a keyboard from my iMac to a Mac Mini in another room.
    Captfred

  • Error while running spatial queries on a table with more than one geometry.

    Hello,
    I'm using GeoServer with Oracle Spatial database, and this is a second time I run into some problems because we use tables with more than one geometry.
    When GeoServer renders objects with more than one geometry on the map, it creates a query where it asks for objects which one of the two geometries interacts with the query window. This type of query always fails with "End of TNS data channel" error.
    We are running Oracle Standard 11.1.0.7.0.
    Here is a small script to demonstrate the error. Could anyone confirm that they also have this type of error? Or suggest a fix?
    What this script does:
    1. Create table object1 with two geometry columns, geom1, geom2.
    2. Create metadata (projected coordinate system).
    3. Insert a row.
    4. Create spacial indices on both columns.
    5. Run a SDO_RELATE query on one column. Everything is fine.
    6. Run a SDO_RELATE query on both columns. ERROR: "End of TNS data channel"
    7. Clean.
    CREATE TABLE object1
    id NUMBER PRIMARY KEY,
    geom1 SDO_GEOMETRY,
    geom2 SDO_GEOMETRY
    INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
    VALUES
    'OBJECT1',
    'GEOM1',
    2180,
    SDO_DIM_ARRAY
    SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
    SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
    INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
    VALUES
    'OBJECT1',
    'GEOM2',
    2180,
    SDO_DIM_ARRAY
    SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
    SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
    INSERT INTO object1 VALUES(1, SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(550000, 450000, NULL), NULL, NULL));
    CREATE INDEX object1_geom1_sidx ON object1(geom1) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    CREATE INDEX object1_geom2_sidx ON object1(geom2) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    SELECT *
    FROM object1
    WHERE
    SDO_RELATE("GEOM1", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE';
    SELECT *
    FROM object1
    WHERE
    SDO_RELATE("GEOM1", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE' OR
    SDO_RELATE("GEOM2", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE';
    DELETE FROM user_sdo_geom_metadata WHERE table_name = 'OBJECT1';
    DROP INDEX object1_geom1_sidx;
    DROP INDEX object1_geom2_sidx;
    DROP TABLE object1;
    Thanks for help.

    This error appears in GeoServer and SQLPLUS.
    I have set up a completly new database installation to test this error and everything works fine. I tried it again on the previous database but I still get the same error. I also tried to restart the database, but with no luck, the error is still there. I geuss something is wrong with the database installation.
    Anyone knows what could cause an error like this "End of TNS data channel"?

  • Send email from SAP with more than one attachment

    Hi all,
    How can i send email with more than one attachment and different types of document(doc,pdf,etc.) from SAP to external?
    Besr regards,
    Munur

    Hi,
    I use :
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    the main problem with different attachemts is to genereate the packing_list.
    the packing list is a kind of description of the data table... where ist the start  of an image, end, size...
    "Creation of the entry for the compressed attachment
            objpack-transf_bin = 'X'.                    " it could be an image
            objpack-head_num = lv_head_num_count .  " inital 1 each att  add 1
            objpack-head_start = 1.                     " fix
            objpack-body_start = gv_startnum.    " table with attachments  1. line one
            objpack-body_num = tab_lines.          " how many lines are in the table of attachment
            objpack-doc_size = tab_lines * 255.   " size of the  attachment...
           objpack-doc_type = lv_typ . " 'JPG'.
            objpack-obj_name = 'ATTACHMENT'.
            objpack-obj_descr = lv_stripped_name  " name of the JPG
       APPEND objpack.
       APPEND LINES OF lt_goscontent TO gt_maildata.  " data Table...
    bestreg
    robert

  • By subscribing to Creative Cloud(Photoshop and Lightroom), does it come with more than one license, and is it possible to install it on both Windows and Apple(if it comes with two licenses)? Thank you.

    By subscribing to Creative Cloud(Photoshop and Lightroom), does it come with more than one license, and if it does, is it possible to install on both Windows and Apple's OX? Thanks.

    A Cloud subscription provides for installing working installations on two machines.  You can have mixed operating systems (both Windows and Apple's OX).

  • When I import a cd with more than one artist iTunes separates each individual artist - how do I get it to show the album as a whole rather than individual artist?

    When I import a cd with more than one artist itunes shows each artist's song separately and won't group the album as a whole - this is incredibly frustrating something that Windows media player doesn't do. Does anyone have a simple cure for this annoyance?

    Generally all you need to do is fill in an appropriate Album Artist. For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

  • Can you sign in with more than one apple id on an iPad?

    Can you sign in with more than one apple id on an iPad?

    Only one account can be signed in at a time (via Settings > Store), and if you turn on automatic downloads and/or download past purchases from an account then you risk tying the iPad to that account for 90 days : http://support.apple.com/kb/HT4627

  • Why is all my icloud account linked with more than one apple id?

    why is my iphone 5 merged with more than one account?

    What do you mean by "merged with more than one account" and "linked with more than one Apple ID"?  What exactly are you seeing on your phone?

  • HT1040 Is there a way to place an order with more than one item at a time? For example I am going to make a few books and have them all shipped to me.  Do I have to order and pay shipping for each one individually?

    Is there a way to place an order with more than one item at a time?  for example I am making a few books and having them all shipped to me.  Do I have to order each one separately and pay shipping each time?

    You have to order each book separately, if the books are different. Only multiple copies of the same book can be ordered in the same order, see here
    Regards
    Léonie

Maybe you are looking for