Selected item as URL parameter

HI
I have a dynamic list box on a php page and need to pass the
selected value as a URL parameter. I have tried a few things but
nothing seems to work. I use the parameter to filter a recordset on
the called page.
Thanks
Keith Jakins

keithjak wrote:
> HI
> I have a dynamic list box on a php page and need to pass
the selected value as
> a URL parameter. I have tried a few things but nothing
seems to work. I use the
> parameter to filter a recordset on the called page.
>
> Thanks
> Keith Jakins
>
you can can do that with javascript :) using onChange
statement
or simply send form with GET method
<form method="GET" action="yourpage">
<select name="category">
<option value="1">category 1</option>
<option value="2">category 2</option>
</select>
<input type="submit" value="go"/>
</form>
when you send this form the url must look like this
http//.../yourpage?category=1 or 2 ...

Similar Messages

  • How to get the label on selectOneMenu selected item??

    Hi,
    I'm not able to get the label of the selected item in a selectOneMenu. The code I use to fill it is:
    <h:form id="formNacion" name="formNacion">
    <h:selectOneMenu value="#{modelRtbBean.nacion}" id="selectNacion" onchange="this.form.submit();">
    <f:selectItems value="#{dataRecoveryBean.naciones}" id="idItemsNacion"/>
    </h:selectOneMenu>
    </h:form>
    The dataRecoveryBean has this method to fill the content of the component (basically it creates an arrayList of selectItems by recovering data from a database):
    public ArrayList<SelectItem> getNaciones() {
    if ((naciones == null ) || (naciones.isEmpty()) ){
    naciones = new ArrayList<SelectItem>();
    HDBGeografico hdbGeo = new HDBGeografico();
    SqlMadd sqlmadd = new SqlMadd();
    try {
    AccessBD sscm = new AccessBD( );
    sscm.table(hdbGeo.getSqlNaci());
    // The AccessBD object has a reference to the resultset:
    ResultSet rs = sscm.getRS();
    while (rs.next()) {
    naciones.add(new SelectItem((String) rs.getString(1), (String) rs.getString(2)));
    sscm.Close();
    } catch (Exception e) {
    System.out.println(e.toString());
    return naciones;
    the modelRtbBean setNacion recovers the value, but I need its label too, because it's a kind of description that I use later.
    In the modelRtbBean setNacion method I'm able to access the UISelectItems object, but I cannot get the selected item itself
    public void setNacion(String nacion) {
    FacesContext fc = FacesContext.getCurrentInstance();
    if (fc != null) {
    UIViewRoot viewRoot= fc.getViewRoot();
    System.out.println(viewRoot.getViewId());
    HtmlSelectOneMenu selNac = (HtmlSelectOneMenu)viewRoot.findComponent("bodySTB:formNacion:selectNacion");
    if (selNac != null) {
    System.out.println("Nacion value-htmlSelectOneMenu :" + selNac.getValue() );
    System.out.println(selNac.getAccesskey() + selNac.getTitle() + selNac.toString());
    UISelectItems uis = (UISelectItems)selNac.findComponent("idItemsNacion");
    if (uis != null) {
    System.out.println("I have the element...");
    this.nacion = nacion;
    How could it be accessed this selected item label ??

    I finally did it as you suggest, but I found another way to access the label (I don't know if it could be useful for anybody but here it is) :
    In the setter method linked to the SelectOneMenu, you can put in this code:
    FacesContext fc = FacesContext.getCurrentInstance();
    if (fc != null) {
    UIViewRoot viewRoot= fc.getViewRoot();
    System.out.println(viewRoot.getViewId());
    HtmlSelectOneMenu sel = (HtmlSelectOneMenu)viewRoot.findComponent("viewName:formName:selectOneName");
    if (sel != null) {
    UISelectItems uis = (UISelectItems)sel.findComponent("idItemsName");
    if (uis != null) {
    ArrayList<SelectItem> listElem = (ArrayList<SelectItem>) uis.getValue();
    You could put in in the value item of each SelectItem it's index position in the list, so in the setter method
    of the bean linked to the selectOneMenu you would get the index of the selected item as the parameter of the method
    int index = 1; // For easyness in this example
    System.out.println("Label: " + listElem.get(index).getLabel() + " Value: "+ listElem.get(index).getValue());
    Thanks !!!

  • [php+mysql] How to select a column using URL parameter?

    Hi all,
    I need to select a specific column from a mysql db.
    I have the column name in a URL parameter.
    How can I set a query so that it sounds like this:
    SELECT $_GET['id'] FROM mytable ORDER BY myorder ASC?
    I tried everything with dreamweaver but I cannot get anything
    similar
    to what I need.
    Is there a solution?
    TIA
    tony

    sweetman wrote:
    > How can I set a query so that it sounds like this:
    >
    > SELECT $_GET['id'] FROM mytable ORDER BY myorder ASC?
    You can't do it through the Recordset dialog box. The simple
    way to do
    it is to create this query in the Recordset dialog box:
    SELECT * FROM myTable
    ORDER BY myOrder ASC
    Then go into Code view and locate the following line:
    $query_recordsetName = "SELECT * FROM myTable ORDER BY
    myOrder ASC";
    Change it to this:
    if (isset($_GET['id'])) {
    $col = get_magic_quotes_gpc() ? stripslashes($_GET['id']) :
    $_GET['id'];
    $col = mysql_real_escape_string($_GET['id']);
    else {
    $col = '*';
    $query_recordsetName = "SELECT $col FROM myTable ORDER BY
    myOrder ASC";
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Using (Select All) for report parameter

    Hi there,
    I am Looking for assistance in making the the (Select All) option work for a particular report. The parameter is for product families (which there are about 47 unique results for). The report is also influenced by two other parameters, one being a date type
    i.e 'MTD' 'YTD' 'MAT'. When a long date type such as MAT is selected, selecting all families causes the report to get stuck in an endless loop.
    I've tried creating my own <Select All'> item in the parameter dataset, then I have the opposite issue, the <Select All> selection works perfectly but when I try and tick two or more product families I recieve the following error:
    "An expressions of non-boolean type specified in a context where a condition is expected, near ',' "
    Parameter Dataset:
    SELECT '<Select All>' AS family_description, '<Select All>' AS family_code
    UNION ALL
    SELECT DISTINCT family_description, family_code
    FROM dim_item AS item
    ORDER BY family_description
    Snippet From Main Report Dataset:
    Where
    sales.oe_branch_code IN (@Branch)
    And
    sales.order_status <> 'X' and sales.line_status <> 'X'
    AND (item.family_code IN (@Family) OR @Family = '<Select All>')
    Any help is appreciated
    Thanks Kindly
    SQL Novice

    Hi KCBA,
    I have check the query you have provided the issue cause by the query "
    AND (item.family_code
    IN (@Family)
    OR @Family =
    '<Select All>')" you are using which is incorrect.
    If the parameter @Family have set as "Allow multiple values" then you don't need to add new label "Select All" for the multiple value parameter already have this section, if the parameter @Family is not the multiple values
    parameter and you want to select all the values or just select one, you can modify the query as below which will works fine:
    "AND (item.family_code =
    (@Family) OR
    @Family = '<Select All>'
    If you are using the stored procedure and have issue about add multiple value parameter in the where clause, you are take reference to below similar case about how to create an function to make it work:
    Passing multi-value parameter in stored procedure ssrs
    If I have some misunderstanding, please try to provide more details information about the relationship of all the parameters (Cascading or not ), current result  you have got and expect result you want(Snapshot).
    Any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • How to pass mysql query id through url parameter to a detail page

    Hi there,
    I am a newbie to JSP and I am trying to pass a url parameter to a detail page so that it will query a mysql data query to show the details of that query. How can I write the query on the details page so that it will display the query results on the page. eg select * From data Where = "passed_url parameter_ value". Please i need urgent help on this please.

    <Acknowledged>
    which should be strongly cautioned against even for "newbies".
    </Acknowledged>
    Right, but the code you posted will "work" in a very harmful wayNot always, I used normal Statements last year and I had no problems.
    Even with pretty capible code brakers trying to cause $h!t with my application.
    Just check for invalid datatypes, and for SQL Injections remove stuff like ' or replace with `
    But yes PStat... are the better way.

  • How to retrieve selected item details (Product Id, Quantity) in Action clas

    Hi
    I want to retrieve the selected item details (Product Id, Quantity) in my custom action class .I am calling custom action event after u2018add to cartu2019 button clicked.  I basically need these details to pass to custom BAPI. I can able to retrieve User Name and itemkey successfully.  I Tried to retrieve the product , productID using WebCatItem but I was getting run time error and when I debug the code I can see webCatItem coming  as null. Below is my code. 
    public class Z_AddToBasketAction extends BaseAction {
         /* (non-Javadoc)
    @see com.sap.isa.core.BaseAction#doPerform(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         public ActionForward doPerform(
              ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response)
              throws IOException, ServletException {
              //Cache.Access access = null;
              Map returnValues = null;
              UserSessionData userSessionData =
                   UserSessionData.getUserSessionData(request.getSession());
                   BusinessObjectManager bom =
                             (BusinessObjectManager) userSessionData.
                             getBOM(BusinessObjectManager.ISACORE_BOM);
         String selectedPartnerID = bom.getUser().getUserId();
         String strItemkey=request.getParameter("itemkey");
         WebCatItem webCatItem =     (WebCatItem) request.getAttribute(
                             com.sap.isa.catalog.actions.ActionConstants.RA_WEBCATITEM);
         //If you are looking at Product attributes.
          String att =  webCatItem.getProduct()", "webCatItem.getProductID();
         ZBOM mybom = (ZBOM) userSessionData.getBOM(ZBOM.ZCUSTOM_BOM);
         return mapping.findForward("success");
    Please help
    Thanks
    Aravind
    Edited by: Aravinda Boyapati on Nov 30, 2010 10:21 PM

    Hi Arvinda,
    From which page you are trying to add products in cart? Are you selecting only 1 item at a time and then click on Add to cart button or you select more then 1 items to add into cart.
    You can ceate hidden input filed and set their value through java script when you select any item. If more then 1 items then you can create an arry and set in the request parameter and then retrieve it in your custome class.
    Regards.
    eCommerce Developer.

  • SHOW ALL / HIDE ALL BUTTONS produce error in chm but not in "View Selected Item"

    My SHOW ALL and HIDE ALL buttons work in the View Selected
    Item mode. However, the compiled version generates an error tag:
    Line: 72
    Char: 1
    Error: Object expected
    Code: 0
    URL:
    mk:@MSITSTORE:C\Documents%20and%20Settings\glenn_michaels\RoboHelp%206.0\TCA\!SSL!
    In short, the the compiled chm is located in the SSL. I tried
    adding showhide.js and ehlpDhtm.js to the SSL folder, but that
    didn't make a difference. What is missing? How do I fix this?
    Many thanks in advance...
    glennito

    Mr. Grainge,
    I've tried to follow your instructions to the letter, but I'm
    not having any luck.
    1) I copied the showhide.js to
    a) RoboHelp 6.0 > Project Folder
    b) RoboHelp 6.0 > Project Folder > SSL
    c) RoboHelp 6.0 > Project Folder > SSL >
    MicroSoft_HTML_Help
    2) I pasted btnhideall.gif, btnshowall.gif, printerblue.gif
    into
    a) RoboHelp 6.0 > Project Folder > SSL
    b) they are also listed in RoboHelp 6.0 > Project Folder
    3)The Project Manager > Baggage File originally displayed
    a
    a) Project (Name) folder
    b) ehelp.xml
    c) RoboHHre.Ing
    I opened the Baggage File > Project (Name) folder,
    selected New Baggage File, and added, respectively:
    i. btnhideall.gif
    ii. btnshowall.gif
    iii. ehlpDhtm.js
    iv. printerblue.gif
    v. printerred.gif
    vi. showhide.js
    vii. TCA.fpj
    vii. root.fpj
    4) I also opened rhbag.apj in Notepad. It shows
    a) ehelp.xml and RoboHHRE.Ing accompanied by
    <usercreated>false</usercreated> tags
    b) the remaining baggage files are accomanied by
    <usercreated>true</usercreated> tags
    5) Finally, I used Notepad to display two topic files in
    which the error message identified a Line: XX. In one case the line
    # is 42, in another, 19. In both cases, when I counted lines,
    starting with <body>, I ended up on:
    onClick="JavaScript:hideEm()"
    However, I am none the wiser for my effort and don't know
    what (5) might be telling me.
    6) The only thing I can think of is that the compiled chm
    file is two levels away from the Project Name directory that holds
    all the files. The files live in Robohelp 6.0 > Project Name
    while the compiled help is found in Robohelp 6.0 > Project Name
    > SSL! > MicroSoft_HTML_Help > Project Name.chm.
    Should I be adjusting the Relative Path within the topics?
    Many thanks for your attention and assistance.
    glenn

  • Can't delete multiple selected items in List or Library

    I am experiencing quirky behavior when attempting to delete multiple selected items from a library or list. I select a few items via check box for each item I would like to delete. Then I click the delete button in the ribbon, and all I get is "Deleting...",
    but no page refresh and the items are not deleted. However if I access the same list or library via the App server and select a few items, then hit delete, the page refreshes and the items are deleted.
    So I consulted the Logs and compared the Web Server vs App Server, and the there is a lot of cryptic entries. The few lines that stands out most to me is the App server is:
    ConnectionString: 'Data Source=database;Initial Catalog=Content;Integrated Security=True;Enlist=False;Asynchronous Processing=False;Connect Timeout=15'   
    ConnectionState: Closed ConnectionTimeout: 15
    In fireItemEvent(), for list Building Locations, and item: 1
    In fireSyncItemEvent(), calling ExecuteItemEventReceivers()
    Calling ExecuteItemEventReceivers() for list 0f773535-3b22-4c29-97f1-fd2b70b50dd3 on item 1
    Entering monitored scope (Event Receiver (Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, Microsoft.SharePoint.Publishing.Internal.PublishingWebEventReceiver))
    Releasing SPRequest with allocation Id {FE9A45A8-C042-4223-8FCC-4BD873C93885}
    PublishingWebEventReceiver:ItemDeleting: item 
    These calls are not in the web server log.
    The list I was doing the delete action on was "Building Locations". We are using claims based authentication
    Thanks for any insight or thoughts.
    Brandon

    I confirmed that there is no rewrite tags in either web config (app or web).
    I did download fiddler, and when I try and delete on the web front end I get:
    It tries to access the URL https://mysite/_layouts/_vti_bin/client.svc/processQuery
    Then it sends me here since I have been denied
    <html><head><title>Object moved</title></head><body>
    <h2>Object moved to <a href="https://mysite/_layouts/AccessDenied.aspx">here</a>.</h2>
    </body></html>
    The app server goes to
    http://mysite/_layouts/_vti_bin/client.svc/processQuery doesn't get denied and deletes the items.

  • ExecuteWithParams and URL parameter

    I am implementing a two pages scenario where the first page allows the user to select the Department ID from a menu, which gets passed to the second page via URL. The second page allows the user to refine the search on the employees within the selected department.
    I have created a View Object for the Employees table with bind parameter for the Department ID, and Following the guidance of an earlier post:
    ExecuteWithParams with URL parameter doesn't work
    managed to get the passed in Department ID URL to be used in the intial search.
    The problem is that this value is not retained on subsequent searches. Can someone help me on this?
    Please excuse if the question is trivial. I am new to JDeveloper. By the way, I am using ADF BC with JDeveloper 10.1.3

    Assuming that you are using JSF then instead of passing the parameter in the URL try passing it with the processScope scope.
    See: here

  • State Change causing tree item to loss selected item highlight

    I'm looking for some guidance on a situation i'm encountering. I've an application with a tree component which will be used as a report selector in all view states. The parent nodes are not selectable but the children are. Each child has a for a lack of a better term parameter classification. When a report item is selected in the tree then a state change occurs and displays the appropriate parameter selection view.
    My issue is this. Upon clicking an item and displaying the new state for the first time, the selected item in the tree losses the visual representation or highlight around the selected item. But within the debugger it still shows which item is the selectedItem.  Once the state has been displayed at least once...i.e. I select other items and then eventually back to initial tree item when the state changes it does not loss the highlight on the selected tree item.
    Couple things I've tried to see if i'm in the right neck of the woods is use the currentStateChange and currentStateChanging handlers to do a bit of tracing and found that the tree item remains selected all the way through both currentStateChanging and then even in the currentStateChange...the redraw occurs just after which is when the tree item losses its highlight.
    Does anyone have any ideas or even encounter this?

    Good question. Well you're right in asking. Just using a spark Label to show me the label of the selectedItem, upon the first time I click on the selection nothing populates the label's text BUT the state changes as its suppose to. Took me clicking on it a second time to get the item to be highlighted and the label to show me what had been selected.
    My question here is...is there another event which is occurring after the changeState?

  • How to pass a querry as a url parameter

    Hi Forum
    I need to pass an sql query as a url parameter I wrote the following code:
    String applicationURL = WDURLGenerator.getApplicationURL("local/AgencyFee_SettlementSummaryReport", "Ko_AgencyFee_PrinterFriendly");
    applicationURL="?distACN="wdContext.currentVn_SettlementComp_InputParametersElement().getVa_SettlementComp_PayToACN()"&type="type"&query="strGreportQuery;
    but got the following exception:
    ecom.sap.tc.webdynpro.services.exceptions.InvalidUrlRuntimeException: Invalid URL=../../local/AgencyFee_SettlementSummaryReport/Ko_AgencyFee_PrinterFriendly?type=1&query=SELECT v.PAY_TO_ACN_NAME PAY_TO_ACN_NAME, v.DIST_ACN DIST_ACN, v.DIST_NAME DIST_NAME, v.AP_CHECK_NBR AP_CHECK_NBR, v.BATCH_NBR BATCH_NBR, TO_DATE(v.TRANS_DATE) TRANS_DATE, TO_DATE(v.AP_CHECK_DATE) SETTLE_DATE, Sum(v.QTY_DELIVERED) QTY_DELIVERED, Sum(v.TOTAL_AMT) TOTAL_AMT, Min(TO_DATE(concat(concat(concat(concat(to_char(v.SHIP_YY),'/'), to_char(v.SHIP_MM)),'/'), to_char(v.SHIP_DD)),'yyyy/mm/dd')) DEL_DATE_BEG, Max(TO_DATE(concat(concat(concat(concat(to_char(v.SHIP_YY),'/'), to_char(v.SHIP_MM)),'/'), to_char(v.SHIP_DD)),'yyyy/mm/dd')) DEL_DATE_END, (select sum(vr.qty_delivered) from VRF_ERR_DETL vr where vr.ccf_acn_nbr=v.dist_acn and to_char(vr.batch_nbr)=v.batch_nbr) TOTAL_ERR_REC From VRF_VOL_DETL v WHERE v.PAY_TO_ACN = 3182 AND v.AP_CHECK_NBR = 0 GROUP BY v.PAY_TO_ACN_NAME, v.DIST_ACN, v.DIST_NAME, v.AP_CHECK_NBR, v.BATCH_NBR, v.TRANS_DATE , v.AP_CHECK_DATE ORDER BY v.DIST_ACN, v.AP_CHECK_NBR, v.BATCH_NBR
    Can someone help me out on this?
    Thanks & Regards
    Jaspreet Kaur

    Hi jaspreet,
    you can try the following:
    HashMap params = new HashMap();
    params.put("distACN", wdContext.currentVn_SettlementComp_InputParametersElement().getVa_SettlementComp_PayToACN());
    params.put("type","type");
    params.put("query",strGreportQuery);
    try {
    String applicationURL = WDURLGenerator.getApplicationURL("local/AgencyFee_SettlementSummaryReport", "Ko_AgencyFee_PrinterFriendly", params);
    } catch (Exception ex) {

  • How to open URL IView with dynamic url parameter (navigate_absolute)

    Hi Experts,
    i would like to open an URL-IView from the WebDynpro ABAP Application in the Enterprise Portal 7.0
    and i want to set the URL parameter dynamically. Is this possible and how can i achieve this!!
    Thx Markus

    Hi Markus,
    You can take help of the following code snippet.
    Here we are calling an Iview using absolute navigation and passing URL parameters as well
    * Select the input value entered and then pass it to REM INQ application---------
      DATA lv_inputbusobjid   TYPE          wd_this->Element_context-inputbusobjid.
      DATA lv_path            TYPE          string.
      DATA lv_tab_wd_param     TYPE          wdy_key_value_list.
      DATA lv_str_wd_param     TYPE          wdy_key_value.
      DATA lo_el_context      TYPE REF TO   if_wd_context_element.
      DATA api_component      TYPE REF TO   if_wd_component.
      DATA window_manager     TYPE REF TO   if_wd_window_manager.
      DATA window             TYPE REF TO   if_wd_window.
      DATA lo_api_component   TYPE REF TO   if_wd_component.
      DATA lo_portal_manager  TYPE REF TO   if_wd_portal_integration.
    * read the imput data first-------------
    * get element via lead selection
      lo_el_context = wd_context->get_element( ).
    * get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `INPUTBUSOBJID`
        IMPORTING
          value = lv_inputbusobjid ).
    ** call remuneration inquiry window using absolute navigation
      CLEAR lv_tab_wd_param.
    * Adding parameters
      lv_str_wd_param-key = 'sap-wd-configId'.
      lv_str_wd_param-value = 'CACS_REMINQ_CONF'.
      APPEND lv_str_wd_param TO lv_tab_wd_param.
      lv_str_wd_param-key = 'BUSOBJ_ID'.
      lv_str_wd_param-value = lv_inputbusobjid.
      APPEND lv_str_wd_param TO lv_tab_wd_param.
      lo_api_component = wd_comp_controller->wd_get_api( ).
      lo_portal_manager = lo_api_component->get_portal_manager( ).
      if lo_portal_manager is BOUND.
    * PCD
      lv_path = 'ROLES://portal_content/com.sap.pct/specialist/com.sap.pct.erp.common.workset_reuse/com.sap.pct.erp.icmparticip.bp_folder/com.sap.pct.erp.icmparticip.15.bp_folder/com.sap.pct.erp.icmparticip.15.pages/com.sap.pct.erp.icmparticip.RemInquiry'.
      lo_portal_manager->navigate_absolute(
        navigation_target   = lv_path
        navigation_mode     = if_wd_portal_integration=>co_show_external
        window_features     = 'toolbar=no,resizable=yes,scrollbars=yes'
        business_parameters = lv_tab_wd_param
      endif.
    Hope this helps
    Regards
    Manas Dua

  • Passing date criteria in url parameter

    Hi,
    I want to filter a recordset by a given date.
    Create the recordset, if I use a runtime value of #27/11/06#
    all the records for that date are returned.
    However, when I try to pass the same information through an
    URL Parameter it doesn't work.
    Is there a problem with passing this info in that way?
    Thanks, Mark.

    No, should be absoloutely fine. The prob is most likely to do
    with your SQL
    statement.
    As a test, don't display any records. At the top of your
    page, try
    outputting the completed SQL statement onto the page to see
    what it looks
    like. The problem being you may need to add the # symbols
    manually. Should
    look something like
    "SELECT * FROM TableName WHERE DateField = #" &
    URLParameter & "#"
    HTH,
    Piers

  • XML driven DataGroup & lastResult or selected item

    I am using a xml driven DataGroup to display images with a itemRenderer and custom layout. When an image is selected i want a new state to display with info from the selected item (image, name, description). Is this possible and how do i do it?
    code example;
              <s:HTTPService id="srv" url="http://...../data/catalog.xml" result="resultHandler(event)" />
              <s:DataGroup includeIn="Main" left="50" right="50" top="200" dataProvider="{items}" id="dg1"
                     horizontalCenter="0" itemRenderer="renderers.kitchensRenderer" click="currentState='details'">
                           <s:layout>
                               <layouts:FilteredTileLayout id="filterLayout" filteredItems="{filteredItems}" />
                           </s:layout>
              </s:DataGroup>
              <mx:Image id="image2" includeIn="details" width="720" height="450" top="75" horizontalCenter="0" src="???" />               how do i get the selected DataGroup item to display the correct image
               //kitchensRenderer
              <mx:Image id="image" width="72" height="45" horizontalCenter="0" source="{data.image}" />

    "implement the property in your model and update the renderer state based on that."
    I am a complete beginner and most of the code I got from TourDeFlex. Please can you explain how to do this or provide a code example, thanks

  • Select item JComboBox

    I have 2 JComboBoxes.
    The first contains: "all", x rows (query from a db)
    The second: "all sectors", y rows (query from a db)
    When i select one item from the first combo, the second hasd to start with "all sectors" + the rows that are queried from the db with the selected item from the first as parameter. That's not a problem.
    The problem appears when its done the other way around: when i select an item from the second combo, then has to appear in the first combo the corresponding item. but the second combo is filled up with only the rows that are queried from the db with the selected item from the first as parameter and so i always lose the item i selected in the second combo.
    can anyone help me plz?
    greetz
    hysterio
    ps. can i easily sort the items in a combo in alfabetic order?

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test2 extends JFrame {
      UserData[] userData = {new UserData("Ignatz","Renitskiwitz",1),
                             new UserData("John","Doe",37),
                             new UserData("Mary","Snow",96)};
      public Test2() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        JComboBox jcb = new JComboBox(userData);
        content.add(jcb, BorderLayout.NORTH);
        jcb.addItemListener(new ItemListener() {
          public void itemStateChanged(ItemEvent ie) {
            if (ie.getStateChange()!=ItemEvent.SELECTED) return;
            System.out.println("You picked user id "+((UserData)ie.getItem()).getID());
        setSize(300,300);
      public static void main(String[] args) { new Test2().setVisible(true); }
    class UserData {
      String fn, ln;
      int id;
      public UserData(String fn, String ln, int id) {
        this.fn=fn;
        this.ln=ln;
        this.id=id;
      public String toString() { return fn+" "+ln; }
      public int getID() { return id; }
    }

Maybe you are looking for