How to read URL by button action event

Hi,
Can some one please show me how to add a ...... I call it URL reader to the action of a button of another class?
Lets say I have a url reader class and the following code
public void uRLReader() throws Exception {
         // URL concatenation
         String url1 = "http://";
         String url2 = "";
         String url3 = ".google.com";
         URL google = new URL(url1+url2+url3);
         BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        google.openStream()));
         String inputLine;
         while ((inputLine = in.readLine()) != null)
             System.out.println(inputLine);
         in.close();
        }Now I also got another class in the same package "class2", it has a button. Similarly, another class which has a JTextField. Now when some one writes 1 and hit the button I want "1" to get inserted into url in "url2" position. In other words any thing that is entered in the JTextField should be inserted into "url2" position.
I am not very much familiar with java so this is all I could write. I used a string concatenation to break the url. Can some please show me how do I add this to the button of another class and the button to JTextFiled of another class?
Thank you

First of all, change your method so that url2 is an argument of the method:
public void uRLReader(String url2) throws Exception {and remove the declaration of url2 from the body of the method.
Then, write and ActionListener class (it could be an anonymous inner class) to read the textfield you want, then invoke uRLReader, passing that text as an argument.
That's basically it.

Similar Messages

  • How to read URL parameters of one wdp component into other WDP component?

    Dear Experts,
    Can anyone let me know how to read URL parameters of one wdp component into other WDP component?
    My requirement is i have one standard WDP component with 3 URL parameters and i needto
    read that URL parameters along with their values in my Z-WDP component.
    Thanks
    SK

    Hi Santosh,
    You can read parameters send from one WebDynpro Component to another component by adding code in "HANDLEDEFAULT" Event Handler method ( Window )of your target Web Dynpro Component.
    data: lt_parameter             type tihttpnvp,
             ls_parameter             type ihttpnvp.
    lo_api_controller ?= wd_this->wd_get_api( ).
       call method lo_api_controller->get_message_manager
         receiving
           message_manager = lo_message_manager.
       clear : ls_parameter.
       refresh : lt_parameter[].
    * Read all URL parameters
       wdevent->get_data( exporting name = if_wd_application=>all_url_parameters importing value = lt_parameter ).
    if not lt_parameter[] is initial.
         clear : ls_parameter.
         read table lt_parameter into ls_parameter index 1.
         if ls_parameter-name = 'ACTION' and
            ls_parameter-value is initial.
           lv_flag = 'X'.
           clear : lo_msg.
           lo_msg = 'Action Parameter Missing in URL Link !'.
    *         report message
           call method lo_message_manager->report_error_message
             exporting
               message_text = lo_msg.
         else.
         endif.
    Best Regards
    Priyesh Shah

  • Button action event not call in dataprovider

    hi,
    i have JSF table and it's bound to Mysql database table. when i bound the table and run it's working properly but it's button action event is not call action. when i use static jsf table then it's table action event work properly.
    my jsp code is
    <ui:table binding="#{search.search_table}" id="search_table" lite="true" selectMultipleButton="true" sortPanelToggleButton="true"
                                style="height: 70px; left: 240px; top: 240px; position: absolute; width: 600px" title="Search Text :" visible="true" width="600">
                                <ui:tableRowGroup binding="#{search.tableRowGroup1}" id="tableRowGroup1" rows="5" sourceData="#{search.srch_tablevalDataProvider1}" sourceVar="currentRow">
                                    <!--    <ui:tableColumn headerText="Script" id="tableColumn2" width="700">
                                        <ui:staticText id="staticText4" text="#{currentRow.value['search_script']}"/>
                                    </ui:tableColumn>-->
                                    <ui:tableColumn binding="#{search.tableColumn13}" headerText="Search Word" id="tableColumn13" style="#{search.columnStyle}">
                                        <ui:staticText binding="#{search.search_word1}" id="search_word1" text="#{search.search_word1}"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{search.tableColumn4}" headerText="#{search_lang['search.contentName']}" height="39" id="tableColumn4"
                                        style="#{search.columnStyle}" width="100">
                                        <ui:staticText id="staticText1" onMouseOver="play_video(this);" text="#{currentRow.value['name']}"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{search.tableColumn6}" headerText="#{search_lang['search.srchTag']}" id="tableColumn6"
                                        sort="search_tags" style="#{search.columnStyle}">
                                        <ui:staticText id="staticText3" text="#{currentRow.value['search_tags']}"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{search.tableColumn5}" headerText="#{search_lang['search.tpDetail']}" id="tableColumn5" style="#{search.columnStyle}">
                                        <ui:imageHyperlink action="#{search.action}" id="imageHyperlink1" text="#{currentRow.value['details']}"/>
                                        <ui:button action="#{search.button2_action}" id="button2" text="Button"/>
                                    </ui:tableColumn>
                                </ui:tableRowGroup>
                             </ui:table>and back bean code is
    public String button2_action() {
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            System.out.println("Invoke");
            return null;
        }i don't know what is problem there if found any solution, help me.

    You need to make sure that the getter of the datatable value returns exactly the same list in the apply request values phase of the form submit as it did during the render response phase of the initial display. Only this way JSF can find out which action which row was been invoked. Alternatively you can also place the data bean in session scope (which may have more impact), or use for example Tomahawk's t:dataTable with preserveDataModel attribute set to "true".

  • How to capture previously clicked button(previous event)?

    Hi guyz,
    I have frame in which i have different panels. I would like to capture the last clicked button. My objective is to bring a pop-up box(dialog) when anything other than a specific button is clicked in one of the panels. So, i would like to know if i can see what button was clicked previously. Does anyone know?

    How to capture previously clicked button(previous event)?Store it somewhere and then you can use it later:
    ActionListener previousActionEvent;
    JButton b = new JButton();
    b.addActionListener(new ActionListener(){
       public void actionPerformed(ActionEvent evt){
          previousActionEvent = evt;
    });

  • SAP Cloud Marketing Lead How to Hide the Standard button action

    Hi Experts,
    In Marketing Lead TI screen button action event have 3 options
    1) Convert to Sales Lead
    2) Convert to Opportunity.
    3) Convert to Account or Contact
    I want to hide 2 option 1) Convert to Sales Lead and 2) Convert to Account and Contact from the Action button.
    I have try to enhance the standard BO as shown below.
    and when open the COD_Marketinglead_TI screen then i can not able to see 3 option under Action button.
    Please anyone have idea about how to get these 3 options 1) Convert to Sales Lead 2) Convert to Opportunity. 3) Convert to Account or Contact under Action button.
    Many Thanks,
    Mithun

    Thanks Dan for your reply.
    I have few question
    1) AP.CRM.Global:Lead is Marketing Lead BO or Sales Lead BO? if Not Marketing Lead BO then what is the correct path to extend the Marketing Lead?
    2) I have extend the AP.CRM.Global:Lead BO when we enhance the screen it give the below options and i have selected the highlighted screen is it correct or not ?
    After select the screen and click OK there are 4 screen comes automatically as shown below.
    3) When i Open the COD_MarketingLead.TI screen in UI designer i can able to see this screen as shown below.
    Here in this screen point 1 we can see that its COD_MarketingLead screen but in point 2 Screen Header Label is "Sales Lead" and point 3 under this Action button no 3 option available  1) Convert to Sales Lead 2) Convert to Opportunity. 3) Convert to Account or Contact. But when you open Marketing Lead we can able to see these option under the action event as shown below.
    Help me how to get Marketing Lead Screen with above actions in UI Designer.
    Many Thanks,
    Mithun

  • How to read URL Parameters

    Hi All,
      How to read URL parameters in another WDA.
    Thanks in advance

    here is the sample code.
    you can write this code in HANDLEDEFAULT method of Default Window of Application being called.
      DATA:
        wa_url TYPE LINE OF tihttpnvp,
        int_url TYPE tihttpnvp.
      wdevent->get_data(
        EXPORTING
          name = if_wd_application=>all_url_parameters
        IMPORTING
          value = int_url ).

  • How to call a dynamic URL on 'button press' event, in MVC-based BSP

    Hi,
    My requirement is as below:
    On selecting a row in table view, and pressing a button, I need to open a browser.
    The Browser URL depends on the row selected.
    The key field from table view, is added at the end of the URL string.
    Shortly, I can say that, I am getting a value on row selection & want to pass it to button event.
    In Views Section, there are 2 tags- (1)table view & (2)button.
    Right now, I have put the code for getting the key field, in DO_HANDLE_DATA method.
    In Button's OnClientClick method, I have called the Javascript to open the browser.
    If I now write the code to concatenate the key field value to form the dynamic URL in 'OnClick' method,
    it will be called only after the browser is opened.
    (as OnClick event is executed only after OnClientClick event is executed)
    Could anyone please tell me what event (and in which tag) can be used to solve this.
    Is there any event which is triggered, as soon as the row is selected, &  before the button press event is triggered ?
    Would really appreciate responses made to this query.
    Thanks,
    Nisha Vengal.

    Hi Nisha,
    The crux of your issue here is that you want to call the event triggered with onClick before calling the event triggered on onClientClick. This can be achieved by the following code in the function called on the onClientClick.
    function fn_button()
               htmlbSL(this,2,'b_row_selection:onInputProcessing()');
               window.open("new_page",target="BLANK");
    Here, fn_button is the javascript function called on button click, and b_row_selection is the event triggered on the onClick event of row selection.
    Try this out and let us know if it works for you.
    Regards,
    Saurabh

  • How to add to viewPlatformBehavior an Action Event - a button press

    And the main problem I have is to by pressing buttons to change the Viewing Platform?
    I made same transformation to object, which reacts to key pressin:
    public class LewoPrawo extends Behavior{
        private TransformGroup targetLP;
        private Transform3D wysuwanie = new Transform3D();
        private float krok2 = (float) 0.0;
         // create LewoPrawo
        LewoPrawo(TransformGroup targetLP){
        this.targetLP = targetLP;
         public void initialize(){           
                this. wakeupOn(new WakeupOnAWTEvent(AWTEvent.KEY_EVENT_MASK));
        public void processStimulus(Enumeration enumeration){
            this.wakeupOn(new WakeupOnAWTEvent(AWTEvent.KEY_EVENT_MASK));
                KeyEvent event = (KeyEvent) ((WakeupOnAWTEvent) enumeration.nextElement()).getAWTEvent()[0];
               if (event.getKeyCode() == KeyEvent.VK_Q) {
                   krok2 += 0.01;
               if (event.getKeyCode() == KeyEvent.VK_W) {
                   krok2 -= 0.01;
               wysuwanie.set(new Vector3f(krok2, 0.0f, 0.0f));
               wysuwanie.mul(przewrocenie);
               targetLP.setTransform(wysuwanie);
        }And this is the one that I made up to move the viewing platform, but it doesn't work!!!
    public class Perspektywa extends ViewPlatformBehavior{
    private TransformGroup targetVP;
    private Transform3D obrot_obserwatora = new Transform3D();
    private double kat=0.0;
    //create Perspektywa
         Perspektywa(){
         public void initialize(){
         this.wakeupOn(new WakeupOnAWTEvent(AWTEvent.ACTION_EVENT_MASK));
         public void processStimulus(Enumeration enumeration){
         this.wakeupOn(new WakeupOnAWTEvent(AWTEvent.ACTION_EVENT_MASK));
    ActionEvent event = (ActionEvent) ((WakeupOnAWTEvent) enumeration.nextElement()).getAWTEvent()[0];
         if (event.getSource()== przyciski[0])  {
               kat += 0.1;
           if (event.getSource() == przyciski[3]) {
               kat -= 0.1;
            obrot_obserwatora.rotY(kat);
            TransformGroup targetVP =
                simpleU.getViewingPlatform().getViewPlatformTransform();
            targetVP.getTransform( obrot_obserwatora);
    }And what's worse, action events doesnt even work when i replace key events with them, but i don;t know why ;(

    The section from the Swing tutorial on "General Rules for Using Text Components" has a sample program that does this:
    http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html
    Or, you can create a new Action using DefaultEditorKit.CopyAction

  • How show popup on filedownload button action

    Hi Experts,
    Working on jdev 11.1.1.3.0, ADF BC with rich faces.
    I have requirement in my application like i need to show popup and at the same time need to download file. like on selected rows in the table i have validation on each row, if the validation failed rows i need to show in popup to user at the same time i have validation success rows also those rows i need to generate a file and that file i need to download.
    i have written logic in the command button which has fileDownload, here remaing logic is working fine except showing popup. can any one tell me how to solve this issue.
    Edited by: user5802014 on Aug 19, 2010 5:57 PM

    Hi Frank,
    After chaning actionEvent.forceFullSubmit(); now everything is working fine, but now the problem is if i came from another jsff page to the current page then my file download is not happening i am getting on my browers like error on ....
    javascript:
    function customHandler(event) {
    var exportCmd = AdfPage.PAGE.findComponentByAbsoluteId("pt1:pt_region0:1:cb1")
    var actionEvent = new AdfActionEvent(exportCmd);
    actionEvent.noResponseExpected();
    actionEvent.queue();
    Bean:
    if(downloadFile!=null){
    System.out.println("invoking downloads...............................");
    erks.addScript(context, "customHandler();");
    } if (requestClause != null){
    System.out.println("invoke popup");
    executeSactionCheckVO(requestClause);
    //erks.addScript(context, "showPopup();");
    ADFUtils.invokePopup(this.getP2().getClientId(FacesContext.getCurrentInstance()));
    can you please how to avoid this error or can you please tell me how to call filedownload method in another button action.

  • How do you fire a button click event on apex page from fancybox iframe that was created by page

    I am trying to fire off the button click event from fancybox iframe. The apex page has a button that launches a fancybox iframe which is loaded with an APEX form. On close of that fancy box, I am trying to fire a click event on the parent page which will refresh a div with html that is created with plsql. The button on the page works as expected when clicked from the page. It will show a debug alert message to prove it was called and then load the div with the correct data. I am unable to fire off this button click from the fancybox iframe when it closes.
    A couple of points:
    I using Plug-in: Execute PL/SQL Code and Return Content ("PLUGIN_MULEDEV.SERVER_REGION_REFRESH") to place the create fancybox statement. It is used to populate a div using plsql.
    The name of the button on the main page is P2020_REFRESH_SECTION_BUILDER_BTN.
    The click dynamic action on the button is calling the plugin to replace the html in the div.
    The data in the form in the fancybox is being saved to the database. On close of the fancybox box I want to refresh the div so the new record is included in the div html.
    Can anyone help. Here is the fancybox code:
      function customProcessOnReadyState4(){
        for (var i=0;i<11;i++){
          $( "#tabs"+i ).tabs();
          $("#createNewExerciseLink"+i).fancybox({
              ''width''         : ''60%'',
              ''height''        : ''70%'',
              ''autoScale''     : true,
              ''transitionIn''  : 200,
              ''transitionOut'' : 200,
              ''type''          : ''iframe'',
              ''onClosed''         : function() {
                                         window.parent.$(''#P2020_REFRESH_SECTION_BUILDER_BTN'').click();
    Here are the dynamic actions assigned to the button:
    5 - Execute JavaScript Code
    alert("Starting refresh");
    10 - Execute PL/SQL Code and Return Content [Plug-in]
    begin
      SCTUI.create_sct_tabs2(:P2020_CREATE_SECTION_LOV, '1');
    end;

    user setActionListener...
    <af:setActionListener from="#{bindings.XXX.inputValue" to="#{backingbean.variable}"
                  <af:inputText value="#{bindings.Email.inputValue}"
                                label="#{bindings.Email.hints.label}"
                                binding="#{backingBeanScope.backing_ShuttlePage.it2}"
                                id="it2">
                    <f:validator binding="#{bindings.Email.validator}"/>
                  </af:inputText>
                  <af:commandButton text="commandButton 2"
                                    binding="#{backingBeanScope.backing_ShuttlePage.cb2}"
                                    id="cb2" action="passing">
                    <af:setActionListener from="#{bindings.Email.inputValue}"
                                          to="#{processScope.detail}"/>
                  </af:commandButton>next jsf page:
                <af:outputText value="#{processScope.detail}"
                               binding="#{backingBeanScope.backing_ProcessScope.ot1}"
                               id="ot1"/>setPropertyListener also should work
    <af:setPropertyListener from="#{bindings.Email.inputValue}" to="#{processScope.detail}" type="action"/>

  • How do you kick-off an action/event before a JSF Portlet is rendered?

    Hi,
    I am creating JSR-168 Portlets using Sun RI 1.1 and need the ability to call an action (ie. method) of the JSF Portlet before it is rendered. Any ideas how to do this?
    Scenario To Resolve
    If a customer is on the Check-Out Portal Page, the check-out portlet will initially display the shopping cart information.
    The customer will then click buy and the portlet will display a confirmation page.
    Now, if the customer decides to do additional shopping (ie. place a second order).
    The customer will navigate to a different Portal Page to browse items.
    Once the customer is done shopping, the customer will click Check-Out and the Portal will display the Check-Out Portal Page. Currently, when the check-out portlet is rendered, the portlet is automatically rendering the confirmation page (ie. the last state of the check-out portlet).
    Question
    How can I control the state of the portlet so that the initial state of the portlet is rendered (ie. the shopping cart information)?
    - Is there something built into the JSR-168 Spec? Or, Sun's JSF RI 1.1 that will enable me to kick-off an action/event before a JSF Portlet is rendered?
    - If this functionality is not built in, has anyone faced this challenge? If so, how did you extend the framework to resolve it?

    Hi,
    I am creating JSR-168 Portlets using Sun RI 1.1 and need the ability to call an action (ie. method) of the JSF Portlet before it is rendered. Any ideas how to do this?
    Scenario To Resolve
    If a customer is on the Check-Out Portal Page, the check-out portlet will initially display the shopping cart information.
    The customer will then click buy and the portlet will display a confirmation page.
    Now, if the customer decides to do additional shopping (ie. place a second order).
    The customer will navigate to a different Portal Page to browse items.
    Once the customer is done shopping, the customer will click Check-Out and the Portal will display the Check-Out Portal Page. Currently, when the check-out portlet is rendered, the portlet is automatically rendering the confirmation page (ie. the last state of the check-out portlet).
    Question
    How can I control the state of the portlet so that the initial state of the portlet is rendered (ie. the shopping cart information)?
    - Is there something built into the JSR-168 Spec? Or, Sun's JSF RI 1.1 that will enable me to kick-off an action/event before a JSF Portlet is rendered?
    - If this functionality is not built in, has anyone faced this challenge? If so, how did you extend the framework to resolve it?

  • How to read URL Parameters in ABAP WebDynpro ?

    Hi,
    How and where (which class, method) in ABAP WebDynpro we can read URL Parameters ? I found answers for WebDynpro JAVA but nothing for ABAP.
    Thanks
    Meenal

    Hi Meenal,
    Please see a post by Sanjay Agarwal titled 'Sequencing Problem in Web Dynpro ABAP'. I believe you will find your answer there.
    Cheers,
    Rich

  • How to generate barcode on button click event in PDF using adobe livecycle?

    I already created form in PDF file which is validate completely .But , I required generate a barcode of all field of form using custom script on button click event.
    Please give me right way for doing it .
    Thanks in Advance,
    Jaydeep Solanki.

    Hi vijay,
    What project are you doing? Is it Asp.Net project? If so, you'll need to post it in the dedicated ASP.Net Forum
    http://forums.asp.net  for more efficient responses, where you can contact ASP.NET experts.
    Have a nice day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • HTTP Sender - how to read URL Parameter USER id into Mapping

    Hi,
    My scenario is HTTP - XI - ABAP Proxy.
    I wanted to capture USER id of the person who posted(HTTP) into XI(Mapping). How to read/evaluate the value of sap-user from querystring of URL ?
    http://HOST:8008/sap/xi/adapter_plain?namespace=http%3A//abc.com/sales_oa&interface=MI_sales_OA&service=DEV_D&party=&agency=&scheme=&QOS=EO&<b>sap-user=SM9999</b>&sap-password=xxxxx&sap-client=001&sap-language=EN
    please help.

    Mallik,
    Try  URL Parameters in HTTP sender communication channel.
    In the sender communication channel set Adapter Specific Message Attributes. Click on Apply URL Parameters. In Parameter1 put sap-user (U can query any URL parameter by giving its name as in the HTTP URL).
    Now in SXMB_MONI, in inbound payload SOAP Header, under Dynamic configuration u can see the value of the user. Query the same in Mapping using Dynamic Configuration using keyName as UrlParamOne.
    Regards,
    Sudharshan N A
    Message was edited by:
            Sudharshan Aravamudan

  • How to read url variable javascript problem

    How to read the variable of latitude 1.22 and longitude 103.56.
    This is my website: 127.0.0.1/1/map2.htm?latitude=1.22&longitude=103.56
    function getUrl_Map()
              //Get the variables in the URL
         var vars = [], hash;
              var latitude = getUrlVars()["latitude"];
              //To get the second parameter
              var longitude= getUrlVars()["longitude"];
         var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
         alert('DEBUG: hashes= ' + hashes);
              // read the file http://127.0.0.1/1/map2.htm
              // read the file http://127.0.0.1/1/map2.htm? -->hashes
         for(var i = 0; i < hashes.length; i++)
         hash = hashes.split('=');
                   //alert('DEBUG: i= ' + i);
                   //i=0
                   alert('DEBUG: i= ' + i + 'hash = ' + hash );
         vars.push(hash [0]);
         vars[hash [0]] = hash [1];

    by the way you know that 127.0.0.1 is the address you use to get to your own computer right? It's the loopback address. so posting it doesn't really help anybody see the page, if that was what you were hoping.

Maybe you are looking for

  • Want to move to SAP BW. Help required

    Presently I am working in India in the Data Warehousing area as Business Analyst. I have considerable functional experience and very good exposure to Supply Chain. Apart from that I have some exposure to BAAN ERP package.  I would like to move to SAP

  • SharePoint 2013 - Power View

    Hi, I try to run Power View featrue in SharePoint 2013 but still I get error The feature: "Power View" is not supported in this edition of Reporting Services. I have already installed PowerPivot Add-In and Reporting Service Add-In I see new content t

  • Buyer got the money back from Paypal and buyer don't want to send the item back

    Hi everybody, I sold a laptop on Dec 2014 via eBay. After three months, there are some issues with the laptop so buyer had to send it to the manufacture for repair (Still under Lenovo warranty). After that, buyer had to send the laptop to manufacture

  • Why FRA filling faster in logical standby server.

    I have two standby servers one physical and one logical for my primary database. I have notice that on logical standby server the FRA is filling faster then physical standby server. Any one have some suggestions. Thx

  • Category Contract and Pricing

    Hello, I am in the development phase on a SRM project using SRM 5.0 EXC Self Service. I am struggeling with contracts and pricing. We have set up a contract with a discount of 20% on the product group (as we do not use products, only descriptions) "o