Link in each item of a listbox control

Hello,
I have a "select one listbox" in my form. Inside this I have a "selectItems" object, pointing to a bean. This way, my listbox will be populated.
My question is: how can I have each item in the list has a URL, to open a window that will navigate to that url?
Please note that, on the listbox I want to see a name, but a link must be somehow there to be used when the user clicks on an item.
thank you
fwu

hi please have it like a valuechangelistener
<af:selectOneListbox id="companysol" value="#{allresultbean.selcompany}" autoSubmit="true" valuechangelistener="#{allresultbean.valueChange}">
<f:selectItems id="sicompany" value="#{allresultbean.companylist}"/>
</af:selectOneListbox>and in the valuechangelistener navigate to a new window
valuechange(){
ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
HttpServletRequest req = (HttpServletRequest)ectx.getRequest();
String scheme = req.getScheme();
String serverName = req.getServerName();
int serverPort = req.getServerPort();
StringBuffer url = new StringBuffer();
url.append(scheme).append("://").append(serverName).append(":").append(serverPort).append("/BPAL").append("/faces/Login.jspx");
response.sendRedirect(url.toString());
FacesContext.getCurrentInstance().responseComplete();
}

Similar Messages

  • How to display a seperate right click menu for each item of a tree control?

    Hi I want to display a specific right click menu when a particular tree item is selected. I know how to create a menu and how to display it. I am using the function GetLabelFromIndex() to get the active tree item and then compare the label and based on the result display a manu for that item. Now my problem is that when I use the above function in the EVENT_RIGHT_CLICK it gives me the error "the Index passed is out of range" while using the same function with the same arguments in EVENT_SELECTION_CHANGE it gives no error...below is the part of my code
    case EVENT_RIGHT_CLICK:
    GetLabelFromIndex(panelHandle, PANEL_TREE, eventData2, label1);
    //The function gives the stated error here
    if(eventData1)//after it I compare the result and display the menu
    case EVENT_SELECTION_CHANGE:
    GetLabelFromIndex (panelHandle, PANEL_TREE, eventData2, label1);
    //The function works fine here
    if (eventData1)
     If any one have any idea whats going on or alternate way of doing this Please share knowledge...Thanks
    If you are young work to Learn, not to earn.

    Hi,
    one possible approach of solving this problem is looking closer at the error message: The error "the Index passed is out of range" tells you that something is wrong with the index, either it is too small or too large So why don't you set a breakpoint and check the index value, it might be useful information...
    The other hint is to check the meaning of eventdata2 (using the help): It is different for different events! For the event_right_click it gives the horizontal mouse position, not the index as event_selection_change does...

  • Color for each item ring

    Hello,
    Is it possible to assign a different color for each item in a ring control ? See what I start in attached file.
    Thanks
    Attachments:
    enumeration_avec_couleur.vi ‏8 KB

    Attached is the LV 8.0 version.  I also added a control as described by Evan because I hadn't thought of it originally, but it is probably the best option -- it places text on color and doesn't require a loop to update.
    David C
    Applications Engineering
    Attachments:
    enumeration_avec_couleur2.vi ‏74 KB
    Control 2.ctl ‏6 KB

  • Is there a way to programatically add one item at a time to a listbox control?

    I am using labView 6.1. I want each new item that is added to the bottom of the listbox to arrive smoothly without the listbox scrollbar taking the selected item back to the top of the listbox. If I update the array that feeds the property node, the litsbox always scrolls back to the top. I would like the items in the listbox to be updating as the program runs, with the ability to select any item in the listbox being present.

    Create a property node for the list box.
    Select;
    "Top Row"
    This value allows you to specify the top row that is visable.
    Is this what you are after?
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Tree control tip strip for each item

    In tree control is possible set a Tip strip for each item (node) of tree?
    In tree control  tipStrip property seems relative to all tree.
    Thanks all.

    The only thing I can think of is to use an event structure
    use a mouse move event
    Get Cords
    Calculate what item the mouse is over
    Use a Tips property node to write the correct string.
    The hard part will be calculating what item the mouse is over, The Displayed Items property node should help.
    I am actively working on a program that is centered around a tree control and might like to do the same.
    If you need further help reply back 
    Omar

  • Populating item number in table control

    I have created a custom table control. It is very similar to the VA01 or Vl01N table controls to add items. When the user enters the material name, the item number column needs to be populated.
    Currently I have something like this
    LOOP at i_items.
    MODULE tblcntrl_modify INPUT.
    ENDLOOP
    MODULE tblcntrl_modify INPUT. "PAI
       posnr = sy-stepl * 10.
       more logic for input validation.
    ENDMODULE
    The issue I have is that when I scroll in the table control, the posnr for each item gets recalculated and they get whacked .. so I get a scenario like this
    10 mat1
    20 mat2
    30 mat3
    10 mat4
    40 mat5
    what is the best way to populate the item number. Thank you

    hi,
    u have to make one module in PAI brtn  <b>LOOP-ENDLOOP, CHAIN-ENDCHAIN</b>
    LOOP AT itab_det.
        CHAIN.
         FIELD itab_det-comp_code.
          FIELD itab_det-bill_no.
          FIELD itab_det-bill_date.
          FIELD itab_det-vend_cust_code.
          FIELD itab_det-bill_amt.
          MODULE <b>tab1_modify</b> ON CHAIN-REQUEST.
        ENDCHAIN.
        FIELD itab_det-mark
          MODULE tab1_mark ON REQUEST.
      ENDLOOP.
    <b>MODULE tab1_modify INPUT.</b>
      IF itab_det-bill_no <> ' ' .
        CLEAR:net_pr,tax,bil_amt,bil_dt.
        SELECT SINGLE fkdat netwr mwsbk FROM vbrk INTO (bil_dt,net_pr,tax)
        WHERE vbeln = itab_det-bill_no .
        bil_amt = net_pr + tax.
        itab_det-bill_date = bil_dt.
        itab_det-bill_amt = bil_amt.
      ENDIF.
      MODIFY itab_det
        FROM itab_det
        INDEX tab1-current_line.
      APPEND itab_det.
    <b>ENDMODULE.                    "TAB1_MODIFY INPUT</b>
    here i am fetching Bill Amount and Bill Date according to Entered Bill Number in Table control.
    So i am checking bill number here in If condition and when i press enter that two value automatically populated...
    reward if useful.....

  • Link b/w item category and material group

    Hi All,
       Is there any link between item category and material group.
    Regards
    Pavan

    Hi Pavan,
    Item Category
    Item Category is a control field that allows the PR to follow the correct path for the correct path for that category of PR. The SAP system is delivered with a set of item categories
    Blank -Standard
    K- Consignment
    L- Sub Contracting
    S- Third Party
    D- Service
    U- Stock Transfer
    Selecting an item category allow the display of certain fields and not others
    For Ex: If PR item has an item category K for conignment then invoice receipts will not be allowed
    Material Group
    Material group is a method of grouping of similar materials.It is defined either by using classification or by configuration. It is important not only for seracing the materials but also in other areas of purchasing
    A purchace inforecord can be created with out a material number but must require materail group and vendor
    Material group is configured through Tcode WG21 
    And i do not find any link between them
    I hope this gave you the clarity
    In case of any more information required do get back
    If found helpful reward accordingly
    Thanks & Regards
    Pavan

  • Each item in the delivery should have separate invoice

    HI friends,
    who to do separated invoice for each item of the delivery, even if the bill to party and billing dates are same.
    thanks
    nitchel

    Hi,
    Rather than block individual items manually each time an invoice is raised, a copy control routine can be written in which you can modify item level split criteria which is explained below in detail.
    In VOFM transaction, go to 'Data Transfer' and choose 'Billing Documents'. You can see a list of routines which can be used in copy control configuration. Define a new routine in this list (501 for example).
    Copy the piece of code from routine 001 (include FV60C001) to this new routine and add another field 'POSNR' to the structure ZUK. Copy delivery item number to ZUK-POSNR (ZUK-POSNR = LIPS-POSNR) before ZUK gets assigned to VBRK-ZUKRI.
    Then assign this routine in the item level copy control of delivery to billing of the respective document types. This will ensure that as many invoices get generated as there are delivery items.
    But before that, decide the scope for this invoice split, i.e. for what document types / organizational units, etc. this is required. These checks may be added as initial conditions in the routine before LIPS-POSNR is copied to ZUK.
    Cheers,
    KC
    PS: I had earlier tried some other split criteria which worked fine. If this doesn't work as it is described above, you may have to do minor fine tuning but the idea of splitting invoices by tweaking ZUKRI will certainly work.

  • How to change the numbers of items in a ring control in run time ?

    Hi !
    I would like change the numbers of items in a ring control in run time, but I can´t.
    Thanks.

    Hello blaze,
    did you try the "Strings And Values []" property of the ring?
    LabView7.1 help says:
    Array of clusters containing the strings from which you can select in the ring control
    and the numeric values for each item. Use the Strings [] property if you do not need to
    assign specific numeric values to each item.
    Best regards,
    GerdW
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to get the Clicked Item of a ListBox?

    I need to get the clicked item of a listbox.
    The item can be at first selected, when I click it again, it
    automatically gets de-selected, but I want to get that item
    whenever I click it. Any idea how to do this?
    This line does not work, because it gets the selected item.
    var pattern:String = event.currentTarget.selectedItem.myname;
    This one must work,but something is missing.
    Anyone can help me with this?
    marks is my ArrayCollection;
    var pattern:String =marks.getItemAt[??].myname;

    Here is my code. Am using this function in the itemclick
    event of the ListBox.
    My ListBox is a multi-select listbox. So am selecting several
    items by pressing "Ctrl" key and selecting each item using click.
    Say I have selected 4 items, when I press "Ctrl" and
    de-select one of the items, I want to get the itemname of the
    deselected item.
    public function createMarksList(event:ListEvent):void{
    // Alert.show(new
    String(event.currentTarget.selectedItem.myname));
    // var pattern:String =
    event.currentTarget.selectedItem.myname;
    // pattern = pattern += "," + pattern;
    // text1.text = pattern;
    <mx:List x="9" y="46" width="121" height="121"
    id="lstMarks" allowMultipleSelection="true"
    itemClick="createMarksList(event)"></mx:List>
    So, your help is required here buddy.
    I sitll can't figure out.
    Thx

  • Flatten to XML does not save Item Names of ListBox to XML file.

    On my Front Panel, I have a ListBox Indicator that has Strings from which the User can select. Also the User can edit items in the ListBox to add new elements. After the user selects one and pushes my Save button, I use the Flatten to XML function to save the selection in an XML file. But Flatten to XML only saves the Value (index of the selected item(s)) to the XML file and not the ListBox Item Names. That is enough information to reconstruct which of the String data that the user selected.
    In a ListBox where a User is selecting among a list of Strings, shouldn't the Flatten to XML function also store the String(s) that were selected?
    Solved!
    Go to Solution.

    Dennis Knutson wrote:
    The control is a U32 which is no different than placing a regular numeric control on the front panel. The flatten to xml is only passed a numeric value in both cases. It can't record something that you do not pass to it. The state of the control is the numeric value and the state can be reconstructed with that numeric. If you want to reconstuct the strings (which are not states), use the property node.
    I disagree. A ListBox that contains Stings to select from is full of String information. Both I and the User entered those Strings into the ListBox. It is the only data in the Listbox that we see. It is the most important information in the ListBox. The Strings are present in the Item Names. The Flatten to XML does have access to the Item Names and can and should provide them. Neither I nor the User are interested in the Numeric Index of the Selected Items. That is useless information to us. Both of use are dealing with Strings. If the State of the ListBox control is to be reconstructed from the XML data provided by the Flatten to XML function, then the Strings (Item Names) in the Listbox must be provided in the XML data.

  • Different values in a list box for each row of the table control...

    Dear Experts,
    Is it possible to populate different values for each row in a listbox inside a table control ?
    Example,
    Row 1 in the the table contains A, B & C
    Row 2 in the same table contains C, D & E
    If yes, How?
    yes i am using
      call function 'VRM_SET_VALUES'
        exporting
          id     = i_name
          values = i_list.
    Thank you .
    Message was edited by:
            Kokwei Wong
    Message was edited by:
            Kokwei Wong

    Hi Wong,
    this is code example for listbox
    TYPE-POOLS vrm .
    DATA: lt_vrm_values TYPE TABLE OF vrm_value.
    DATA: wa_vrm_values TYPE vrm_value.
    PARAMETER p_list AS LISTBOX VISIBLE LENGTH 10.
    INITIALIZATION.
      wa_vrm_values-key = 'Key1'.
      wa_vrm_values-text = 'Value1'.
      APPEND wa_vrm_values TO lt_vrm_values.
      wa_vrm_values-key = 'Key2'.
      wa_vrm_values-text = 'Value2'.
      APPEND wa_vrm_values TO lt_vrm_values.
      wa_vrm_values-key = 'Key3'.
      wa_vrm_values-text = 'Value3'.
      APPEND wa_vrm_values TO lt_vrm_values.
    AT SELECTION-SCREEN OUTPUT.
      CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id              = 'P_LIST'
                values          = lt_vrm_values
           EXCEPTIONS
                id_illegal_name = 1
                OTHERS          = 2.
      IF sy-subrc  0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    To fill it with data from DB, just do select in INITIALIZATION and put that values with same alghoritmus.
    Manas M.
    P.S.: This is very easy question, you should use search ...

  • Add a button(not a link) in each row of a report

    hi,
    i need to add a button(not a link) in each row of a report. On clicking this button , the value in a specified column in database should change from yes to no.
    How can i achieve this funcationality. I am using apex 4.2.
    Please help!

    I used the images in the report region query,
    select
    EMPNO,
    ENAME,
    JOB,
    MGR,
    HIREDATE,
    SAL,
    COMM,     
    DEPTNO,     
    decode(IS_COMM,'Y','<a href="#" onClick= javascript:pdelete('||a.EMPNO||');><img src="#WORKSPACE_IMAGES#remove.gif" alt=""></a>','N','<a href="#" onClick= javascript:padd('||a.EMPNO||');><img src="#WORKSPACE_IMAGES#value_ok.png" alt=""></a>','<a href="#" onClick= javascript:padd('||a.EMPNO||');><img src="#WORKSPACE_IMAGES#value_ok.png" alt=""></a>') check_comm
    from
    test_emp aChanged the check_comm -> Display Text As as Standard Report Column. Created two items to save the value of 'EMPNO'. Javascript code in the page header as below,
    function padd(pSub)
         $s('P8_ADD',pSub);
        doSubmit('ADD');
    function pdelete(pSub)
         $s('P8_DELETE',pSub);
           doSubmit('DELETE');
    }Created the processes with condition like Request=Expression1 based on the REQUEST returned by javascript function.
    Thanks
    Lakshmi

  • Listbox control in Visual Web Developer not working correctly

    Not sure where to post this issue.  I am developing a web app using Visual Web developer. I have created an .aspx page where I have placed a listbox control on the page and populate it when the page loads.  When I select an item from the list the
    listindex value is always -1.  I can never get the index for the other values.  I've used the following code,but get the same results:
    For i = 0 To ListBox1.Items.Count - 1
        If ListBox1.Items(i).Selected = True Then
            val= ListBox1.Items(i).Value 
        End If
    Next
    val=nothing, listindex is -1 when i check
    Any idea how to get around this issue?
    Thx

    Hello,
    The TechNet Sandbox forum is designed for users to try out the new forums functionality. Please be respectful of others, and do not expect replies to questions asked here.
    As it's off-topic here, I am moving the question to the
    Where is the forum for... forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Using button to scroll down a Listbox control

    Hi,
    I am creating a tool which will allow users to scroll down to each item one at a time from the Listbox. However I hit upon an out of range exception each time I try as the box exceeds its index limit. So far this is the code that sort of works for me but
    I am sure that there is a better way:
    Private Sub btnConfirm_Click(sender As Object, e As EventArgs) Handles btnConfirm.Click
    Try
    ListBox1.SelectedIndex += 1
    Catch ex As ArgumentOutOfRangeException
    MsgBox("End of UAT!", MsgBoxStyle.Information)
    End Try
    End Sub
    I rather not generate an exception if I can contain this within a specified range but have been struggling to do so. So really what I am looking for would be something like this:
    Get maximum number of items in the List box 
    Dim numberOfItems As Integer = ListBox1.Items.Count
    Create a range with numberOfItems being the upper limit 
    Then let ListBox1.SelectedItem +=1 operate within this range and not go above.
    I am not sure how I would implement this so any suggestions or pointers will be much appreciated.
    Kind Regards,
    MobileIAm 

    You need to test what the SelectedIndex is before you add or subtract 1 from the SelectedIndex.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    'move up through the items
    If ListBox1.Items.Count > 0 Then
    If ListBox1.SelectedIndex <= 0 Then
    ListBox1.SelectedIndex = ListBox1.Items.Count - 1
    Else
    ListBox1.SelectedIndex -= 1
    End If
    End If
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    'move down through the items
    If ListBox1.Items.Count > 0 Then
    If ListBox1.SelectedIndex = ListBox1.Items.Count - 1 Then
    ListBox1.SelectedIndex = 0
    Else
    ListBox1.SelectedIndex += 1
    End If
    End If
    End Sub
    If you say it can`t be done then i`ll try it

Maybe you are looking for

  • TS3274 ipad is disabled. We upgraded to iphone 5 and IOS7 and since then ipad is asking for a passcode which we did not have before. Now disabled!

    ipad is disabled. We upgraded to iphone 5 and IOS7 and since then ipad is asking for a passcode which we did not have before. Now disabled!

  • Container management in workflow

    Hi, I am VERY NEW to workflows and am trying to create my first workflow. I initially set up all of my steps with myself as the responsible agent. I am now trying to identify the responsible agent via a method. (We determine approving agents by certa

  • Read array of bytes

    using what do i read array of bytes that is on a stream... i send an array of bytes to the invoking stream using void write(byte buffer[]).... how do i read it from the other side.... uzair

  • Computer startup from monitor

    I had a G5 with a Apple 23" Studio display. to start the computer all I had to do was press the monitor on button on the monitor and the computer would start. I know have a MacPro and 30 HD display. It has a on/off button but when I press it the comp

  • IDOC types in SAP ECC

    Hi Gurus, 1) 3rd party->PI->SAPECC We have a requirement that the tenant refunds coming from 3rd party system should be sent to SAP ECC system. To send this messgae to SAP ECC, is there any separate idoc format for this tenant refunds. Should I use a