Where to place java code in webdynpro for communicating between views

Hi Friends,
Where should I put the Java code on click of button for the action.
I can out in init() method, or in teh onActon methods.
I think suppose I have two views view1 and view2
on click of one button on view1, user shoudl see results on another view.
for that I think best is to put data accesing logic for view2--in onAction of view1 itself.

I've been looking at my examples,  you can do it either way.  In one example, I have coded the logic in the Inbound Plug method on the Result view.  In another example, I am doing the logic in the onAction method when the user presses the button on the Start view.
I'm thinking it may be better to do it in the onAction method, but it really depends on the overall functionality of the application.
Regards,
Rich Heilman

Similar Messages

  • Where to put java code - Best Practice

    Hello. I am working with the Jdeveloper 11.2.2. I am trying to figure out the best practice for where to put code. After reviewing http://docs.oracle.com/cd/E26098_01/web.1112/e16182.pdf it seemed like the application module was the preferred spot (although many of the examples in the pdf are in main methods). After coding a while though, I noticed that there were quite a few libraries imported, and wondered whether this would impact performance.
    I reviewed postings on the forum, especially Re: Access service method (client interface) programmatically . This link mentions accessing code from a backing bean -- and the gist of the recommendations seems to be to use the data control to drag it to the JSF, or use the bindings to access code.
    My interest lies in where to put java code in the first place; In the View Object, Entity Object, and Am object, backing bean.....other?
    I can outline several best guesses about where to put code and the pros and cons:
    1. In the application module
    Pros: Centralized location for code makes development and support more simple as there are not multiple access points. Much like a data control centralizes services, the application module can act as a conduit for different pieces of code you have in objects in your model.
    Cons: Everything in one place means the application module becomes bloated. I am not sure how memory works in java -- if the app module has tons of different libraries are they all called when even a simple query re-execute method is called? Memory hog?
    2. Write code in the objects it affects. If you are writing code that accesses a view object, write it in a view object. Then make it visible to the client.
    pros: The code is accessed via fewer conduits (for example, I would expect that if you call the application module from a JSF backing bean, then the application module calls the view object, you have three different pieces of code --
    conts: The code gets spread out, harder to locate etc.
    I would greatly appreciate your thoughts on the matter.
    Regards,
    Stuart
    Edited by: Stuart Fleming on May 20, 2012 5:25 AM
    Edited by: Stuart Fleming on May 20, 2012 5:27 AM

    First point here is when you say "where to put the java code" and you're referring to ADF BC, the point is you put "business logic java code" in the ADF Business Components. It's fine of course to have Java code in the ViewController layer that deals with the UI layer. Just don't put business logic in the UI layer, and don't put UI logic in the model layer. In your 2 examples you seem to be considering the ADF BC layer only, so I'll assume you mean business logic java code only.
    Meanwhile I'm not keen on the term best practice as people follow best practices without thinking, typically best practices come with conditions and people forget to apply them. Luckily you're not doing that here as you've thought through the pros and cons of each (nice work).
    Anyway, back on topic and off my soap box, as for where to put your code, my thoughts:
    1) If you only have 1 or 2 methods put it in the AppModuleImpl
    2) If you have hundreds of methods, or there's a chance #1 above will morph into #2, split the code up between the AppModuleImpl, ViewImpl and ViewRowImpls. Why? Because your AM will become overloaded with hundreds of methods making it unreadable. Instead put the code where it should logically go. Methods that work on a specific VO row go into the associated ViewRowImpl, methods that work across rows in a VO go into the ViewImpl, and methods that work across VOs in the associated AppModuleImpl.
    To be honest which you ever option you choose, one thing I do recommend as a best practice is be consistent and document the standard so your other programmers know.
    Btw there isn't an issue about loading lots of libraries/imports into a class, it has no runtime cost. However if your methods require lots of class variables, then yes this will have a memory cost.
    On a side note if you're interested in more ideas around how to build ADF apps correctly think about joining the "ADF EMG", a free online forum which discusses ADF architecture, best practices (cough), deployment architectures and more.
    Regards,
    CM.

  • Where to find Java Class File Specification for Java 5.0?

    Where to find Java Class File Specification for Java 5.0?
    thank you in advance.

    same place you found it for 1.4Can u give more details? I thought the class spec for Java 1.4 is the same as Java 1.2.
    anyone can tell where to find Java Class File Specification for Java 5.0?
    Thanks.

  • How to use Java code inside WebDynpro-ABAP

    Hi,
        How to use Java code inside WebDynpro-ABAP.
    Could any one provide sample code.
    Cheers,
    Sam

    Hi Sam,
    We can't Bring Java Inside the ABAP. Both are running in different Environments.
    and also ABAP Codes are runs on BASIS.
    -Basis is a middleware between ABAP codes and Ur OS.
    -Contains set of programs to load,RUN,intepret the ABAP program..
    So Both are Different.
    Regards,
    Ramganesan K.

  • Ports required for communication between Web servers and service applications (the default is HTTP)

    We're using SharePoint 2010, I'm the system admin for a SharePoint farm. We enabled SharePoint Search by adding a Search Service APplication. One of the crawl report timer job is failing every 5 minte with the error "Cannot connect to remote server".
    After digging around, we found that the server running the timer job tries to connect to the SearchAdmin.svc on the index server, over HTTPS / port 32844 However, communication over SSL via a non default port is blocked by our firewall.
    According to this article: https://technet.microsoft.com/en-us/library/cc262849.aspx the default is HTTP for communication
    between web servers. How is it possible that it's trying to connect over SSL?

    Hi,
    Quoted from
    https://technet.microsoft.com/en-us/library/cc262849.aspx#ServiceApp :
    You can change the protocol and port binding for each service application. On the Service Applications page in Central Administration, select the service application, and then click
    Publish.
    Here is an article for configuring Windows firewall port rules for SharePoint using PowerShell in case you need:
    http://www.xylos.com/default.aspx?id=1050
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Display HTML code in WebDynpro for ABAP

    Hi, I would like to display a html page in a WebDynpro View, ie: I have the html code in a "string" variable and would now display this string now not with the html tags visible, but as a "real" html page.
    I found a thread in WebDynpro for ABAP but I am a little bit lost in converting the logic to ABAP world.
    Thanks

    >I found a thread in WebDynpro for ABAP but I am a little bit lost in converting the logic to ABAP world.
    I'm a little bit confused by this statement. Do you mean you found a thread in Web Dynpro Java, perhaps?
    Regardless the approach is possible using the iFrame UI.  The warning about the iFrame is that it is deprecated in NetWeaver 7.0 and 7.01 and my not be usable depending upon your support package level. However in NetWeaver 7.02 the iFrame returns to fully supported status.
    If you have the HTML content in a string, you can simply place it into the ICM cache.  This will provide a temporary URL for the content (you supply the lifetime of the URL) that can be referenced via the iFrame URL or even the LinkToURL if you want to open in a new window.
    Here is the code for placing the string into the ICM Cache:
    ****Create the cached response object that we will insert our content into
      data: cached_response type ref to if_http_response.
      create object cached_response
        type
          cl_http_response
        exporting
          add_c_msg        = 1.
      try. " ignore, if compression can not be switched on
          call method cached_response->set_compression
            exporting
              options = cached_response->co_compress_based_on_mime_type
            exceptions
              others  = 1.
        catch cx_root.
      endtry.
    ****set the data and the headers
      data: l_app_type type string.
          cached_response->set_cdata( lv_html_text ).
          l_app_type = 'text/html'.
    cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                         value = l_app_type ).
      cached_response->set_status( code = 200 reason = 'OK' ).
      cached_response->server_cache_expire_rel( expires_rel = 60 ).
      data: guid type guid_32.
      call function 'GUID_CREATE'
        importing
          ev_guid_32 = guid.
      concatenate '/sap/public' '/' guid '.' 'html' into lv_iframe_url.
    ****Cache the URL
      cl_http_server=>server_cache_upload( url      = lv_iframe_url
                                           response = cached_response ).
      wd_context->get_element( )->set_attribute(
        name =  `IFRAME_URL`
        value = lv_iframe_url ).

  • Calling Java code from Webdynpro Abap UI

    Hi All,
    Can anybody tell me, How to make calls to java code on a button click from webdynpro ABAP UI ?
    Thanks in Advance.
    Jenish .V. Joy

    Hi Jenish,
    As I am new to WebDynpro for ABAP I could not help you out exactly.But See this link which will help you to create applications in WebDynpro by using ABAP language.
    https://www.sdn.sap.com/irj/sdn/developerareas/abap?
    rid=/library/uuid/02e1fa45-0801-0010-10a0-f1cf47e8c943
    If you get any answer for your question let me know.
    Regards,
    Karthick K Eswaran

  • Where to apply java codes?

    Good Day:
    Perhaps this sound funny....I bought a Java book to learn the coding...pretty interesting...but after all, it didn't tell where can I type and test all those codes.
    After much reading, understand that it should be applied onto the JDK. Am I right? so I went to Java site and downloaded it. But nothing happened? I even borrow some other machine to install the JDK, still the same????
    When I check form control panel, the JDK and JRE successfully install. Pls help. After all, I need to start on where can i test my java codes?
    Many thanks for your reply.

    hellbinder, my apology...i guess you and everyone
    confuse with my question.
    Ok, see, what I need is to type in the code as per
    given in the book i bought. I understand that it got
    to be typing in the JDK in order to be able to test
    it out. So I download the JDK (including JRE & IDE)
    and had it install on my pc. Then now, I still could
    find the JDK (what I think/mean the "text editor"
    here) for me to type in the java codes.
    Or shall I re-phare in in suce, let's imagine, if
    given with a stack of words and fonts, we type in
    note pad may be. then now given with the Java codes,
    where shall i type it? JDK right? thus I installed
    JDK but I couldn't find or launch it to type in those
    Java codes?!
    Thanks!You don't "type in the java codes" in your JDK. You use a texteditor to "type in the java codes" and compile "the java codes" with the compiler from your JDK, and after that you run "the java (byte)codes" with the JRE from your JDK.
    Everything is explained step-by-step in the tutorial I posted earlier. Please take the time to follow those steps.

  • Java code coverage tool for Java Card?

    Hello,
    I am looking for "Java code coverage tool" that can be used for testing Java Card Applets.
    Has anyone tried EMMA<http://emma.sourceforge.net/> with JCWDE, or other tools?
    Any information appreciated.
    ichara

    JCOP Tools 3.0 for Eclipse 2.1 support code coverage with the JCOP simulations for Java Card 2.1. The newest JCOP41 simulation for Java Card 2.2.1 does not yet have this feature.
    Code coverage information is shown in the Profiling view, when it is enabled in the Launch Configuration. The editor also shows colored bars next to source lines to quickly identify dead code.

  • Want to LOOK/SHARE JAVA code or Template for BI Publisher ?

    1. If you are interested in sharing a nice piece of JAVA code you have written using BI Publisher APIs, or a template with an elegant solution to a problem, or any other BI Publisher object.
    2. Or if you are interested in looking at some one else's samples
    We have a shared site: [https://codesamples.samplecode.oracle.com/servlets/tracking/action/ExecuteQuery?query=business_intelligence|* https://codesamples.samplecode.oracle.com/servlets/tracking/action/ExecuteQuery?query=business_intelligence *]
    If you submit a code sample: "Business Intelligence" should be entered in the Related Technologies section
    Once we get enough samples we can get a section devoted to just BI Publisher!
    Enjoy!
    Edited by: user488697 on Nov 9, 2010 10:44 AM

    BI Publisher

  • Data conversion for communication between Java and C/C++ program

    The real problem, i guess, is about data type conversion between Java and C programs. For instance, and int is supposed to be 4 bytes in Java, and also in C/C++. But, as far as I know, the size of and int in C depends on the processors architecture, so if it were a 64 bit arch., size of and int, double, etc. in C, would change. The real scenario would be a communication between a 32 bit machine (Java) and a 64 bit machine (C/C++).
    First of all, is this assumption correct?
    If so,
    how is it possible to deal with this problem in Java?
    Is there any way to know 'type length' automatically? or
    would it be necessary to modify the Java program to work with a C program in 32-bit or 64-bit arch?
    thx in advance

    cotton.m wrote:
    Yes you should develop the C part of the protocol first and then build from there.
    See http://forum.java.sun.com/thread.jspa?threadID=5243547 for a previous discussion of this topic.
    I understand what you mean, also the topic you referenced. I will explain the situation a bit more. The protocol is already defined: (16 bits message size, 16 message id, 32 bit time, etc.); it is also defined in C (structures and so on). So it would be easy to write my Java code using the specified protocol in bytes, and C types wouldn't be necessary to be considered. But, let's say that the C code can't be modified, and I thought (and don't know yet if its correct), that size of C types CAN changed depending on architecture. So if size changes for C types (code is specified in short, int, etc, and not in bit format), it all would be a mess, if I don't implement something in my Java code.
    cotton.m wrote:
    I don't believe that 32 or 64 bit enters the equation here at all.Maybe 32 o 64 doesn't mind, but sparc or PC could take a point here. Communication would be between a sun solaris sparc and windows x86 PC. But if type size in C/C++ does not change, I wouldn't really have any problem then...
    The situation is not ideal, I know, but is what I have; and I think I could have problems if I run the C program in other machines; so I would have to try to solve it whithin my Java Program.
    I hope it is clear now what I need.
    thx
    Edited by: MGasa on Jan 16, 2008 1:51 AM

  • What is the Need for communication between Flex ActionScript to Javascript

    Hi ,
    Flex has made it communication possible from FLEX Mx:script to Java Script .
    Can anybody could please tell me what is the need or any scenario  for communication Flex with Javascript
    Thanks in advance .

    1- Printing in Flex is terrible (although for simpler requirements it can do fine), true, but it's not incredibly better elsewhere in the browser unless I'm missing the point.  This can be gotten around for many by streaming PDFs or Excel spreadsheets from a server, though.
    2- If it has to be web, I guess you're stuck.  If it can be an installed app (AIR) I'd prefer to hook into Java.  Like I said, there may be some limited specific uses, but good reasons to base the majority of your app on JS hacks are hard to come by.

  • Logos for communication between Fieldpoint modules?

    I have a system with two Fieldpoint network modules: one FP2000 and one FP1601. I am presently using datasocket calls using the lookout protocol for the FP2000 to read/write the I/O items on the FP1600. There is normally no PC connected to the two. Our NI salesperson visited today and told me that the recommended means of communication between Fieldpoint network modules is using Logos. He also mentioned using the "FieldPoint Publish Data" vi. I searched all the documentation I have and can't find anything on Logos, or any way to make any sense out of what he said. Can someone please tell me exactly what he meant and how I would implement it? I have LabView RT and FieldPoint Explorer, but no other software.

    Richard,
    Logos is the name for the NI Ethernet Protocol. It was originally developed for networking of computers using Lookout. Using DataSocket with the Lookout URL specifier, is instructing the DataSocket client to use the logos protocol or lookout protocol (the terms are interchangeable). The FieldPoint Publish Data.vi is a VI that can be run on embedded targets (e.g. (c)FP-20xx series) that can be used to make data available via the NI Ethernet protocol. For example, if you measured two sensors and calculated a value from the two sensors, you could use the Publish Data.vi to make the calculation result available from the FP-2000.
    Regards,
    Aaron

  • Using clipboard for communication between applications

    I am facing a problem related to clipboard during a remote desktop connection. I have the same application both in a client (Windows 8) and in a server (Windows Server 2012 R2) and the communication between them is made by using clipboard. Before making
    the connection to the server through "Remote Desktop Connection", there is an option related to Clipboard in Local Resource tab which must be checked. I did it and when I run both programs they don't work as expected. They should exchange messages
    between themselves, however some messages are lost during the communitation (between the client and the server). I suppose there must be some kind of configuration I have forgotten to setup during installation of Windows Server 2012 R2. Perhaps something like
    that: http://www.technipages.com/unable-to-copy-and-paste-to-remote-desktop-session. Does anybody know if clipboard option should be set in an additional menu in order to clipboard to work properly in Windows Server 2012 R2? Should the client settings also
    be checked as above? I've seen many possible solutions on the Internet for similar problems like this, but none of them solved it. I'd appreciate any help anyone could give me.

    Hi,
    Thank you for your posting in Windows Server Forum.
    You can try to disable the “Do not allow clipboard redirection” on both server and client side with administrator permission under Group Policy on below mention path.
    Computer Configuration\Policies\Administrative Templates\Windows Components\Terminal Services\Terminal Server\Device and Resource Redirection
    Hope it helps!
    Thanks,
    Dharmesh

  • Need sample code in webdynpro for java

    Hi all
    actually i have one webdynpro form which is having multiple input elements. for example name,address,phoneno,price quantity and amount. and there is update button for that form.
    when i click the update button the multiplication of quantity and price value will be updated by in one input field which is part of the another webdynpro form is part of the same view.
    i want to update the input field in another form only when i change the value of either price or quantity otherwise the value of inputfield in another form should be same.
    now how do we retrieve the event of either price or quantity inputfield which only changes rather than changes of name or adreess.
    only when i modify the value of price or quantity in form and updated button then only the multiplication will be reflected in inputfield of another form.i dont want to reflect that inputfield of another form when i changes of other inputfields except price or quantity.
    please provide the sample code on the same...especially how to retrieve the event of that price or quantity in a form..
    Regards
    Suresh babu

    Hi Suresh,
    please post your issue to the Web Dynpro forum.
    Greetings,
    Carsten

Maybe you are looking for

  • Pro Apps User licence cannot be used in Boot Camp?

    I use Logic Studio and so I have a "Pro Apps User" license that enables QT Pro in OSX where I have Logic installed, but there's no registration code (it says "Automatic"). However I also use Boot Camp to run XP on my MBP and I need to use QTPro in XP

  • Adobe Reader XI and paid for Conversion

    I currently have Adobe Reader XI, after using previous versions. This time, I signed up for 1 year conversion capabilities. However, it appears that I cannot do so from within Reader XI, I just tried and was directed to sign-in via the web and to use

  • Interface messages SAP - WMS

    Dear experts, I am looking for the following information. I cannot seem to find a consistent answer, so I hope you can give me some more direction. I have the following interface requirement: - My customer wants to interface information towards an ex

  • Thought ;; Advantages of using eMac

    Hi All While this old eMac with OS X 10.3.9 cannot play any videos or access Youtube site, I fould out that it is great in reading NEWS sites with a lot of pop up adverts. Because this eMac does not bother with any of the pop up windows ads... which

  • Append structure activation

    hi all, we have got some problems while dealing with append structure. actually ,we tried to add some fields to the append structure of mara table , then when activating it showed activation logs.so the table mara and the append structure to it is pa