Dynamic creation of panels from variables

Hi folks,
I would kindly ask someone to help me with following issue:
I want to add a panel to the existing frame based on the value stored in a variable, like shown in example:
//panel creation
// of course the classes are defined somewhere else
PANEL1 p1 = new PANEL1();
PANEL2 p2 = new PANEL2();
String pname = new String("p1");
// depending on the value stored in pname I want to add p1 or p2
// to my frame
Of course I could do something like this:
if (pname.startsWith("p1")) {
myframe.add(p1); // and all .setVisible stuff ...
} else {
myframe.add(p2);
but I am looking for a smarter way to do it, since I have approx. 50 different panels...
Thanks,
KZic
For people familiar with Perl there is something like $$variable. Is there something like this in Java too?

Kresimir_Zic,
If the PANEL* classes will be in your classpath you can do something like this:
Class.forName("foo").newInstance();
This uses the no-arg constructor. To use other constructors, say one that takes a String arg, do something like:
Class cls = Class.forName("SomeClass");
Class[] params = {String.class};
java.lang.reflect.Constructor con = cls.getConstructor(params);
Object obj = con.newInstance("foo");
You may then continue to use reflection to work with the instantiated object or, if you can have all your panels implement an interface, take that easier route.
--A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Dynamic creation of table with variable field-names

    HI
    I am looking for a way in order to create a table during runtime. The problem is that the field names of the table are provided in another table.
    TO illustrate the case at hand, an example:
    The initial table contains the fields
    UserID - attribut_name - attribute_value
    Example Data
    d00587 - first_name    - Jon
    d00587 - last_name     - Smith
    d00587 - age           - 48
    d00127 - first_name    - Jack
    d00127 - last_name     - Daniels
    d00127 - position      - Manager
    Now I need to create a table per User that looks as follows:
    for user d00587
    first_name  -  last_name  -  age
    **Values
    Jon         -  Smith      -  48
    for user d00127
    first_name  -  last_name  -  positioin
    Jack        -  Daniels    -  Manager
    I split the initial table by sorting it according to userID and then looping into an itab with an AT END OF userid, thus I receive the table per user:
    Example iTab
    UserID - attribut_name - attribute_value
    Example Data
    d00587 - first_name    - Jon
    d00587 - last_name     - Smith
    d00587 - age           - 48
    However I have no clue on how to create a new internal table with field-names = attribute_name.
    Does anybody have an idea or example code for this?
    Thanks a lot for your help,
    Kind regards,
    Mingolo

    Hello Minima
    Here is some sample coding:
    DATA:
      gt_fcat  type lvc_t_fcat,
      gdo_data TYPE REF TO data.
    FIELD-SYMBOLS:
      <gt_itab> TYPE table.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
    *     I_BUFFER_ACTIVE              =
        i_structure_name             = 'MARA'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
      CHANGING
        ct_fieldcat                  = gt_fcat
      EXCEPTIONS
        inconsistent_interface       = 1
        program_error                = 2
        OTHERS                       = 3
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
    *      I_STYLE_TABLE             =
        it_fieldcatalog           = gt_fcat
      IMPORTING
        ep_table                  = gdo_data
    *      E_STYLE_FNAME             =
      EXCEPTIONS
        generate_subpool_dir_full = 1
        OTHERS                    = 2.
    IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ASSIGN gdo_data->* TO <gt_itab>.
    In your case, you would call the function module with your tables (D00587, D00127). Remove all fields from the fieldcatalog that you do not need before calling the static method.
    Regards
      Uwe

  • Dynamic creation of date in selection variant

    Hi All,
    I have a Z program for updating a field in BOM item. One of the input field in the report is "Valid From Date". Actually the current date is automatically fetched through a function module and it is defaulted in that field. 
    Our client is using selection variant for ease of use. The problem here is old date in the selection variant  is replacing the current date. I want current date to be created automatically during insertion of variant also. How can i solve this problem. Is there any selection variable inside the variant for dynamic creation of Date?
    Thanks
    Sankar

    As I know there is no setting for this. For any std or Z report variant function with L should act same way...anyway you discuss with your ADABer.
    See the help for variables
    Selection Variables                                                                               
    The following three types of selection variables are currently          
        supported:                                                                               
    o   Table variables from TVARV                                          
            You should use these variables if you want to store static          
            information. TVARV variables are proposed by default.                                                                               
    o   Dynamic date calculations:                                          
            To use these variables, the corresponding selection field must have 
            type 'D' (date). If the system has to convert from type T to type D 
            when you select the selection variables, the VARIABLE NAME field is 
            no longer ready for input. Instead, you can only set values using   
            the input help.                                                     
            The system currently supports the following dynamic date            
            calculations:                                                       
            Today's date                                                        
           From beginning of the month to today                               
           Today's date +/- x days                                            
           First quarter ????                                                 
           Second quarter ????                                                
           Third quarter ????                                                 
           Fourth quarter ????                                                
           Today's date - xxx, today's date + yyy                             
           Previous month                                                                               
    o   User-specific variables                                            
           Prerequisite: The selection field must have been defined in the    
           program using the MEMORY ID pid addition. User-specific values,    
           which can be created either from the selection screen or from the  
           user maintenance transaction, are placed in the corresponding      
           selection fields when the user runs the program.                                                                               
    The SELECTION OPTIONS button is only supported for date variables that 
       fill select-options fields with single values.                         
    i.e means we can do that with D also.

  • Dynamic creation of ComponentUsage

    Hi people,
    I want to reuse a view (ViewA) in different views (ViewB, ViewC, ViewD).ViewA has a quite complex logic, so it is necessary to outsource this view.  Not only the logic, but also the count of UIElements and contextelements is quite large, for this I don't want to implement this part redundant in the views A, C and D.
    I have to use ViewA in a table in  the TablePopin UIElement. Every line of the table should have its own instance of ViewA. Is that possible?
    My idea is it, to put the view in an own component. For every tableline I need an instance of the componentUsage. My problem is now, that I'm not able to create at runtime a ComponentUsage and at designtime I don't know how many instances I need. Is it possible in webdynpro to create dynamic instances of ComponentUsage?
    If you know an other way, that prevents me from implementing the view and its logic more times, please tell me!
    Thanks in  advance,
    Thomas Morandell

    Hi Thomas,
    just for clarification. Principally it is possible in Web Dynpro to dynamically create new component usages of the same type like an existing, statically declared one. This means after having defined a component usage of type ISomeComp (component interface definition) you can dynamically create new component usages which all point to the same component interface definition ISomeComp:
    wdThis.wdGetISomeCompUsage().createComponentUsageOfSameType();
    But this dynamic creation approach implies, that you must also embed the component interface view of this component usage to the view composition dynamically; and this is (unfortunately) quite cumbersome and complicated based on the existing Web Dynpro Java API (it is not yet optimized for a simple dynamic view composition modification.
    Additionally, like Valery pointed out, the dynamic creation of new component usages is not compatible with table popins.
    Regards, Bertram

  • Dynamic Creation of UI in adobe forms??

    Hi Experts,
    I need to create a dynamic interactive form and dynamic UI elements in the interactive form.
    As per my requirement I need to display a pdf and I will be getting values from the RFC's. I need to show the form segments and the UI elements only when there's a data from the RFC else not. I am unable to understand whether this requirement needs generation of the UI elements dynamically or I can do it statically as well.
    The form thus generated will be having data from the RFC which based on the data quantity may exceed to n number of pages.
    In case it needs dynamic creation can you suggest me please how to achive it in interactive forms?
    Helpful answers will be appreciated.
    Warm Regards,
    Gaurav

    Hi,
    subForm1:-
    Flow content
    Allow page breaks
    Place: following previous-----> This means when you are repeating the subform the previous one should be followed.
    Say you have a table and have 3 columns in it.
    After 1st column is completed, the next column should come with 1st comun
    After: Continue filling parent--->Continously fill the data with the parent element
    Repeat sub form min count is 1 : Minimum of 1 line item will be printed
    Height: Expand to fit is true.: If the field height is increased it automatically expands.
    For help in Adobe Press F1 or Goto Help--> Adobe Designer Help in Adobe Designer
    After installing Adobe Designer, goto the specific folder
    C:\Program Files\Adobe\Designer 8.0\EN you can get sample documents.
    For help press F1 after opening designer.
    Sub Form1: Content--> Flowed, Flow direction --> Top to bottom
                       Binding --> Check the checkbox Repeat Subform for each data item
    Subform 2: Content --> Positioned, No pagination No binding settings changes needed.
    Hey i forgot to mention the Header Subform where you create all these subforms should be flowed.
    Try it once like this and lte us know
    Edited by: Sankar Narayana on Oct 3, 2008 5:06 PM

  • How to retrieve dynamic filter value submitted from control query to .....

    How to retrieve dynamic filter value submitted from control query to broadcast query.....
    I'm trying to change the hierarchy version determined by a userexit variable in the broadcast query.
    The Hierarchy Version should be dependent on the input filter delivered by the bursting query.
    But how do I catch the dynamic filter value which has been submitted by the bursting query,
    with other words:  where does the bursting query store it's out put while sequentially starting the broadcast query value by value?
    BTW: the filter value from the bursting query appears under "dynamic filter values" in the information of the broadcast query...
    Any thoughts are welcome!
    Edited by: Heinrich Krupp on Jun 24, 2009 1:25 PM

    Further information,
    Report is used via webi only, not Xcelsius or Dashboard.
    Report is consuming BI Web Services.
    Although we can pass in prompt values to BI Services, I couldn't find if we could pass a variable or dimension object into this field. Anyone knows?

  • Dynamically created COLLAPSIBLE PANELS

    In case this might help others, I thought I would share how I
    dynamically create Collapsible Panels using MySQL, PHP, and SPRY.
    Please note that I am not a master PHP coder and so there might be
    a more efficient method but this does work great for me. Here is my
    scenario. I have a MySQL table which holds a list of user
    applications. Some applications then have individual modules which
    are stored in a seperate table and related to applications by
    app_id. I want to display the list of applications and then for
    applications that have modules I create a collapsible panel to
    display the modules.
    My Applications:
    mysql_select_db($database_ppg_conn, $ppg_conn);
    $query_applications = "SELECT * FROM applications ORDER BY
    active desc, name ASC";
    $applications = mysql_query($query_applications, $ppg_conn)
    or die(mysql_error());
    $row_applications = mysql_fetch_assoc($applications);
    $totalRows_applications = mysql_num_rows($applications);
    code for application lists and collapsible panels:
    <div id="maincontainerbox" align="center">
    <div class="ppgaccounthdr">
    PPG Applications
    </div>
    <div class="ppgaccountrow_active">
    <a href="ppgaccounts_update.php?app=new">Add New
    Application</a>
    </div>
    <?php
    $icount = 0;
    do { ?>
    <?php switch ($row_applications['modules']) {
    case "Y":
    $modules = 1; //flags the building of collapsible panel to
    display available modules for current application.
    ++$icount; //tracks # of applications that have modules.
    This is used to properly create multiple collapsible panels.
    break;
    default:
    $modules = 0; //no modules for current app
    break;
    } ?>
    <?php switch ($row_applications['active']) {
    case "Y":
    if ($modules == 1) {
    echo '<div id="CollapsiblePanel'.$icount.'"
    class="ppgaccountrow_active1"><div
    class="ppgaccountrow_active">';
    } else {
    echo '<div class="ppgaccountrow_active">'; }
    break;
    default:
    echo '<div class="ppgaccountrow_notactive">';
    break;
    ?>
    <a href="ppgaccounts_update.php?app=<?php echo
    $row_applications['id'];?>"><?php echo
    $row_applications['name']; ?></a>
    <?php if ($modules == 1) {
    echo '</div>';
    echo '<div class="CollapsiblePanelContent">';
    $query_appmodules = "SELECT *
    FROM app_modules
    WHERE app_id = {$row_applications['id']}
    ORDER BY active desc, name ASC";
    $appmodules = mysql_query($query_appmodules, $ppg_conn) or
    die(mysql_error());
    $row_appmodules = mysql_fetch_assoc($appmodules);
    $totalRows_appmodules = mysql_num_rows($appmodules);
    echo '<div class="appmodulerow_active">';
    echo '<a
    href="ppg_app_modules_update.php?id=new&app_id='.$row_applications['id'].'">Add
    New Module</a>';
    echo '</div>';
    do {
    switch ($row_appmodules['active']) {
    case "Y":
    echo '<div class="appmodulerow_active">';
    break;
    default:
    echo '<div class="appmodulerow_notactive">';
    break;
    echo '<a
    href="ppg_app_modules_update.php?id='.$row_appmodules['id'].'"
    title="Update Application
    Module">'.$row_appmodules['name'].'</a></div>';
    } while ($row_appmodules = mysql_fetch_assoc($appmodules));
    mysql_free_result($appmodules);
    echo '</div>';//close content div for collapsible
    panal
    } ?>
    </div>
    <?php } while ($row_applications =
    mysql_fetch_assoc($applications)); ?>
    </div>
    So when my application record has a flag saying that it
    possesses modules I increment $icount and then use
    echo '<div id="CollapsiblePanel'.$icount.'"
    class="ppgaccountrow_active1"> to build the collapsible
    panel. Notice the $icount in the div id. Now at the bottom of the
    HTML I do the following.
    <?php
    $i = 0;
    do {
    ++$i;
    echo 'var CollapsiblePanel'.$i.' = new
    Spry.Widget.CollapsiblePanel("CollapsiblePanel'.$i.'",{contentIsOpen:false});';
    } while ($i <= $icount);
    ?>
    //-->
    </script>
    This creates a collapsiblepanel for each application which
    has modules.
    I hope I have described this ok and that it might help
    somebody out. If you have suggestions on how to do it better then
    please do let me know.
    Thanks,
    Lee Goolsby

    Nice. Thanks for posting this, Lee.

  • Open tabbed panels from dropdown list option value

    I have about 10 tabbed panels on my page.
    I created a dropdown list, <option value></option value>.
    I need to open the specific panel when an option is selected from the dropdown list.  I know how to open tabbed panels by URL, a button, and a link on the same page.  But how do i open a tabbed panel from a dropdown list.  The <option value> in IE does not allow for onclick events in IE. 

    Yes and I have been trying to find that.  Right now I have it setup where the onchange event is "location = this.options[this.selectedIndex].value;">
    and then I have each<option> in the dropdown list with teh value=http://URL.com?tab=3#tabbedpanels1.
    It works but it isn't as dynamic as I would like.  When i select each option in the dropdown, it refreshes the page and opens the correct tabbed panel. Then the dropdown list is reset to the default value because the page refreshed.  I wanted to do this without the page refreshing, that way the dropdown list item remains at what I selected to open the tabbedpanel. and plus, I didn't want the page to refresh everytime but to just open the tabbedpanel the same way as if i made a button to open it.

  • Add dynamic parameters for Year, From Week and To Week.

    hi all,
    my requirement is Add dynamic parameters for Year, From Week and To Week.
    can any one help how to do this one plz....
    in Answers..
    advanced Thanks..

    hi kansal,
    These requirement for the BI Publisher reports,
    1)Add dynamic parameter for year, From week and To week.
    2) Year to default to Current Year.
    that's what i have dude..
    may be we need to assign the dynamic variables for year ..
    Edited by: 932326 on Sep 4, 2012 7:16 AM

  • CFPOP and the FROM variable

    I use CFPOP too read mails,
    And I want to do different processing following the email adress found in the
    FROM variable.
    But, depending of the Mail agent sending mails,
    The FROM variable contains different types of values :
    1 - can be the Email (alone)
    2 - can be the name of the person, without any email
    3 - can be the name of the person followed by the email
    4 - can be the name of the person followed by an email of the mail server.
    As I need to find the Email of the sender, only in cases 1 and 3 can give me the right email.
    Can someone explain this ?
    I do not see anything in CF to solve this, even in programming or in the CF administrator.
    I have the impression that , what is retruned in the "FROM" depends of the mail server ?
    Thanks for any help, explanation on that subject,
    Pierre.

    Thanks for your suggestion,
    the header variable does not give the Email adress of the sender,
    it gives the same : the person name.
    here is the result of that variable :
    Received: from [192.168.13.131] by email.images-creations.fr [192.168.13.209] with SmartMax MailMax for [email protected]; Tue, 18 Oct 2011 16:56:29 +0200 Return-Path: X-SmartMax-AuthUser: Received: from mx1-1.images-creations.fr (localhost [127.0.0.1]) by mx1-1-relay.images-creations.fr (Postfix) with ESMTP id 76EC432E0D9 for ; Tue, 18 Oct 2011 16:56:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mx1-1.images-creations.fr X-Spam-Level: ***** X-Spam-Status: No, score=6.0 required=8.0 tests=BAYES_50,HTML_MESSAGE, LIMSI_S36,RCVD_IN_NJABL_PROXY,TVD_SPACE_RATIO autolearn=no version=3.2.5 Received: from smtp.smtpout.orange.fr (smtp12.smtpout.orange.fr [80.12.242.134]) by mx1-1.images-creations.fr (Postfix) with ESMTP id 63CFE32E0D5 for ; Tue, 18 Oct 2011 16:56:26 +0200 (CEST) Received: from StationDev ([80.14.60.39]) by mwinf5d47 with ME id mEwR1h00J0qnSTU03EwRkh; Tue, 18 Oct 2011 16:56:26 +0200 X-ME-engine: default From: "Pierre LARDE" To: Subject: 13744 Date: Tue, 18 Oct 2011 16:56:24 +0200 Message-ID: <000501cc8da6$1b58e540$520aafc0$@fr> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0006_01CC8DB6.DEE1B540" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcyNpfyCtDyvnB33RuaPaOwckewWUg== Content-Language: fr
    the From is there also the name , not an Email.
    Thanks for any other suggestion,
    Pierre.

  • Dynamically Populate a Panel Dashboard in a Fragment

    I am working with a customized Panel Dashboard in a fragment (jsff).  The user can customize the dashboard (re-order panel boxes, define number of columns, add/remove panel boxes, etc.) and our goal is to persist these customizations so they are available across different sessions.  To achieve this, I created several database tables for these customizations and tied them to the user table.  When the user opens the application, the dashboard fragment is the first fragment to display.  I am loading the information from the database then constructing the Panel Dashboard.  The dashboard starts out with a static set of Panel Boxes (as seen in main_dashboard.jsff below), then based on the data, I re-order them and set rendered equal to false for panel boxes which the user removed.
    My problem is I need to do this before the page is rendered.  To do this, I am calling the customization method from the constructor of my backing bean.  The RichPanelDashboard which I bind the UI Component to is not yet available.  I have tried several things which did not work, including:
    - Adding the @PostConstruct annotation to my customization method.
    - Pulling the component from the View Root: RichPanelDashboard mainDashboard = ( RichPanelDashboard )FacesContext.getCurrentInstance().getViewRoot().findComponent( "mainDash" );
    - Added a "preRenderComponent" event to the page: <f:event type="preRenderComponent" listener="#{main_dashboard.setupCustomDashboard}"/> (after a web search, it appears the f:event tag is not supported in ADF Fragments).
    I've encountered this problem in the past with different UI Components.  Most notably, I needed to populate a SelectOneListBox before the page is rendered.  I solved the problem by adding a <f:selectItems> child to the <af:selectOneListBox> and setting the value of that tag to a List of SelectItems in my backing bean and populating that list on bean instantiation.  Is there a similar option for a Panel Dashboard and a List of Panel Boxes?  The thought of using an <af:forEach> tag had crossed my mind to populate the panel dashboard with panel boxes, but as you can see in my code below, I am already using <af:forEach> to dynamically populate the first panel box with command links.  Unless there is a way to dynamically populate a panel dashboard with dynamically populated panel boxes in the fragment, I don't think the for each approach will work (there doesn't appear to be a way to dynamically populate the panel boxes with UI components in the backing bean either).
    Sample code is below.  Any suggestions are greatly appreciated.
    main_dashboard.jsff
    {code}
                    <af:panelDashboard id="mainDash" columns="2" rowHeight="250px" styleClass="AFStretchWidth"  inlineStyle="height:1000px;"
                                       dropListener="#{main_dashboard.handleReorder}" binding="#{main_dashboard.panelDashboard}">
                        <!--f:event listener="#{main_dashboard.setupCustomDashboard}" type="preRenderComponent"/-->
                        <af:panelBox id="openedBox" text="Recently Opened">
                            <af:componentDragSource/>
                            <af:forEach var="item" items="#{main_dashboard.openedCommandLinks}">
                                <af:commandLink text="#{item.text}" partialSubmit="true"
                                                actionListener="#{main_dashboard.editorFiredFromDashboard}"/>
                            </af:forEach>
                        </af:panelBox>
                        <af:panelBox id="editedBox" text="Recently Edited">
                            <af:componentDragSource/>
                            <af:outputText value="Recently Edited" id="ot2"/>
                        </af:panelBox>
                        <af:panelBox id="openCPsBox" text="My Open Config Packages">
                            <af:componentDragSource/>
                            <af:outputText value="My Open Config Packages" id="ot3"/>
                        </af:panelBox>
                        <af:panelBox id="testBox" text="Test Panel Box">
                            <af:componentDragSource/>
                            <af:outputText value="For Testing Purposes Only" id="ot4"/>
                        </af:panelBox>
                    </af:panelDashboard>
    {code}
    MainDashboardBackingBean (main_dashboard)
    {code}
        private RichPanelDashboard panelDashboard;
        public MainDashboardBackingBean() {
            setupCustomDashboard();
        // Using @PostConstruct annotation did not work
        // @PostConstruct
        public void setupCustomDashboard() {
            // Set custom column count
            Integer selectedColumnCount = customDashboardDcl.getColumnCount();
            // Pulling from FacesContext did not work
            // RichPanelDashboard mainDashboard = ( RichPanelDashboard )FacesContext.getCurrentInstance().getViewRoot().findComponent( "mainDash" );
            // mainDashboard.setColumns( selectedColumnCount );
            // Null Pointer happens here
            panelDashboard.setColumns( selectedColumnCount );
            // Create the new ordered list
            if( customDashboardMap != null ) {
                List<String> reorderedIdList = new ArrayList<String>( customDashboards.size() );
                for( Integer key : customDashboardMap.keySet() ) {
                    String customId = customDashboardMap.get( key );
                    for( UIComponent currChild : panelDashboard.getChildren() ) {
                        String currId = currChild.getId();
                        if( customId == currId ) {
                            reorderedIdList.add( currId );
                            break;
                // Unused Panel Boxes must still be added, but not rendered
                for( UIComponent currChild : panelDashboard.getChildren() ) {
                    String currId = currChild.getId();
                    if( !reorderedIdList.contains( currId ) ) {
                        currChild.setRendered( false );
                        reorderedIdList.add( currId );
                // Apply the changes
                ComponentChange change = new ReorderChildrenComponentChange( reorderedIdList );
                change.changeComponent( panelDashboard );
            AdfFacesContext.getCurrentInstance().addPartialTarget( panelDashboard );
        public RichPanelDashboard getPanelDashboard() {
            return panelDashboard;
        public void setPanelDashboard(RichPanelDashboard panelDashboard) {
            this.panelDashboard = panelDashboard;
    {code}

    Hi,
    I did actually populate my panelDashboard with a forEach over a list of dashboard items.
              <af:panelDashboard id="pd1" columns="2" rowHeight="#{pageFlowScope.myDashboard.rowHeight}"
                                 binding="#{pageFlowScope.myDashboard.dashboard}"
                                 dropListener="#{pageFlowScope.myDashboard.move}">
                <af:forEach items="#{pageFlowScope.myDashboard.dashboardItems}"
                            var="panels">
                    <af:panelBox text="#{panels.localizedTitel}"
                                 id="${panels.id}" background="medium" showDisclosure="false">
                      <af:region value="#{panels.regionTaskflow}"
                                 id="r2"/>
                      <af:componentDragSource/>
                    </af:panelBox>
                </af:forEach>
              </af:panelDashboard>
    All my panels are rendered as regions that are dynamically filled with single page task flows which are bound to the page containing the dashboard.
    My DashboardItem class creates the RegionModel from the task flow binding
            public RegionModel getRegionTaskflow() {
                String regionBinding = "#{bindings." + taskflow + ".regionModel}";
                RegionModel model = (RegionModel)JSFUtils.resolveExpression(regionBinding);
                return model;
    I don't know if that's a good practice but it works.
    Hope that helps,
    Achim

  • Sliding panels from data - single panel

    I would like to use the spry sliding panels from data widget
    with only 1 panel at a time. The sample has two at a time.
    Most of the code makes sense, but every modification I try
    breaks the next/previous navigation.

    I modified the code from the example for you, so now it works
    with just one panel visible.
    Changes are:
    set the width of the wigdet en
    slidingpanel class to 250 instead of 500.
    var numberOfPanelsPerView = 1
    remove all the
    spry:if="{ds_RowNumber} % 2 == 0" attributes
    change
    onclick="sp1.showPanel('p{prevStartIndex}') to
    onclick="sp1.showPreviousPanel()
    change
    onclick="sp1.showPanel('p{nextStartIndex}') to
    onclick="sp1.showNextPanel()
    This all leads to the following code
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xmlns:spry="
    http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    <title>Sliding Panels Sample</title>
    <script type="text/javascript"
    src="../../widgets/slidingpanels/SprySlidingPanels.js"></script>
    <script src="../../includes/xpath.js"
    type="text/javascript"></script>
    <script src="../../includes/SpryData.js"
    type="text/javascript"></script>
    <style type="text/css">
    <!--
    .widget {
    /* width: 500px;*/
    width: 250px;
    height: 230px;
    border: solid 1px black;
    background-color: #CCCCCC;
    .SlidingPanels {
    /* width: 500px; */
    width: 250px;
    height: 230px;
    overflow: visible;
    position: relative;
    float: left;
    padding: 0px;
    .SlidingPanelsContainer {
    width:8000em;
    height:230px;
    position: absolute;
    float:left;
    margin: 0px;
    padding: 0px;
    .SlidingPanelsContent {
    width: 250px;
    height: 230px;
    float: left;
    .content {
    width: 241px;
    height: 200px;
    float: left;
    overflow: hidden;
    padding: 4px;
    border-right: solid 1px #999999;
    .panelnav {
    clear: both;
    height: 42px;
    .left {
    text-align: left;
    margin-left: 4px;
    .right {
    text-align: right;
    margin-right: 4px;
    -->
    </style>
    <link href="../../css/samples.css" rel="stylesheet"
    type="text/css" />
    <script type="text/javascript">
    <!--
    var ds1 = new
    Spry.Data.XMLDataSet("../../demos/products/products.xml",
    "/products/product");
    function TruncateStrIfNeeded(str, maxChars)
    // Decode our string so when we count characters, we aren't
    counting
    // the chars in an entity name.
    str = Spry.Utils.decodeEntities(str);
    if (str.length > maxChars)
    str = str.substr(0, maxChars - 4) + " ...";
    return Spry.Utils.encodeEntities(str);
    ds1.addObserver({ onPostLoad: function() {
    var numberOfPanelsPerView = 1; //was 2
    var rows = ds1.getData();
    var numRows = rows.length;
    // Add some custom columns to our data set.
    for (var i = 0; i < numRows; i++)
    var row = rows
    // Add a 'teaser' column which is basically the description,
    // but truncated so it can fit within our panel.
    row.teaser = TruncateStrIfNeeded(row.desc, 400);
    // Add a 'viewStartIndex' column that indicates what view
    this row
    // belongs to.
    row.viewNumber = Math.floor(i / numberOfPanelsPerView) + 1;
    row.viewStartIndex = i - (i % numberOfPanelsPerView);
    row.prevStartIndex = row.viewStartIndex -
    numberOfPanelsPerView;
    row.nextStartIndex = row.viewStartIndex +
    numberOfPanelsPerView;
    //-->
    </script>
    </head>
    <body>
    <h3>Building a Sliding Panels widget with Spry
    Data</h3>
    <p>This sample creates a Sliding Panels widget by using
    Spry Data to build the repeating markup. In this sample the content
    panels are generated dynamically and the photo in each panel comes
    from Spry Data. The text is static, which is just there for
    example.</p>
    <p>The content panel is generated in a Spry:repeat
    region. An important thing in the panel widget is that each panel
    should have a unique ID. This ID is generated with a Spry data
    reference. Using the same method, the Panel links are generated the
    same way, using the same data values. This ensures that the panel
    links and IDs match up correctly. In this sample, the visible
    window is twice as wide as the content panel. This allows for 2
    panels to show at once. The links, therefore, need to show only
    every other panel number. This will allow the panel to move by 2
    content panels each time. To do this, a spry:if is used to only
    display the even number panel numbers.</p>
    <p>Note: Since this sample depends on Spry Data for the
    content and markup, it will not degrade when JavaScript is turned
    off. This sample shows how to construct this widget with Data.
    Determine if this method fits your needs with degredation and
    accessibility in mind. Also, this sample is more complicated only
    because we are showing 2 panels at once and there are differing
    lengths of text in the panels.</p>
    <p>Page: <span spry:region="ds1"
    spry:repeatchildren="ds1"> <a href="#"
    onclick="sp1.showPanel('p{viewStartIndex}'); return
    false;">{viewNumber}</a> </span></p>
    <div class="widget">
    <div id="apDiv1" class="SlidingPanels"
    spry:region="ds1">
    <div class="SlidingPanelsContainer">
    <div id="p{ds_RowNumber}" class="SlidingPanelsContent"
    spry:repeat="ds1">
    <div class="content"> <img
    src="../../demos/products/{boximage}" width="75" height="56"
    hspace="5" vspace="5" align="left" alt="Sample Images from Spry
    Data." />
    <p>{desc}</p>
    </div>
    <div class="panelnav left"><a href="#"
    onclick="sp1.showPreviousPanel(); return
    false;">&lt;&lt;
    Previous</a>          <a
    href="#" onclick="sp1.showNextPanel(); return false;">Next
    &gt;&gt;</a></div>
    </div>
    </div>
    <script type="text/javascript">
    var sp1 = new Spry.Widget.SlidingPanels("apDiv1");
    </script>
    </div>
    </div>
    </body>
    </html>

  • Target Named Anchor in a Spry Collapsible Panel from a different page

    Let me start by saying I have combed this forum (and others) looking for a resolution to this.  I am familiar with David Powers solution on Foundationphp.com and am using that code in project to open the collapsible panel from a separate page and it works beautifullly.  The problem I have is that I want the browser to move down to a specific named anchor inside that opened collapsible panel when clicked from a different page.
    Snippets of my current code here.
    Below is the code that I have on an image that when clicked goes to the correct page and opens Panel1.  Works Perfectly!
    <a href="bamboo-species.php?col1=open#CollapsiblePanel1"><img src="images/Content/Photos/HomeScroll/blackTmbor.jpg" width="227" height="175" /></a>
    Below is the link to the .js file and the script in the head of the target page
    <script type="text/javascript" src="SpryAssets/SpryURLUtils.js"></script>
    <script type="text/javascript">
    // Grabs the values of the URL parameters for the current URL.
    var params = Spry.Utils.getLocationParamsAsObject();
    </script>
    Below is the code that I have on the target page for Panel1
    <script type="text/javascript">
    var CollapsiblePanel1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1", {contentIsOpen:params.col1 ? true : false},{duration: 1000});
    </script>
    If I have a named anchor say <a name="species1" id="species1"></a> down in the page, how do I target that named anchor from my link on the separate page.  I have tried adding the #species1 to the end of the link on the link page (see below) but with no luck. I believe those were the instructions on foundationphp.com site.
    <a href="bamboo-species.php?col1=open#CollapsiblePanel1#species1"><img  src="images/Content/Photos/HomeScroll/blackTmbor.jpg" width="227"  height="175" /></a>
    I hope (and suspect) that this is an easy fix, I just do not know what it is.  Any help or direction where to look is greatly appreciated.

    I once had the same issue can created a small function that allows me to "jump" to a element.
    function scrollTo( element ){
         var stylize = function( element){ return !+"\v1" ? element.currentStyle : document.defaultView.getComputedStyle( element , null ) },
              getPosition = function( element ){
                   // based on the SpryEffect's module:
                   var computedStyle, tryComputedStyle,
                        position = { x: 0, y: 0 };
                        if ( element.style.left  && /px/i.test(element.style.left) ){
                             position.x = parseInt(element.style.left, 10); // without padding
                        } else {
                             computedStyle = stylize( element );
                             var tryComputedStyle = computedStyle && computedStyle.left && /px/i.test( computedStyle.left );
                             if (tryComputedStyle)
                                  position.x = parseInt( computedStyle.left, 10 ); // without padding, includes css
                             if(!tryComputedStyle || position.x == 0) // otherwise we might run into problems on safari and opera (mac only)
                                  position.x = element.offsetLeft;   // includes padding
                        if ( element.style.top && /px/i.test(element.style.top) )
                             position.y = parseInt( element.style.top, 10); // without padding
                        else
                             if ( !computedStyle )
                                  computedStyle = stylize( element );
                        var tryComputedStyle = computedStyle && computedStyle.top && /px/i.test( computedStyle.top );
                             if ( tryComputedStyle )
                                  position.y = parseInt( computedStyle.top, 10 ); // without padding, includes css
                             if( !tryComputedStyle || position.y == 0 ) // otherwise we might run into problems on safari and opera (mac only)
                                  position.y = element.offsetTop;   // includes padding
                   return position;
              scroll( 0, getPosition( element ).y );
    So now we have a scrollTo function that accepts a pure HTML element as argument, all what is left to do is figure out if we have a hash, and if the anchor exits on the page.
    ( hopes this works, i wrote it without testing, but you get the general idea ):
    if( window.location.hash ){
         var hash = window.location.hash.substr(1), // remove the # from the hash
         element;
         // as anchors can also be used with id attributes, check that first,
         element = document.getElementById( hash );
         // maby we used name="" attribute
         if( !element && ( element = document.getElementsByName( hash )) ){
              element = element[0];
         // if we have a match:
         if( element ){
              // give the collapsible panel some time to init and update the DOM;
              setTimeout(function(){ scrollTo( element ) },0);
    \o/

  • Currency Translation not working with "Time Reference from Variable"

    We have created several Currency Translations using RSCUR with a fixed "Key Date".  All have been working fine until we got the request to allow a variable date for the exchange rate date.  I have built a variable on 0DATE which I am putting a default date value into using user exit.  This default date is the SAME date as the fixed "Key Date" which we have been using.  Unfortunately when we use the "Time Reference from Variable" option and use this new variable, no currency conversion is taking place, instead it only shows the original currency values.  I am 100% sure that my variable is getting a value and it is the same date we are using for the fixed "Key Date" value so both methods should be using the exact same exchange rates.  The documentation that I can find states:
    ●      Time reference: The time reference for the currency translation can be either fixed or variable.
    If the time reference is fixed, the time at which the exchange rate is determined is independent of the data. You have the following options:
    ○       You can establish that the time reference be determined upon translation.
    ○       You can select the current date.
    ○       You can specify a fixed date as the key date.
    ○       You can specify any variable that exists for InfoObject 0DATE.
    ○       You can establish that the query key date be used. This is determined in the query settings.
    In my case I am only switching from option "You can specify a fixed date as the key date"=(Key Date) to "You can specify any variable that exists for InfoObject 0DATE"=(Time Reference from Variable).
    What am I missing?  Any help is appreciated.

    I neglected to mention that we are calling this currency translation through a WAD button using the SET_CURRENCY_TRANSLATION command.  I did do a test by applying the currency conversion within query key figure.  This seems to work.  So it appears the issue is with how the WAD is processing the variable, not the query.  When I display the variable in a drop down item within the WAD it does have the default value that I have assigned in user exit.

  • Mass creation of PO from excel sheet

    Dear all
           Kindly let me know the method for Mass creation of PO from excel sheet
    Regards
    Chandra mohan

    Hi, check these links....
    /people/hema.rao/blog/2006/09/14/lsmw--step-by-step
    http://www.sap-img.com/sap-data-migration.htm
    get more from first thread.........

Maybe you are looking for

  • How can I attach a picture to show architecture, workflow in my post

    One way in my mind is that I can supply a webpage link to my blog website. The good news is that it works, but the downside is that everyone needs to follow the link in other webpage, and then back to this message and give an answer. It is a little b

  • How to make a program run in background?

    Is there any ways to make an invisible program with java? a program that is running in background but the user cannot see it and it's not in the Start bar and the user cannot close it.

  • Archivelog mode

    I'd like to make sure of the following: when the database works in noarchivelog mode it does not matter what's the value of log_archive_start parameter whether it is true or false .I mean if log_archive_start in this case is set to true it won't arch

  • Creating Workflow Container Elements

    Hi,                I am looking to create two new workflow container elements of lenght 80char for 'WS92000027'  inorder to hold the required name to be outputted in the workflow . Could you please let me know setp by step procedure to achive this as

  • I no longer have a favorets tab, unless I use internet exployer.

    when I downloaded fire fox,, why do I not have a favorets button, I have to still open internet exployer to look at anything that I have saved. '''bold text'''