Referencing on several dynamically created JFrames

Hi,
I've developed an application for managing tour datas of bike computers.
The loaded tours will shown in a JTable as rows.
With double click on a row, the tour editor will opend (another JFrame class). The user can change some values ot the bike tour.
The user has also the possibility to open several instance of the tour edit class - for different tours in the tour table.
My problem is to find out, if the tour edit object is already created for a certain tour entry in the tour table. Instead of creating a new tour edit object, the already opened tour edit object should get the focus.
How can I manage this? My first idea is, to store all open tour edit object in a static hashmap (w/ unique key) inside the tour edit class.
My second problem is, to transfer the changed bike tour object (w/ the bike trackpoints) to the calling object with list of tours. I've a boolean flag to show, that the tour is changed an i've a getTour() methode to pull the actual tour from the tour edit object.
But, how should I say it to the calling app before the tour edit object is disposed.
Thanx for ideas,
Hans

I have done something very similiar to what you are doing; however, without seeing exactly what is triggering your GUI to add text to the text area's it is hard to give you an exact answer.
Just keep in mind that on all events you should be able to get the source component, which would then let you call the getName method of that component. So if a MouseEvent is the trigger for adding text you can get the name like this:
String compName = ((JComponent) mouseEvent.getSource()).getName()
(assuming you set the name of the component when you instantiated it)
(I have some subclasses that are detected at runtime via reflection, each subclass gets a JCheckBox, there can be 0 or more of these subclasses. I used the getSource/setName/getName methods to determine which checkbox was clicked on even though I don't have a named reference to each one)

Similar Messages

  • Uploading data from excel file to a dynamically created internal table

    Hi,
    I have a requirement where i have to upload data from an excel file into a database table. I would be able to determine the structure of the table only at runtime based on the user input.. so i have created an internal table dynamically.
    Could you please tell me if its possible to upload data from an excel file to the dynamically created internal table using any function modules?
    I thought of doing this by declaring a generic internal table of one field and then uploading the *.csv file into it and then splitting it based on "," and then assigning it to the field symbol referencing the internal table.. but my file length exceeds 132 characters and i'm only able to get data of lenght 132 char's in my internal table ( generic one).
    Could anyone please show me a way around this.
    Thanks in advance,
    Harsha

    Sure, check this out.
    report zrich_0002.
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: it_fldcat type lvc_t_fcat,
          wa_it_fldcat type lvc_s_fcat.
    type-pools : abap.
    data: new_table type ref to data,
          new_line  type ref to data.
    data: iflat type table of string.
    data: xflat type string.
      data: irec type table of string with header line.
      data: tabix type sy-tabix.
    data: file type string.
    selection-screen begin of block b1 with frame title text .
    parameters: p_file type  rlgrap-filename default 'c:Test.csv'.
    parameters: p_flds type i.
    selection-screen end of block b1.
    start-of-selection.
    * Add X number of fields to the dynamic itab cataelog
      do p_flds times.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = sy-index.
        wa_it_fldcat-datatype = 'C'.
        wa_it_fldcat-inttype = 'C'.
        wa_it_fldcat-intlen = 10.
        append wa_it_fldcat to it_fldcat .
      enddo.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
      file = p_file.
      call method cl_gui_frontend_services=>gui_upload
        exporting
          filename                = file
        changing
          data_tab                = iflat
        exceptions
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          others                  = 17.
      loop at iflat into xflat.
        clear irec. refresh irec.
        split xflat at ',' into table irec.
        loop at irec.
          tabix = sy-tabix.
          assign component tabix of structure <dyn_wa> to <dyn_field>.
          <dyn_field> = irec.
        endloop.
        append <dyn_wa> to <dyn_table>.
      endloop.
    * Write out data from table.
      loop at <dyn_table> into <dyn_wa>.
        do.
          assign component  sy-index  of structure <dyn_wa> to <dyn_field>.
          if sy-subrc <> 0.
            exit.
          endif.
          if sy-index = 1.
            write:/ <dyn_field>.
          else.
            write: <dyn_field>.
          endif.
        enddo.
      endloop.
    Regards,
    Rich Heilman

  • How do I reference a dynamically created MovieClip from another MovieClip?

    Hi,
    I'd be grateful for any pointers to the following problem:
         I'm having trouble referencing dynamically created MovieClips (links in a side panel on a Flash website, created from an XML file) from the current MovieClip (the currently selected link).
         I wish to freeze the the link/MovieClip in its mouseOver state once it has been clicked - this part works. When a new link/MovieClip is clicked on, I wish to release the previously clicked-on link from its mouseOver state, which is what I've so far been unable to do.
         My problem seems to be referencing the previous link/MoveClip. I've used the trace statement trace(MovieClip(this).name) to determine that the MovieClips are named item0, item1, item2 and so on. However, I've been unable thus far to reference the previous clip thus far. I've tried to trace the route to the MovieClip from the stage, and also tried MovieClip(parent).item0.gotoAndStop and lots of other different permutations, but to no avail. It's the fact they seem to be in a container called 'panel' which is defeating me.
         Here's a live version I've uploaded, which might explain the problem better. Click on "UBER UNS" in the top menu bar to get to the page in question. It's the links on the left-hand side (Historie, Unser Team, etc.) which are the problem. You'll see that once they've been clicked on they remain in their mouseOver state.
         This is the code in question on the fla file, which is a file I did not create myself. The parts in black work fine; it's the red parts where the problem lies:
    import flash.display.MovieClip;
    panel.buttonMode = true;
    var lang:uint = 1;
    var url_Link:String=MovieClip(root).program.websiteXML .language[lang].pages.titlePage[MovieClip(root).program.linkPage].texts.pageList.txt[numT XT].@link;
    var urlPage:Number=Number(MovieClip(root).program.webs iteXML.language[lang].pages.titlePage[MovieClip(root).program.linkPage].texts.pageList.tx t[numTXT].@linkPage);
    var request:URLRequest;
    var linkIndex:uint;
    var lastClickedLink:MovieClip;   //This is supposed to store the last link that has been clicked - it doesn't work
    panel.addEventListener(MouseEvent.CLICK, clicLink);
    panel.addEventListener(MouseEvent.ROLL_OVER, mouseOverLink);
    panel.addEventListener(MouseEvent.ROLL_OUT, mouseOutLink);
    function mouseOverLink(event:MouseEvent):void {
          MovieClip(this).gotoAndPlay('s1');
    function mouseOutLink(event:MouseEvent):void {
          if(numTXT !== (linkIndex - 1)/5){         //freezes mouseOver state if this is the link for the current page
               MovieClip(this).gotoAndPlay('s2');
    function clicLink(event:MouseEvent):void {
          var linkpage:uint = MovieClip(root).program.linkPage;
          if (url_Link) {
               request = new URLRequest(url_Link);
               navigateToURL(request);
          } else {
               linkIndex = numTXT * 5 + 1;
               if(linkpage == 1){
                   MovieClip(root).chPages.cont.page_about_mc.page3Tu  rner_mc.gotoAndStop([linkIndex]);
              } else if (linkpage == 2){
                   MovieClip(root).chPages.cont.page3_mc.page3Turner_  mc.gotoAndStop([linkIndex]);
         lastClickedLink.gotoAndPlay('s2');  // this is supposed to release the previous clicked-on link from it's mouseOver state - doesn't work
         lastClickedLink = MovieClip(this).name;    //this is supposed to set the new link as the last link clicked after the old one has been released from it's mouseOver state - doesn't work
    If anyone can help, that would be great.

    What you might be after for that line is to use:
    lastClickedLink = MovieClip(event.currentTarget);
    For what you show, the name property of an object is a String, so I would expect you to be getting an error regarding trying to get a String to act like a MovieClip when you try to tell it to gotoAndPlay('s2').

  • Dynamically create a SelectOneMenu

    Hi All,
    I have a JSF page on which I need to dynamically create and bind a SelectOneMenu. In order to do this I have the following code (all in a request-scoped bean used by the JSF page):
    List<SelectItem> values;
    // Called after a button is clicked on the page
    public void createMenu() {
        values = new Vector<SelectItem>();
        // Load the values to be displayed
        HtmlSelectOneMenu menu = new HtmlSelectOneMenu();
        menu.add(items);
        UISelectItems items = new UISelectItems();   
        ValueExpression expr = // Get ValueExpression pointing to this request-scoped bean's 'values' attribute
        items.setValue("value", expr);
        // Create the SelectOneMenu inside a binded panel on the screen
        getCustomPanel().getChildren().add(menu);
    public List<SelectItem> getValues() {
        return values;
    }This works fine and the SelectOneMenu is displayed correctly and contains the correct values. However, as soon as I perform any type of postback (navigation, clicking on buttons/links on the page), I receive the following exception:
    [#|2008-03-07T11:57:24.296+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=bcebfe92-27ee-416d-a3d5-7916f5480fe4;|StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
    java.lang.IllegalArgumentException
         at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:166)
         at javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:49)
         at javax.faces.component.UISelectOne.matchValue(UISelectOne.java:164)
         at javax.faces.component.UISelectOne.validateValue(UISelectOne.java:137)
         at javax.faces.component.UIInput.validate(UIInput.java:867)
         at javax.faces.component.UIInput.executeValidate(UIInput.java:1065)
         at javax.faces.component.UIInput.processValidators(UIInput.java:666)
         at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
         at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
         at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
         at javax.faces.component.UIForm.processValidators(UIForm.java:229)
         at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
         at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:662)
         at org.ajax4jsf.component.AjaxViewRoot.access$201(AjaxViewRoot.java:57)
         at org.ajax4jsf.component.AjaxViewRoot$3.invokeRoot(AjaxViewRoot.java:319)
         at org.ajax4jsf.context.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:56)
         at org.ajax4jsf.context.AjaxContextImpl.invokeOnRegionOrRoot(AjaxContextImpl.java:170)
         at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:333)
         at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
         at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
         at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
    |#]I tried adding breakpoints to all my getters and setters and the constructor of the request-scoped bean, and as they are never triggered I assume this exception occurs before my code is actually accessed. As far as I can tell, for some reason, on creating a postback the value binding of the UISelectItems component is null and as such it can't find the SelectItems it needs. I don't know why this is or how to fix it, though. This doesn't happen if the component isn't created dynamically, and unfortunately our business requirements are as such that I have to create it dynamically.
    Your help would be much appreciated as this really got me stumped and I really need this functionality to be in the project.
    Thank you,
    Ristretto

    Okay ... here's a small proof of concept I created:
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <html>
        <body>
            <f:view>     
                <h:form>
                    <h:panelGrid>
                     <h:commandButton value="Load SelectOneMenu" action="#{pageBean.loadMenu}" />
                  <h:commandButton value="Create Postback" action="#{pageBean.doNothing}" />
              </h:panelGrid>
              <h:panelGrid binding="#{pageBean.panel}" />
             </h:form>
            </f:view>
        </body>
    </html>
    public class PageBean {
        private HtmlPanelGrid panel;
        private List<SelectItem> selectItems;
        public HtmlPanelGrid getPanel() {
            return panel;
        public void setPanel(HtmlPanelGrid panel) {
            this.panel = panel;
        public List<SelectItem> getSelectItems() {
            return selectItems;
        public void setSelectItems(List<SelectItem> selectItems) {
            this.selectItems = selectItems;
        public void loadMenu() {      
            selectItems = new Vector<SelectItem>();
            SelectItem selectItem1 = new SelectItem("first", "First Option");
            SelectItem selectItem2 = new SelectItem("second", "Second Option");
            selectItems.add(selectItem1);
            selectItems.add(selectItem2);
            HtmlSelectOneMenu menu = new HtmlSelectOneMenu();
            UISelectItems items = new UISelectItems();
            ValueExpression expr = getValueExpression("#{pageBean.selectItems}");
            items.setValueExpression("value", expr);
            menu.getChildren().add(items);
            panel.getChildren().add(menu);
        public void doNothing() {
        private ValueExpression getValueExpression(String expression) {
            ExpressionFactory expressionFactory = FacesContext.getCurrentInstance().getApplication().getExpressionFactory();
            ELContext expressionContext = FacesContext.getCurrentInstance().getELContext();
            return expressionFactory.createValueExpression(expressionContext, expression, Object.class);
    }Step 1: Click on "Load SelectOneMenu".
    Step 2: Click on "Create Postback".
    Thanks for having a look at it.
    Ristretto

  • Dynamically Created Trigger

    I have a Java application using Business Components. The connection was created using the connection wizard and a standard userid, password is passed to the connection. The application is deployed and launched using JWS. I dynamically create the JNLP tag in a JSP file and pass in the current user identification as a system resource. The html page that holds the link to the JSP page is protected under SSO so I can validate the user id and I know when the application is launched that it is launched by a valid user. The application is launched and I can retrieve the user id by calling System.getProperty(userID).
    So - Now that I have the user ID I would like to pass this on to the database for tracking purposes. Every time I insert/update on a table I would like a trigger that sets the userid and current date for that record.
    I have the trigger written for the current date - that was easy enough..
    TRIGGER "SPECIES"."PLANTCOMMITDT" BEFORE INSERT OR UPDATE ON "SPECIES"."PLANT"
    REFERENCING OLD AS OLD NEW AS NEW
    FOR EACH ROW
    BEGIN
    :new.Commitdt:=SYSDATE;
    END;
    The problem is how can I add the userid to this trigger? I have the userid but in the application - not in the database. Can you dynamically create a trigger? So I can pass in the userid from the application?
    Any help would be appreciated!

    hi,
    Could you please log this issue as a bug . The bug form requests for appropriate info to reproduce the bug.
    Bug report url:
    http://developers.sun.com/prodtech/javatools/jscreator/support/index.jsp
    Click on Bug Report / Feature Request
    Thanks
    K

  • Dynamically Create Image: RDataMatrix

    Hello All,
    Anyone know of any samples or tutorials showing how to dynamically create images on a web page using RDataMatrix? The library can be found at java4less.com. Any input would be greatly appreciated.
    Thanks,
    Tim

    Hi,
    I am not aware of this. However, we have examples posted in blogs and referenced here that use a servlet URL reference from the image objec in JSF to access streamed image contents
    Frank

  • Dynamically create JToolBar

    Hi all. I want to be able to dynamically create a JToolBar and add it to my content pane. Here is the code I'm using.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class ToolBarPanel extends JPanel implements ActionListener {
            boolean show = false;
            public ToolBarPanel() {
                super(new BorderLayout());
                add(new JTextArea(5, 30), BorderLayout.CENTER);
                JButton click = new JButton("click");
                click.addActionListener(this);
                add(click, BorderLayout.PAGE_END);
            private JToolBar createToolBar() {
                if(show) {
                    JToolBar toolbar = new JToolBar("tools");
                    toolbar.add(new JButton("but"));
                    toolbar.add(new JButton("ton"));
                    return toolbar;
                else
                    return new JToolBar(); //because i have to return something - i think empty toolbar is not visible, so basically does nothing
            public void actionPerformed(ActionEvent e) {
                show = !show;
                this.add(createToolBar(), BorderLayout.PAGE_START);
        public static void main(String[] args) {
            JFrame frame = new JFrame("Toolbar");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            ToolBarPanel barpanel = new ToolBarPanel();
            barpanel.setOpaque(true);
            frame.setContentPane(barpanel);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    }However, this does nothing. Is it possible to do what I am trying to do? Also, is it possible to actually close the toolbar if I don't want it open, rather than replace it w/ an invisible one? Thanks in advance...

        private JToolBar toolbar;
        public ToolBarPanel() {
            toolbar = createToolBar();
            add(toolbar, BorderLayout.PAGE_START);
        private JToolBar createToolBar() {
                JToolBar toolbar = new JToolBar("tools");
                toolbar.add(new JButton("but"));
                toolbar.add(new JButton("ton"));
                toolbar.setVisible(false);
                return toolbar;
        public void actionPerformed(ActionEvent e) {
            show = !show;
            toolbar.setVisible(show);
            validate();
        ...

  • Problem with embeding the same view in dynamically created view container

    Hello Experts,
                  I am getiing a dump when i try to embed the same view inside the dynamically created view container of
    dynamically created tabs of a tabstrip
    The requirement go like this, i have 2 views in which i have have to embed the 2nd view to view1 where i have an empty
    tabstrip without tabs. During runtime i create tabs as well as view containers accordingly and then try to embed view2 in tabs.
    I have put the below mentioned code in HANDLEIN,
      DATA: lref_vcntlr  TYPE REF TO if_wd_view_controller,
            lref_comp    TYPE REF TO if_wd_component_usage,
            lv_embed_pos TYPE string.
      lref_vcntlr = wd_this->wd_get_api( ).
      lv_embed_pos = 'FILE_PERS_EDIT/VC_GENERAL'.
      TRY.
          CALL METHOD lref_vcntlr->do_dynamic_navigation
            EXPORTING
              source_window_name        = 'FILE_PERSISTENCE_WND'          " Window
              source_vusage_name        = 'FILE_PERS_EDIT_USAGE_1'       " Source View usage
              source_plug_name          = 'TO_EDIT_LAYOUT'                       " Outbound plug
              target_view_name          = 'PERS_EDIT_LAYOUT'                  " Second view to be embedded
              target_plug_name          = 'IN'                                                  " Second view inboun plug
              target_embedding_position = lv_embed_pos
            RECEIVING
              component_usage           = lref_comp.
        CATCH cx_wd_runtime_repository .
      ENDTRY.
      wd_this->fire_to_edit_layout_plg( ).
    This works fine for the first time.
    However onaction tab select i change the embeding position( 'FILE_PERS_EDIT/view container name of different tab') of the view2 an try to embed view2 in a different tab.
    At this point i get a dump stating View2 already present in the window 'FILE_PERSISTENCE_WND' of component.
    I think, the view2 embediing has to be removed before i add the view2 in a different tab
    Kindly let me know how to remove view2 embedding from tab1 before i add a view2 to a different tab or is there any other
    means to handle this problem?
    Thanks & Best Regards,
    Srini.

    Hello Srini,
    I found a solution to your problem, because I had a similar task.
    In WDDOINIT I changed the method do_dynamic_navigation to if_wd_navigation_services_new~prepare_dynamic_navigation:
    DATA:
        l_view_controller_api TYPE REF TO if_wd_view_controller.
      l_view_controller_api = wd_this->wd_get_api( ).
      TRY.
          CALL METHOD l_view_controller_api->if_wd_navigation_services_new~prepare_dynamic_navigation
            EXPORTING
              source_window_name        = 'WDW_MAIN'
              source_vusage_name        = 'VW_SUB_USAGE_1'
              source_plug_name          = 'TO_VW_CONTENT'
              target_component_name     = 'ZTEST_DYNAMIC'
              target_view_name          = 'VW_CONTENT'
              target_plug_name          = 'DEFAULT'
              target_embedding_position = 'VW_MAIN/VC_TAB.VW_SUB/TAB1_VC'
            RECEIVING
              repository_handle         = wd_this->g_rep_handle.
        CATCH cx_wd_runtime_repository .
      ENDTRY.
      wd_this->fire_to_vw_content_plg( param1 = 'TAB1' ).
    In the action I first deleted the navigation targets, then navigated to the empty-view and last I called my target view:
      DATA:
        lv_position           TYPE string,
        l_view_controller_api TYPE REF TO if_wd_view_controller,
        lr_view_usage         TYPE REF TO if_wd_rr_view_usage,
        lr_view_***_t         TYPE wdrr_vca_objects,
        lr_view_***           LIKE LINE OF lr_view_***_t.
      l_view_controller_api = wd_this->wd_get_api( ).
      lr_view_usage = wd_this->g_view->get_view_usage( ).
      lr_view_usage->delete_all_navigation_targets( plug_name = 'TO_VW_CONTENT' ).
      CLEAR lv_position.
      CONCATENATE 'VW_MAIN/VC_TAB.VW_SUB/' old_tab '_VC' INTO lv_position.
      TRY.
          l_view_controller_api->if_wd_navigation_services_new~do_dynamic_navigation(
          source_window_name = 'WDW_MAIN'
          source_vusage_name = 'VW_SUB_USAGE_1'
          source_plug_name   = 'TO_EMPTYVIEW'
          target_component_name = 'ZTEST_DYNAMIC'
          target_view_name   = 'EMPTYVIEW'
          target_plug_name   = 'DEFAULT'
          target_embedding_position = lv_position ).
        CATCH cx_wd_runtime_repository.
      ENDTRY.
      CLEAR lv_position.
      CONCATENATE 'VW_MAIN/VC_TAB.VW_SUB/' tab '_VC' INTO lv_position.
      TRY.
          wd_this->g_rep_handle = l_view_controller_api->if_wd_navigation_services_new~prepare_dynamic_navigation(
            source_window_name = 'WDW_MAIN'
            source_vusage_name = 'VW_SUB_USAGE_1'
            source_plug_name   = 'TO_VW_CONTENT'
            target_component_name = 'ZTEST_DYNAMIC'
            target_view_name   = 'VW_CONTENT'
            target_plug_name   = 'DEFAULT'
            target_embedding_position = lv_position ).
        CATCH cx_wd_runtime_repository.
      ENDTRY.
      wd_this->fire_to_vw_content_plg( param1 = tab ).
    Ann.: I my example, I had 3 views: VW_MAIN which embedds VW_SUB. VW_SUB has the tabs in it and VW_SUB embedds VW_CONTENT.
    BR,
    Roland

  • Is there a way to use a statically defined appearance stream in a dynamically created annotation?

    Hello,
    I want to create a document with cascading 'popups'.  Not the built-in text-only popup, but an annotation containing an appearance stream that defines text and images.  I'm currently using widget annotations based on a pushbutton field.
    Each page in my document has many citations that refer to other pages in the document.  When a user hovers over the citation, I want a 'popup' to appear containing a depiction of the destination.  However, as the destination will itself have citations, I also want the 'popup' to contain citations that the user can hover over, triggering another popup, etc.  In this way, a user could navigate throughout the document without leaving the page or even clicking the mouse.
    Obviously, with even a modest number of citations per page, pre-calculating and statically defining all of these widgets causes a combinatorial explosion, making the document sluggish and very large.
    Instead, I'd like to statically define appearance streams once per document, and then dynamically create annotations and assign the appropriate appearance stream using JS as the user navigates.
    So far I've created a named AP in the names dictionary, but I haven't been able to use it to dynamically set an appearance stream of a dynamically created widget annotation.
    Also, I've called Doc.getIcon(), passing in the named AP, which returns an Icon object.  However, after field.buttonSetIcon() and passing in the named AP, the button does not display the icon.
    Is there a way to use a statically defined appearance stream in a dynamically created annotation?
    Thank you,
    Dave

    Hi George, I've gotten named APs to work, and I expect hidden buttons will follow.  Thank you very much!
    Quick follow-up - I will have many documents embedded within the same pdf file, and some of these documents will contain identical popups.  However, I don't want to store identical icons in each document on account of file size.
    Instead, I'd like to store one instance of each icon for all documents in the file.
    Can I store all of the icons in a single document, and then access them by calling <DocName>.getField().getIcon() from any document in the file?
    Thank you again,
    Dave

  • How to get the co-ordinates of a dynamically created input field

    Hello Frn's
    i have created a dynamic text view . but this text view is not appearing at proper position . I want palce it infront of a dynamically created input field . how can i do this ?
    as i am thinking ...i should first of all  get info about the co-ordinates of   dynamaclly creatd input field . and with respect to these co-ordinates ...set the position of  text View .
    Please suggest  your thoughts .
    Thanks and Regards
    Priyank Dixit

    Hi,
    There is no provision in WD for getting screen coordinates and then placing the UI element.
    You to add the UI element to layout editor and based on the layout type it will add the UI element to respective position.
    I would advice not to create dynamic UI elements( instead you can create them statically and then play with visibility status through context binding ). This will be more effective way and less error prone. This is also recommended practice.
    still,For dynamic creation you can refer to following wiki:
    http://wiki.sdn.sap.com/wiki/display/WDABAP/CreatingUIElementsDynamicallyinAbapWebdynpro+Application
    regards
    Manas Dua

  • How dynamically create connection pool and Datasource

    Hi
    How I can dynamically create a connection pool and Data source in Oracle 10g Application server. In our J2EE application the user will be login with db user name, password and database name. I want to create connection pool and data source on the fly while login the user with database name. I our application we have access approximate 80 Databases. so my approach is given bellow
    1) Planning to create 80 connection pools and 80 Data sources so when user logs in while selecting the db name i will call the appropriate data source and create the DB connection. Is there any limitation to create number of data sources in oracle app server?
    2) Create DB connection with out using connection pool and data source. But i am not prefer this approach coz we need to handle some transaction in our application.
    Kindly throw some light on managing connection pool programmatically or in application run time.
    I would really appreciate if any one can provide any links or any inormation on this issue.
    Thanks in advance.

    Kindly let me know is there any drawbacks to create 80 Data Sources to connect 80 database in Oracle 10G App server and each data sources should have one connection pool. so i need to create 80 connection pool. Please let me know is this right approach or any work around to create Data source on fly for each request for corresponding database.

  • Assigning a 'dynamically created sequence' value to a variable

    in my procedure i am creating a sequence on the fly, i am preparing the name with some passed parameters like below
    v_seq_name := 'seq_'||loadid||v_table_name;
    execute immediate 'CREATE SEQUENCE '||v_seq_name||' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment by 1 cache 20';
    and now after doing some operations i need to assign the current value of sequence to a number variable i tried following but not working
    1) v_curr_value : = v_seq_name.currval ;
    2) select v_seq_name||'.nextval' into v_curr_value from dual;
    can you please suggest me how i can get the value in plsql block.

    DIVI wrote:
    in my procedure i am creating a sequence on the fly, i am preparing the name with some passed parameters like below
    v_seq_name := 'seq_'||loadid||v_table_name;
    execute immediate 'CREATE SEQUENCE '||v_seq_name||' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment by 1 cache 20';
    and now after doing some operations i need to assign the current value of sequence to a number variable i tried following but not working
    1) v_curr_value : = v_seq_name.currval ;
    2) select v_seq_name||'.nextval' into v_curr_value from dual;
    can you please suggest me how i can get the value in plsql block.Well, you haven't given the error you are getting but I guess the procedure isn't compiling? You need to execute immediate any reference to the sequence.
    Having said that, your architecture is probably wrong if you are dynamically creating things in a procedure.
    Why do you need to create them dynamically?

  • Dynamically creating a Record Group based on Previously entered Record Grou

    Forms [32 Bit] Version 10.1.2.3.0 (Production)
    Hi,
    I know how to dynamically create a record group based on a query and putting the code in When new form instance.
    My query is. I have a form which has multiple Record Groups and the user wants to dynamically create subsequent groups based on previous groups.
    For example
    I have a record group with selects a Location,
    when the user selects the Location from a list of values
    the 2nd record group called 'Cost Centres' will have to filter out only those with the locations selected above.
    How can I populate the 2nd record group at run-time when I do not know what site the user will select?
    If I simply populate in when new form instance as in location and just select everything, the list of values populates.
    CC field is a LIST ITEM and the list style is a POP LIST, it is not required.
    I have put the code in the Location field in the when-list-changed trigger.
    I am getting this error:
    frm-41337: cannot populate the list from the record group
    here is the code:
    DECLARE
    v_recsql Varchar2(1000); -- The SQL for creating the Record Group.
    v_recgrp RecordGroup; -- Record Group
    v_status Number; -- Return Value of Populate_Group function.
    c_where VARCHAR2(1000);
    BEGIN
         IF :location = '1' THEN
              c_where := ' substr(cost_centre,1,2) in (''01'',''02'')';
         ELSIF :location  = '2' THEN
              c_where := ' substr(cost_centre,1,2) in (''02'',''03'')';
         ELSIF :location   = '3' THEN
              c_where := ' substr(cost_centre,1,2) in (''01'',''11'',''07'')';
                   ELSE
              c_where :=  ' 1=1'; --EVERYTHING
         END IF;
    v_recsql := 'SELECT cost_centre, description  FROM   cost_centres  where '||c_where;
    -- Create the Record Group
    v_recgrp := CREATE_GROUP_FROM_QUERY('v_recgrp', v_recsql);
    IF NOT ID_NULL(v_recgrp)
    THEN -- No Error, record group has been successfully created.
    -- Populate Record Group
    v_status := POPULATE_GROUP('v_recgrp');
    IF v_status = 0
    THEN -- No Error. Record Group has been Populated.
    POPULATE_LIST('block.CC', 'v_recgrp');
    END IF; -- IF v_status = 0
    -- Delete the Record Group as it is no longer needed.
    DELETE_GROUP('v_recgrp');
    END IF; -- IF NOT ID_NULL(v_recgrp)
    END;thanks for your assistance.

    Hi,
    Once record status gets change for block you can not populate/repopulate the list item. Keep those list items as non-database item with different names and create different items as database orignal items. Than assign the values in WHEN-LIST-CHANGE trigger to the actual database items.
    -Ammad

  • How to set a value to a dynamically created node/attribute?

    Hi,
    I dynamically created attributes using the following method,
    IWDNodeInfo cbOptions = wdContext.getNodeInfo().addChild("cbOpt"+count, null, true, true, false, false, false, true, null, null, null);
    cbOptions.addAttribute("opt"+critEle.getQuest_Critid(), "ddic:com.sap.dictionary.string");
    How do i assign a  value to it now, since the node/attribute cannot be accessed via wdcontext?
    On a side note, it seems really troublesome if i need to use a checkbox grp(s) dynamically. I actually need to dynamically create a seperate node + attribute for each checkbox grp i have. Is there any better way to do this?
    Thanx in advance

    Hi
    Steps:
    1) Create the  action click is done statically (you cannot create action dyanmically)
    2) binding the  action click to checkbox dynamically 
    code
    public static void wdDoModifyView(IPrivateDynamicProgrammingView wdThis, IPrivateDynamicProgrammingView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
        //@@begin wdDoModifyView
         if(firstTime){
                      IWDTransparentContainer con=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
              IWDCheckBox checkBox=(IWDCheckBox)view.createElement(IWDCheckBox.class,"ck");
              IWDAction act=wdThis.wdCreateAction(IPrivateDynamicProgrammingView.WDActionEventHandler.CLICK,"");
              checkBox.setOnToggle(act);
              con.addChild(checkBox);
        //@@end
    Thanks and Regards,
    Arun

  • Dynamically create and remove TEXT items in forms

    Hi Guys,
    Is there a way to dynamically create and remove TEXT items in form. For example I have the EMP and DEPT table and when
    I select the EMP table name from the LOV, rows of the EMP table with column name and data should get displayed on the screen and likewise a similar action for DEPT table and
    so on. I have about 90 tables from where data could be required to view and edit. They all have varying number of columns.
    Any suggestions ?
    Thanks
    KMD
    null

    Use OLE concept of developer and map Excel as an object
    Nadeem
    null

Maybe you are looking for

  • Recover a deleted record in NOARCHIVELOG mode?

    Hello, I'm running 10gR2 in NOARCHIVELOG mode and we do not take backups (please, let's not get into a discussion about this!). I need to know if there is any possible way to recover a record once it has been deleted and a COMMIT has been issued? A u

  • Help me friends

    Hi Friends, I am planning to change my career in SAP.So i am planning to do SAP course.I am planning to do either SAP B1 or SAP R/3.can anybody suggest me among this which is best particularly country like india.please help which course as more scope

  • Facing problem in using JEditorPane as renderer for JList

    I am trying to use JEditorPane as renderer for a list. But I am facing some problems. First problem is the output in the editorpane is not shown properly. I want to show a html file, but only portion of the first line that is viewable in the editorpa

  • Collective PO - Generating Delivery Orders for STO using VL10B?

    Dear Folks, I have created a collective PO from various STO. After goods receipt for the PO, I need to generate delivery orders for the STO. Is it possible to create the delivery orders using transaction VL10B/VL10Batch instead of WF30/WF50? The issu

  • Setting default zoom level for creating bookmarks

    I am creating a PDF file in a couple of steps.  The main text is created from Word, which gives me bookmarks automatically set to "Inherit Zoom."  I also create subsets of tables and figures by "combining files in Acrobat" from Windows Explorer.  Tha