Reg :getting values loaded in value help in runtime based on user input

I have a table column named partners with a drop down.when i select a value from the drop down i need to load the values in value help in next column(partner fun) in the table based the the user selection made in the 1st column.plz help me.
currently the coding used by me is
try
    String partfn=wdContext.currentTablepartnersElement().getPartnerfn();
    if(partfn.equals("ShiptoParty"))
      wdComponentAPI.getMessageManager().reportSuccess("1");
     IWDAttributeInfo partattributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateSalesdet.ITablepartnersElement.PARTNER);
     wdComponentAPI.getMessageManager().reportSuccess("2");
//from this part its not working
     ISimpleTypeModifiable part = partattributeInfo.getModifiableSimpleType();
     //ISimpleType part=partattributeInfo.getSimpleType();
     wdComponentAPI.getMessageManager().reportSuccess("3");
//     Set field label and populate valueset
    part.setFieldLabel("key");
     IModifiableSimpleValueSet partvalueSet =  part.getSVServices().getModifiableSimpleValueSet();     
     wdComponentAPI.getMessageManager().reportSuccess("4");     
     for (int i = 0; i < wdThis.wdGetSalescustomctrllerController().wdGetContext().nodeLt_Kna1().size();i++)
wdComponentAPI.getMessageManager().reportSuccess("5");
partvalueSet.put(wdThis.wdGetSalescustomctrllerController().wdGetContext().nodeLt_Kna1().getLt_Kna1ElementAt(i).getKunnr(),wdThis.wdGetSalescustomctrllerController().wdGetContext().nodeLt_Kna1().getLt_Kna1ElementAt(i).getName1());
             wdComponentAPI.getMessageManager().reportSuccess("custid"+wdThis.wdGetSalescustomctrllerController().wdGetContext().nodeLt_Kna1().getLt_Kna1ElementAt(i).getKunnr());
    catch(Exception ex)
          wdComponentAPI.getMessageManager().reportSuccess("error in partfn table rfc"+ex);

hai ayappa,
              my context structure is
                    partnertable
_subnode
_Attribute1
_Attribute2
                     |_attribute(attribute of partnertable node)
when i set the singleton property of subnode to false i have another table in the same view wch is getting affected.also when i select the value from partners table attribute i need the subnode s attribute get populated.

Similar Messages

  • Redirect to different pages based on user input value

    Hello,
    Anyone please help.
    I am trying to redirect to different pages based on user inputs. I have a form in which I have one text item and a submit button. For example consider text item to be empno; So once the user enters a empno and hits submit button; I need to redirect to different pages based on this job.
    For Ex: if user inputs empno whose job is 'ANALYST' then redirect to page 1
    if user inputs empno whose job is 'MANAGER' then redirect to page 10
    For this scenario. i wrote a pl/sql process for the submit button; but no luck -- its not at all redirecting instead its in the same page. Below is the process.
    declare
    v_job varchar2(20);
    begin
    select job into v_job from emp where empno = :P9_EMPNO_R;
    if v_job = 'ANALYST' then
    OWA_UTIL.REDIRECT_URL('f?p=&APP_ID.:1:&SESSION.::&DEBUG.::', TRUE);
    end if;
    if v_job = 'MANAGER' then
    OWA_UTIL.REDIRECT_URL('f?p=&APP_ID.:10:&SESSION.::&DEBUG.::', TRUE);
    end if;
    end;Please help. I am using Oracle APEX version 4.2 and database Oracle 11g R2
    Thanks,
    Orton

    orton607 wrote:
    Hello,
    Anyone please help.
    I am trying to redirect to different pages based on user inputs. I have a form in which I have one text item and a submit button. For example consider text item to be empno; So once the user enters a empno and hits submit button; I need to redirect to different pages based on this job.
    For Ex: if user inputs empno whose job is 'ANALYST' then redirect to page 1
    if user inputs empno whose job is 'MANAGER' then redirect to page 10
    For this scenario. i wrote a pl/sql process for the submit button; but no luck -- its not at all redirecting instead its in the same page. Below is the process.
    declare
    v_job varchar2(20);
    begin
    select job into v_job from emp where empno = :P9_EMPNO_R;
    if v_job = 'ANALYST' then
    OWA_UTIL.REDIRECT_URL('f?p=&APP_ID.:1:&SESSION.::&DEBUG.::', TRUE);
    end if;
    if v_job = 'MANAGER' then
    OWA_UTIL.REDIRECT_URL('f?p=&APP_ID.:10:&SESSION.::&DEBUG.::', TRUE);
    end if;
    end;Please help. I am using Oracle APEX version 4.2 and database Oracle 11g R2
    Thanks,
    OrtonI have a similar scenario in my application and this is how I handle it.
    1. Create a page item on the page, say Px_PAGE_NUM
    2. Create a "On Submit - After Computations and Validations" page process to set the above page item. In your case, you can use the same logic that you have already in place (except the call to OWA_UTIL.REDIRECT_URL) :
    declare
    v_job varchar2(20);
    begin
    select job into v_job from emp where empno = :P9_EMPNO_R;
    if v_job = 'ANALYST' then
       :Px_PAGE_NUM := '1';
    end if;
    if v_job = 'MANAGER' then
       :Px_PAGE_NUM := '10';
    end if;
    end;3. Create a "On Submit: After processing" branch. Specify the "Target Type" as "Page in the application" and "Page Number" as &Px_PAGE_NUM. (with the dot).
    I hope the above helps.
    BTW, the following thread in the forum related to OWA_UTIL.REDIRECT_URL might help:
    issue OWA_UTIL.REDIRECT_URL with APEX 4.1.1

  • How to write customer exit in my BI query to get (current fiscal quarter) and (current fiscal quarter - 1 ) without user input

    Hi all,
    I need your help how to write customer exit in my BI query to get (current fiscal quarter) and (current fiscal quarter - 1 ) without user input.
    in my query info object is 0CALQUARTER and variable is ZFIS_QTR.
    in 0CALQUARTER fiscal quarter stored in 201301,201302,201303,201304 and 201401 format, for current fiscal quarter 201401 and (current fiscal quarter - 1 ) would be 201304.
    please replay ASAP to deliver the report to client.
    thanks in advance.
    -- Rakesh Nagpure

    I am Getting the same error for both the codes that i have written...
    Do i Need to write sth else in the code...
    Code:
    WHEN 'ZVLIVELEASES'.
      IF I_STEP = 2.
            L_DATE = SY-DATUM.
            SELECT * FROM "DSO_ACTIVE_TABLE"
                INTO TABLE ITAB_LL where "EXPIRY_DATE" > L_DATE.
            LOOP AT ITAB_LL INTO WA_LL.
            CLEAR l_s_range.
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            l_s_range-low = WA_LL-"EXPIRY_DATE".
           APPEND L_S_RANGE TO E_T_RANGE.
            ENDLOOP.
       ENDIF.
    Error: Error for variable in customer enhancement ZLIVELEASES

  • Widget to get drop down values based on user input query string

    Hi,
    I have a requirement, where in user types in some text and clicks on a search button. On button click, a drop down or some box appears which has result based on the input string (from json ). User can select one of the values in the drop down or box. User should be able to select values from drop down or box only.
    How can I achieve this. Is there any custom widget in CQ for this, or I have to write my own widget.
    Can i use SuggestField widget for this? if yes, please give some example for this widget.
    I want something similar to "authselection" widget. In case of authselection widget user names come from CQ, in this case user name will come from some other system using a CQ custom json.
    If user types "gopa" and click on search , i should be able to call a json with query parameter "gopa" & the result from the query will be in the drop down.
    Regards,
    Gopal

    Hi Gopal,
              Out of the box there are many example. You can look for siteadmin has a reference.
    Thanks,
    Sham

  • Derive values based upon user input

    Hello,
    I recieved a request for a report.
    When a user runs the report they are to be prompted for a fiscal year/period.
    Based on the fiscal year/period that the user provides I have the following columns  (in bold below are 2 examples that may make the description more clear).
    1. Revenue for the Fiscal year Prior to the fiscal year of the user input value
    2. Revenue for the Fiscal year/Period prior to the input Fiscal year/period
    3. Revenue for the Year to date accumulation up to the prior fiscal year/period that the user input
    4. Revenue for the Year to date accumulation up to the prior fiscal year (fiscal year rolls back first) and prior period (for period 01, it then rolls back the fiscal year 1 more year) that the user input
    Example 1: If the user ran the query and they provided the value 05/2007, then the values that need to be obtained would be:
    1. Revenue for 2006
    2. Revenue for 04/2007
    3. Revenue for 01/2007 to 04/2007
    4. Revenue for 01/2006 to 04/2006
    Example 2: If the user ran the query and they provided the value 01/2008, then the values that need to be obtained would be:
    1. Revenue for 2007
    2. Revenue for 12/2007
    3. Revenue for 01/2007 to 12/2007
    4. Revenue for 01/2006 to 12/2006
    Please help me with determining how to obtain the user input value, and then how to derive the time periods for the columns based upon that value.
    Thanks,
    Nick
    (points available)
    Edited by: Nick Bertz on Mar 13, 2008 9:43 AM

    Hello,
    See my example.. I am reading the value from Keydate Variable
    WHEN ZVND01
            READ TABLE i_t_var_range INTO w_var_range WITH KEY vnam = 'Keydate'.
             IF SY-SUBRC = 0.
              CLEAR l_s_range.
              l_date = w_var_range-low.
              concatenate l_date(6) '01' into l_first_date.
              CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
              EXPORTING
                        day_in = l_date
              IMPORTING
                         last_day_of_month = l_last_date
              EXCEPTIONS
                        day_in_not_valid = 1
                        OTHERS = 2.
              IF sy-subrc EQ 0.
                l_s_range-low  = l_first_date.
                l_s_range-high = l_last_date.
                l_s_range-sign = k_sign_inclusive.
                l_s_range-opt  = k_option_between.
                APPEND l_s_range TO e_t_range.
              ENDIF.
    Hope this example helps..

  • Key figure value based on user input.

    Dear Friends,
    We are using BI7.00 and NW2004S. In one of our report to monitor the number of notification closed and the number of notification open upto the user selected month. For this i have created a Query which has selection screen value as month. I have created a condition which will fetch the difference in days (notification completion - notification creation date) based on user entered value.  For example if user enters 10 in the selection screen, report will fetch the notifications which have diffrence in days as 10.
    The condition is okay for the above. What user actually wants is the number of notifications completed and that pending based on the value he enters in the screen. For example he enters 10 in the screen, system should show the values as shown below
                    > 10 days    
    Completed                Pending
              3                           2 
    I tried various options but could not achieve this.
    Experts help expected. Kindly provide solution.
    Regards,
    M.M

    Hi,
    As per my understanding 1 firstly u have to find out
    the no of days (diff between dates notification completion, notification creation date .)
    then u have to create condition on no of days which u
    have find.there u have to create one user entry
    variable for the user can enter his own parametrs.
    Right?????
    If It is right..
    here are the steps..
    1st:in the query designer at key figure coloumn create
    one local formula.in that local formula create formula
    variable with replacement path.in that take reference character
    notification completion.in the next tab take replace ment
    as key.in the last tab select "date".
    2nd: do the same thing for the notification creation date.
    3 rd : create 3 rd local formula and do the substraction
    for the first 2 local formulas.
    4th:create codition on the difference which u have find with
    on that condition u can create one user entry varibale.
    5th:while u defining the query put these 2 dates,i,e
    notification completion, notification creation date in the character block.
    If not system will ignore the formula variable which u created in
    above steps.
    Hope this wil help u.
    regards....KP

  • Help with JTree data by user input

    I am trying to read data into a JTree without it being hardcoded.
    An example of the data is:
    String data[] = {"a","b","c",";","b","g","h",";","c","t",";","g","u"};
    The above data is taken from user input and stored in an array and checked for errors.
    I want to somehow read take the above array's data and put it into following format in some kind of loop but I am not sure how.
    Object[] hierarchy = {"a", new Object[]{"b",new Object[]{"g","u"},"h"},new Object[]{"c","t"}};
    This Object is then passed to a function that interpets it and prints out the appropriate JTREE structure. For the values above it would be:
    a
    ..b
    ....g
    ......l
    ......u
    ....h
    ..c
    ....t
    Tha problem is how to take the string array and put that data correctly into the Object array. I have been racking my feeble mind for quite sometime and if any one out there can see it or has a better idea of how to get my data into the JTree please let me know.
    Thanks

    //OutlookClient.java
    //uses also Console class from Bruce Eckel 
    //<applet code=OutlookClient width=500 height=300>
    //</applet>
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    import java.util.*;
    import javax.swing.UIManager;
    import javax.swing.SwingUtilities;
    import BruceEckel.*;
    import DynamicTree.*;
    import DynamicTreeNode.*;
    import java.lang.reflect.*;
    /* a class creating a dialog with the version, and other details about the program*/
    class AboutDialog extends JDialog {
         private JButton ok = null;
         private Container cp = null;
         private JTextField tname = null;
            public AboutDialog() {
                   //System.out.println("constructor");
                   ok = new JButton("OK");
                   cp = getContentPane();
                   cp.setLayout(new FlowLayout());
                   JLabel tlab = new JLabel("Outlook - client side");
                   cp.add(tlab);
                   //tname.setMinimumSize(new Dimension(50,10));
                   //tname.setSize(new Dimension(70,10));
                   tlab = new JLabel("Author: Jiri Machotka");
                   cp.add(tlab);
                   tlab = new JLabel("version 1.0 (September 2001)");
                   cp.add(tlab);
                   tlab = new JLabel("----------------------------------------------");
                   cp.add(tlab);
                   ok.addActionListener( new ActionListener() {
                      public void actionPerformed(ActionEvent e) {
                        dispose();
                      }//actionPerformed
                   });//addActionListener
                   cp.add(ok);
                   setSize(200,150);
                   setTitle("About the program");  
                   setModal(true);
         }//constructor
      *      <P>This class more-or-less contains a graphic design object used for interaction with a user.</P>
      *     Apart from all ScrollPanes, Buttons, and MenuItems, it contains also 3 interesting members:
      *     <ol>
      *     <li> <I>protected final DefaultMutableTreeNode topNode</I>, which is initialized with
      * a potent, non-removable object of the class <I>Node</I>
      *     <li> <I>protected final DefaultTreeModel treeModel</I>, which is initialized with the <I>topNode</I>
      *     <li> and finally <I>protected final DynamicTree dyn_tree</I>, which uses the 2 objects above
      *     </ol>
      *     <P> The <I>OutlookClient</I> is an applet, but it can be also processed as an application (thanks to
      *     a library by BruceEckel).</P>
    public class OutlookClient extends JApplet {
    //------------- properties -----------------------------------------
       private Action
            newMail = new AbstractAction ("New Mail", new ImageIcon("images/NewMailIcon.gif")){
              public void actionPerformed(ActionEvent e) {
                         txt.setText("NewMail");
         reply     = new AbstractAction ("Reply", new ImageIcon("images/ReplyIcon.gif")){
              public void actionPerformed(ActionEvent e) {
                         txt.setText("Reply");
       private JButton
         /*b1 = new JButton("Add a Node"),
         b2 = new JButton("Remove the current Node"),*/ //not used now
         tb1 = new JButton (newMail),
         tb2 = new JButton (reply);
       private JTextField
         txt = new JTextField(10);
       private Container
         leftArea = new Container(),
         rightArea = new Container();
       private JScrollPane
            left = new JScrollPane (leftArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS),
            right = new JScrollPane (rightArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
       private JSplitPane
            sp = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT, left, right);
       private JToolBar
         toolBar = new JToolBar();
       private JMenuBar
         menuBar = new JMenuBar();
       /*ActionListener al = new ActionListener() {
         public void actionPerformed(ActionEvent e) {
            String name = ( (JButton)e.getSource()).getText();
            txt.setText(name);
       };*/     //not used now - used as an action listener for buttons b1, b2
       private JMenu
         mainOutlookMenu = new JMenu ("Outlook activities"),
         othersMenu      = new JMenu ("Others"),
         mailMenu     = new JMenu ("Mails"),
         chatMenu     = new JMenu ("Chat"),
         look_and_feelMenu = new JMenu ("Look&Feel");
       private JMenuItem
         closeAppItem     = new JMenuItem ("Exit",KeyEvent.VK_F3),
         newMailItem     = new JMenuItem (newMail),
         replyItem     = new JMenuItem (reply);
       private JRadioButtonMenuItem
         windowsLookAndFeelItem;
       protected final DefaultMutableTreeNode topNode = new DefaultMutableTreeNode(new Node ("Outlook", false, true));
       protected final DefaultTreeModel treeModel = new DefaultTreeModel(topNode);
       protected final DynamicTree dyn_tree = new DynamicTree(topNode, treeModel);
    //-------------inner classes----------------------------------------
    /** <P>The class <I>MyRenderer</I> sets the renderer of the tree - by doing that icons can be assigned to
       * the tree's nodes. </P>
       * <P> It sould be probably a standard member of a class <I>DynamicTreeWithIcons</I>.</P>
       * <P> However, it uses the knowledge that the class <B>Node</B>, which is the only object that can be
       * found in the dynamic tree in this application, has a method <I>getIcon()</I>, which returns a
       * reference to the icon object assigned to the node.</P>
       * <P><B>This is the only place, where the class Node, or its methods are called explicitely.</B></P>
       protected class MyRenderer extends DefaultTreeCellRenderer {
         /** The constructor of the class.
           * - sets folders icons (opened, closed folder)
         public MyRenderer() {
                 //setLeafIcon(new ImageIcon("images/middle.gif")); //for leaves' icon, all at once!
              setOpenIcon(new ImageIcon("images/folder_open.gif"));
              setClosedIcon(new ImageIcon("images/folder_close.gif"));
         /** This overridden method gets the user-specified icon for leaf nodes. */
         public Component getTreeCellRendererComponent(
                   JTree tree,
                   Object value,
                   boolean sel,
                   boolean expanded,
                   boolean leaf,
                   int row,
                   boolean hasFocus) {
              super.getTreeCellRendererComponent(tree,value,sel,expanded,leaf,row,hasFocus);
              if (leaf) 
              //workaround: test if icon not eq. null
                     ImageIcon ic = getRightIcon(value);
                     if (ic == null) return this;
                     else
                          setIcon(ic);
              return this;
         }//overridden: getTreeCellRendererComponent
         private ImageIcon getRightIcon(Object value) {
           DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
              try{
              Node node_object = (Node)(node.getUserObject());   
                 return (node_object.getIcon());
           catch (Exception e) { return null; }
         }// ImageIcon getRightIcon(Object value)
      }//class MyRenderer
    //-------------OutlookClient methods-----------------------------------------
       private void assignListeners(){
         dyn_tree.addTreeSelectionListener(new TreeSelectionListener() {
             public void valueChanged(TreeSelectionEvent e) {
              DefaultMutableTreeNode node = (DefaultMutableTreeNode)dyn_tree.getLastSelectedPathComponent();
              if (node == null) return;
              if (node.isLeaf()) { txt.setText(node.toString()); }
       }//assignListeners()
       private void createLayout(){
         leftArea.setLayout(new BoxLayout(leftArea,BoxLayout.Y_AXIS));
         rightArea.setLayout(new BoxLayout(rightArea,BoxLayout.Y_AXIS));
         //left.setMinimumSize(new Dimension(120,200));
         right.setMinimumSize(new Dimension(50,50));
         //rightArea.add(b1);
         //rightArea.add(b2);
         rightArea.add(txt);
         //leftArea.add(tree);  ... not nice (why?)
           left = new JScrollPane (dyn_tree, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);       
         left.setMinimumSize(new Dimension(180,200));
         sp.setLeftComponent(left);
       }//createLayout()
       private void createMenu(){
         ButtonGroup group = new ButtonGroup();
            JRadioButtonMenuItem rbMenuItem;
         closeAppItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F3, ActionEvent.ALT_MASK));
         closeAppItem.getAccessibleContext().setAccessibleDescription("Closes application");
         closeAppItem.addActionListener( new ActionListener() {
              public void actionPerformed(ActionEvent e) {System.exit(0);}
         othersMenu.setMnemonic(KeyEvent.VK_O);
         othersMenu.getAccessibleContext().setAccessibleDescription("System settings&Others");
            rbMenuItem = new JRadioButtonMenuItem("Java");
            rbMenuItem.setSelected(true);
            rbMenuItem.setMnemonic(KeyEvent.VK_J);
            group.add(rbMenuItem);
            rbMenuItem.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {setPLAF(UIManager.getCrossPlatformLookAndFeelClassName( ) );}
            look_and_feelMenu.add(rbMenuItem);
            rbMenuItem = new JRadioButtonMenuItem("Windows");
            rbMenuItem.setMnemonic(KeyEvent.VK_W);
            group.add(rbMenuItem);
            rbMenuItem.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {setPLAF("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");}
            look_and_feelMenu.add(rbMenuItem);
         windowsLookAndFeelItem = rbMenuItem;
         look_and_feelMenu.setMnemonic(KeyEvent.VK_L);
         look_and_feelMenu.getAccessibleContext().setAccessibleDescription("Look&Feel");
         JMenuItem aboutItem = new JMenuItem ("About");
         aboutItem.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   AboutDialog ad = new AboutDialog();
                   ad.show();
         othersMenu.add(look_and_feelMenu);
         othersMenu.addSeparator();
         othersMenu.add(aboutItem);
         othersMenu.addSeparator();
         othersMenu.add(closeAppItem);
         mainOutlookMenu.setMnemonic(KeyEvent.VK_A);
         mainOutlookMenu.getAccessibleContext().setAccessibleDescription("Outlook activities");
         menuBar.add(mainOutlookMenu);
         menuBar.add(othersMenu);
         mailMenu.setMnemonic(KeyEvent.VK_M);
         mailMenu.getAccessibleContext().setAccessibleDescription("Mail activities");
         chatMenu.setMnemonic(KeyEvent.VK_C);
         chatMenu.getAccessibleContext().setAccessibleDescription("Chat");
         chatMenu.setEnabled(false);
         mainOutlookMenu.add(mailMenu);
         mainOutlookMenu.addSeparator();
         mainOutlookMenu.add(chatMenu);
         //mailMenu.add(newMail);
         //mailMenu.add(reply);     //class Action has problems to catch the accelerator keys
         newMailItem.setMnemonic(KeyEvent.VK_N);
         replyItem.setMnemonic(KeyEvent.VK_R);
         mailMenu.add(newMailItem);
         mailMenu.add(replyItem);
         newMailItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
         replyItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.ALT_MASK));
         //newMail.putValue(Action.NAME, "New mail");
         //newMail.putValue(Action.SHORT_DESCRIPTION, "New mail");
         //newMail.putValue(Action.LONG_DESCRIPTION, "New mail");
         //newMail.putValue(Action.MNEMONIC_KEY, "N");  //cast an exception. why?
         //newMail.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));     
         setJMenuBar(menuBar);
       }//createMenu()
       private void createToolBar(){
         //toolBar.add(newMail);
         //toolBar.add(reply);    //does not provide texts and mnemonics
         tb1.setMnemonic(KeyEvent.VK_N);
         tb2.setMnemonic(KeyEvent.VK_R);
         toolBar.add(tb1);
         toolBar.add(tb2);
       }//createToolBar()
       private void createNodes(DefaultMutableTreeNode topNode){
         //new for dynamic processing
         DefaultMutableTreeNode
              parentNode = null,
              leaveNode  = null;
         parentNode = dyn_tree.addObject(null,new Node ("MailFolders", false, true));
         dyn_tree.addObject(parentNode,new Node ("Inbox","images/InboxIcon.gif", false, false));
         dyn_tree.addObject(parentNode,new Node ("Outbox","images/OutboxIcon.gif", false, false));
         dyn_tree.addObject(parentNode,new Node ("Sent","images/SentIcon.gif", false, false));
         dyn_tree.addObject(parentNode,new Node ("Deleted","images/DeletedIcon.gif", false, false));
         //leaveNode.setEnabled(false);  //TODO: disable "Chat"node
         dyn_tree.addObject(null,new Node ("Chat", false, false));
       }//createcreateNodes(DefaultMutableTreeNode)
       private void setTreeSettings(){
         //one selection at one time
         dyn_tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
         //connect nodes with a thin line - Java style only
         dyn_tree.putClientProperty("JTree.lineStyle","Angled");
         //collapse the root's children first
         //tree.setShowsRootHandles(false);
         //icon adjustment
         MyRenderer MyRen = new MyRenderer();
         dyn_tree.setCellRenderer(MyRen);
         //modifiable tree - by double click - allows modifying of nodes' names
         // but unfortunately also restores original icons
         //tree.setEditable(true);
       }//setTreeSettings()
       private boolean setPLAF(String LookAndFeelName){
          try{
         UIManager.setLookAndFeel(LookAndFeelName);
         SwingUtilities.updateComponentTreeUI(this);
         return true;
          } catch (Exception e) {
         //e.printStackTrace(System.err);
         return false;
       }//setPLAF(String LookAndFeelName)
       private void trytosetLookAndFeel(){
          if (setPLAF("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"))
              windowsLookAndFeelItem.setSelected(true);
       }//trytosetLookAndFeel()
       /** The applet's <I>init()</I>.
         * Calls methods to construct all visible objects.
         * Apart from that it also assigns the renderer to the tree.
       public void init(){
         sp.setOneTouchExpandable(true);
            //sp.setDividerLocation(150); - system puts the value to optimize the left part
         sp.setPreferredSize(new Dimension(450,200));
         Container cp = getContentPane();
         cp.setLayout(new FlowLayout());
            createLayout();     
         createMenu();
         createToolBar();
         createNodes(topNode);
         setTreeSettings();
         //createPopupMenu();
         assignListeners();
         cp.add(toolBar);
         cp.add(sp);
         trytosetLookAndFeel();
       }//init()
       /** If called as an application.
         * The desired Windows Look&Feel is re-set again, when the applet is running. Otherwise, it in an application
         * it tends not to work correctly.
       public static void main(String[] args) {
         OutlookClient theApplet;
         BruceEckel.Console.run(theApplet=new OutlookClient(), 500, 300);
         theApplet.trytosetLookAndFeel();
       }//main(String[])
    }///:~Take a look namely at createNodes
    Hope it helps.

  • Need HELP with JTree created by user input

    I have been trying to create code that takes a user input string
    ex: a:b,c;b:g,h,j;g:k,m;b:u
    note: (the above string is then stored into a string array such in the format a:bc;b:ghj;g:km;b:u after it is verified that the hierarchy order is correct)
    The string is read in such that the any value before the : is a parent and its childern continue until a ; is found. Anyway verifying the sting I have accomplished and I have been able to input the string into a modified binary tree as long as there are only 2 childern per parent and graphically represents its structure of hierarchy. The problem is that each parent can have more the two childern.
    I have been working with the BTree class and find its output similar to what I am wanting which would represent a hierarchy of objects (files, employees, etc...) anyway I have been stumped as to how to get the above string into a format that can then create the correct JTree output without hard code.
    If any one has any suggestions on how to turn the data, in the string array into a usable format to create the correct JTree output, I would greatly appreciate it.
    In the above example the string array, a:bc;b:ghj;g:km;b:u would have a desired ouput of
    a
    ..b
    ....g
    ......k
    ......m
    ....h
    ....j
    ....u
    ..c
    Thanks
    Shane

    I have been trying to create code that takes a user input string
    ex: a:b,c;b:g,h,j;g:k,m;b:u
    note: (the above string is then stored into a string array such in the format a:bc;b:ghj;g:km;b:u after it is verified that the hierarchy order is correct)
    The string is read in such that the any value before the : is a parent and its childern continue until a ; is found. Anyway verifying the sting I have accomplished and I have been able to input the string into a modified binary tree as long as there are only 2 childern per parent and graphically represents its structure of hierarchy. The problem is that each parent can have more the two childern.
    I have been working with the BTree class and find its output similar to what I am wanting which would represent a hierarchy of objects (files, employees, etc...) anyway I have been stumped as to how to get the above string into a format that can then create the correct JTree output without hard code.
    If any one has any suggestions on how to turn the data, in the string array into a usable format to create the correct JTree output, I would greatly appreciate it.
    In the above example the string array, a:bc;b:ghj;g:km;b:u would have a desired ouput of
    a
    ..b
    ....g
    ......k
    ......m
    ....h
    ....j
    ....u
    ..c
    Thanks
    Shane

  • MVC 5 Database Help (calculations and input based on user input)

    Hello all! I am learning MVC 5 database interactions. I would like to fill in certain database columns based on a calculation done on columns the user inputs. I am not having trouble getting user inputs into the database. I am wondering
    about how to take 2 user input database values, make a calculation using them, and put the resulting number in its own column in the database.
    So: after the user inputs price and lot price, I want the application to figure out the margin (price / lot price) and then input margin into the database. Here is what I have, but the calculation doesn't seem to input the result into my database.
    Where am I going wrong? (margin is already a column in the database)
    Thanks in advance!
    publicActionResultCreate([Bind(Include
    = "ID,Name,Price,Location,Color,LotPrice")]
    Automobile automobile)
    if(ModelState.IsValid)
                    db.Automobile.Add(automobile);          
    automobile.Margin = automobile.Price / automobile.LotPrice;
                    db.SaveChanges();        
    returnRedirectToAction("Index");
    returnView(automobile);

    Hi Ruben,
    Please post your question to the MVC forum below for a better assistance on your issue:
    http://forums.asp.net/1146.aspx
    Regards,
    Fouad Roumieh

  • Help with JAVA StringObject - & assign user input; StringMethod

    Hi Everyone! I need help with this Java Program, I need to write a program, single class, & file. That will prompt the user to enter a word. The output will be separted by hypens and do this until the user enters exit. I think this is done by using a string variable. Then use the length of the word to setup a loop to print each letter out with hypens. (example c-a-t)
    1. I think I should store the word like this: Word.Method(). Not sure of this the API was confusing for me because I wasn't sure of what to do.
    2. A string method to find out how many letters are in the user's word in order to setup a loop to print each letter out. I think I can use a While loop to accomplish this?
    3. A string method to access each letter in a string object individually in order to print individual letters to the screen with those hypens. This is really confusing for me? Can this be accomplished in the While loop? or do I declare variables in the main method.
    Any examples you can refer me to would be greatly appreciated. Thanks

    Getting user input:
    This may look strange to a newbie but there's nothing much you can do since you wanted a single class file:import java.io.*
    public class InputTest {
       public static void main(String[] args) {
          BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
          System.out.println("Hi! Please type a word and press enter.");
          String lineReadFromUser = in.readLine();
          System.out.println("You typed " + lineReadFromUser);
    }You can get the lenght of a String using the length() method. Example: int len = "Foobar".length();
    You can get the individual characters of a String with the charAt() method. Example: char firstCharOfString = string.charAt(0);
    (remember that the argument must be from 0 to length-1)
    You can access the documentation of all classes, including java.lang.String, at http://java.sun.com/j2se/1.3/docs/api/index.html You can also download the docs.

  • Need help with Java app for user input 5 numbers, remove dups, etc.

    I'm new to Java (only a few weeks under my belt) and struggling with an application. The project is to write an app that inputs 5 numbers between 10 and 100, not allowing duplicates, and displaying each correct number entered, using the smallest possible array to solve the problem. Output example:
    Please enter a number: 45
    Number stored.
    45
    Please enter a number: 54
    Number stored.
    45 54
    Please enter a number: 33
    Number stored.
    45 54 33
    etc.
    I've been working on this project for days, re-read the book chapter multiple times (unfortunately, the book doesn't have this type of problem as an example to steer you in the relatively general direction) and am proud that I've gotten this far. My problems are 1) I can only get one item number to input rather than a running list of the 5 values, 2) I can't figure out how to check for duplicate numbers. Any help is appreciated.
    My code is as follows:
    import java.util.Scanner; // program uses class Scanner
    public class Array
         public static void main( String args[] )
          // create Scanner to obtain input from command window
              Scanner input = new Scanner( System.in);
          // declare variables
             int array[] = new int[ 5 ]; // declare array named array
             int inputNumbers = 0; // numbers entered
          while( inputNumbers < array.length )
              // prompt for user to input a number
                System.out.print( "Please enter a number: " );
                      int numberInput = input.nextInt();
              // validate the input
                 if (numberInput >=10 && numberInput <=100)
                       System.out.println("Number stored.");
                     else
                       System.out.println("Invalid number.  Please enter a number within range.");
              // checks to see if this number already exists
                    boolean number = false;
              // display array values
              for ( int counter = 0; counter < array.length; counter++ )
                 array[ counter ] = numberInput;
              // display array values
                 System.out.printf( "%d\n", array[ inputNumbers ] );
                   // increment number of entered numbers
                inputNumbers++;
    } // end close Array

    Yikes, there is a much better way to go about this that is probably within what you have already learned, but since you are a student and this is how you started, let's just concentrate on fixing what you got.
    First, as already noted by another poster, your formatting is really bad. Formatting is really important because it makes the code much more readable for you and anyone who comes along to help you or use your code. And I second that posters comment that brackets should always be used, especially for beginner programmers. Unfortunately beginner programmers often get stuck thinking that less lines of code equals better program, this is not true; even though better programmers often use far less lines of code.
                             // validate the input
       if (numberInput >=10 && numberInput <=100)
              System.out.println("Number stored.");
      else
                   System.out.println("Invalid number.  Please enter a number within range."); Note the above as you have it.
                         // validate the input
                         if (numberInput >=10 && numberInput <=100)
                              System.out.println("Number stored.");
                         else
                              System.out.println("Invalid number.  Please enter a number within range."); Note how much more readable just correct indentation makes.
                         // validate the input
                         if (numberInput >=10 && numberInput <=100) {
                              System.out.println("Number stored.");
                         else {
                              System.out.println("Invalid number.  Please enter a number within range.");
                         } Note how it should be coded for a beginner coder.
    Now that it is readable, exam your code and think about what you are doing here. Do you really want to print "Number Stored" before you checked to ensure it is not a dupe? That could lead to some really confused and frustrated users, and since the main user of your program will be your teacher, that could be unhealthy for your GPA.
    Since I am not here to do your homework for you, I will just give you some advice, you only need one if statement to do this correctly, you must drop the else and fix the if. I tell you this, because as a former educator i know the first thing running through beginners minds in this situation is to just make the if statement empty, but this is a big no no and even if you do trick it into working your teacher will not be fooled nor impressed and again your GPA will suffer.
    As for the rest, you do need a for loop inside your while loop, but not where or how you have it. Inside the while loop the for loop should be used for checking for dupes, not for overwriting every entry in the array as you currently have it set up to do. And certainly not for printing every element of the array each time a new element is added as your comments lead me to suspect you were trying to do, that would get real annoying really fast again resulting in abuse of your GPA. Printing the array should be in its own for loop after the while loop, or even better in its own method.
    As for how to check for dupes, well, you obviously at least somewhat understand loops and if statements, thus you have all the tools needed, so where is the problem?
    JSG

  • I am trying to make a form on a muse page by inserting HTML code.  the field gets entered, but there is no box drawn around the user input area.

    Here is a small sample of the code , the <fieldset> does not draw a box around the selected group either.
      <form method="post" action="report.php">
        <fieldset>                                                                                    <!-- draws a box around a group -->
          <legend>
            <b>Tell us a little about yourself</b>
          </legend>
            <br />
            <label for="firstname">First name:</label>
            <input type="text" id="firstname" name="firstname" required="required" /><br />          <!-- field is required -->
            <br />
            <label for="lastname">Last name:</label>
            <input type="text" id="lastname" name="lastname" required="required" /><br />
            <br />
            <label for="email">What is your email address?</label>
            <input type="email" id="email" name="email" required="required" /><br />
            <br />
        </fieldset>

    Hi Peter,
    In the latest release of Muse the option of recaptcha was added to both Bc and non Bc hosted site. Please check the link below to know more on this.
    http://helpx.adobe.com/muse/using/form-widgets.html#Preventing spam using Google reCAPTCHA
    I am afraid that this is not possible in Muse, to generate captcha for a site that is not hosted via Bc, at this stage, I will recommend that you post this on our ideas section over here, https://forums.adobe.com/community/muse/ideas, and let our devs team know of this requirement.
    In the meantime, you will need to insert the captcha code manually on the Muse form once after you have exported the html of the site and this is something that you will need to every time the code is generated because Muse will overwrite the changes that you have made.
    - Abhishek Maurya

  • Switch Search Help during runtime

    Hi,
    Can we assign search help at runtime depending on user input? I have s drop-down box, depending on user's choice, i need to siplay different values in the search help. Can I assign search help to the screen element during runtime???
    Please help.
    Thanks,
    Sheel

    No, but you can build F4 help on the fly at runtime based off another field.
    For example, in this program, the user enters the sales order number, and then when they do F4 on the line item, they can only choose from valid line item numbers.
    report zrich_0002 .
    parameters: p_vbeln type vbak-vbeln,
                p_posnr type vbap-posnr.
    at selection-screen on value-request for p_posnr.
      data: begin of help_item occurs 0,
              posnr type vbap-posnr,
              matnr type vbap-matnr,
              arktx type vbap-arktx,
            end of help_item.
      data: dynfields type table of dynpread with header line.
      dynfields-fieldname = 'P_VBELN'.
      append dynfields.
      call function 'DYNP_VALUES_READ'
           exporting
                dyname               = sy-cprog
                dynumb               = sy-dynnr
                translate_to_upper   = 'X'
           tables
                dynpfields           = dynfields
           exceptions
                invalid_abapworkarea = 1
                invalid_dynprofield  = 2
                invalid_dynproname   = 3
                invalid_dynpronummer = 4
                invalid_request      = 5
                no_fielddescription  = 6
                invalid_parameter    = 7
                undefind_error       = 8
                double_conversion    = 9
                stepl_not_found      = 10
                others               = 11.
      read table dynfields with key fieldname = 'P_VBELN'.
      p_vbeln = dynfields-fieldvalue.
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
           exporting
                input  = p_vbeln
           importing
                output = p_vbeln.
      select posnr matnr arktx into table help_item
                     from vbap
                          where vbeln = p_vbeln.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
           exporting
                retfield    = 'POSNR'
                dynprofield = 'P_POSNR'
                dynpprog    = sy-cprog
                dynpnr      = sy-dynnr
                value_org   = 'S'
           tables
                value_tab   = help_item.
    Regards,
    Rich Heilman

  • Custom Exit - Get System Date with user input

    I am using a BW query to connect to a BOBJ universe.  Some reports from the universe must be scheduled to run for today's date and emailed to a user.  Unfortunately, we cannot determine "today" dynamically when scheduling in BOBJ.  There will be other reports filtered with a range.
    I want to create a BW custom exit variable to allow user input.  My idea is to take the user input, like "01/01/1904", and replace the value with today's date.
    Is this possible?
    Here's example code for what I am trying to achieve.
    IF user input = "01/01/1904" then get today's date.
    else use the values from the user input.
    Scenario 1: user inputs 08/01/2010 - 08/31/2010 the custom exit returns values 08/01/2010 - 08/31/2010
    Scenario 2: user inputs 01/01/1904 the custom exit returns 09/03/2010 (today)

    Hi,
    In your case, i_vnam variable and processing variable for below statement would be same.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'variable name'.
    Please see the below article for reference.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f119d9-922d-2c10-88af-8c016638bd90?quicklink=index&overridelayout=true

  • How do I get my XML numeric values to show up when loaded into flash?

    Hi there,
    I've created an AS2 3D carousel  It loads text values in the "content" section of the code below -  including numbers and special characters into the .swf but...
    What I can't figure out, is how to get it so that the "Tooltip" loads the text into the movieclip, but can also have numeric and special characters in it.
    For example, I need the title of one of the icons on this carousel to be "3D Images," but only the "D Images" shows up from the XML text for the tooltip.  The content when a user clicks on the icon can include numbers, just not the titles for some reason.
    http://iongeo.com/collaboration_test_dev/video_arctic_imaging.html
    I think it has something to do with the way that my text is loaded from the xml document specifically for the tooltip and tipText for the movie clip.  Can numeric values be loaded into a movie clip in AS2?  PLEASE HELP!
    import mx.utils.Delegate;
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var numOfItems:Number;
    var radiusX:Number = 300;
    var radiusY:Number = 75;
    var centerX:Number = Stage.width / 2;
    var centerY:Number = Stage.height / 2;
    var speed:Number = 0.05;
    var perspective:Number = 130;
    var home:MovieClip = this;
    theText._alpha = 0;
    theHeader._alpha = 0;
    var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
    tooltip._alpha = 0;
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = function()
        var nodes = this.firstChild.childNodes;
        numOfItems = nodes.length;
        for(var i=0;i<numOfItems;i++)
            var t = home.attachMovie("item","item"+i,i+1);
            t.angle = i * ((Math.PI*2)/numOfItems);
            t.onEnterFrame = mover;
            t.toolText = nodes[i].attributes.tooltip;
            t.content = nodes[i].attributes.content;
            t.header = nodes[i].attributes.header;
            t.icon.inner.loadMovie(nodes[i].attributes.image);
            t.r.inner.loadMovie(nodes[i].attributes.image);
            t.icon.onRollOver = over;
            t.icon.onRollOut = out;
            t.icon.onRelease = released;
    function over()
        //BONUS Section
        home.tooltip.tipText.text = this._parent.toolText;
        home.tooltip._x = this._parent._x;
        home.tooltip._y = this._parent._y - this._parent._height/2;
        home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
        home.tooltip._alpha = 100;
    function out()
        delete home.tooltip.onEnterFrame;
        home.tooltip._alpha = 0;
    function released()
        //BONUS Section
        home.tooltip._alpha = 100;
        for(var i=0;i<numOfItems;i++)
            var t:MovieClip = home["item"+i];
            t.xPos = t._x;
            t.yPos = t._y;
            t.theScale = t._xscale;
            delete t.icon.onRollOver;
            delete t.icon.onRollOut;
            delete t.icon.onRelease;
            delete t.onEnterFrame;
            if(t != this._parent)
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
                var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
            else
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
                var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,150,1,true);
                var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,250,1,true);
                var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
                var tw5:Tween = new Tween(theHeader,"_alpha",Strong.easeOut,0,100,1,true);
                theText.text = t.content;
                theHeader.header = t.header;
                var s:Object = this;
                tw.onMotionStopped = function()
                    s.onRelease = unReleased;
    function unReleased()
        //BONUS Section
        var sou:Sound = new Sound();
        sou.attachSound("sdown");
        sou.start();
        delete this.onRelease;
        var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
        var tw:Tween = new Tween(theHeader,"_alpha",Strong.easeOut,100,0,0.5,true);
        for(var i=0;i<numOfItems;i++)
            var t:MovieClip = home["item"+i];
            if(t != this._parent)
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
                var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
            else
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
                var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
                var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
                tw.onMotionStopped = function()
                    for(var i=0;i<numOfItems;i++)
                        var t:MovieClip = home["item"+i];
                        t.icon.onRollOver = Delegate.create(t.icon,over);
                        t.icon.onRollOut = Delegate.create(t.icon,out);
                        t.icon.onRelease = Delegate.create(t.icon,released);
                        t.onEnterFrame = mover;
    function moveTip()
        home.tooltip._x = this._parent._x;
        home.tooltip._y = this._parent._y - this._parent._height/2;
    xml.load("icons.xml");
    function mover()
        this._x = Math.cos(this.angle) * radiusX + centerX;
        this._y = Math.sin(this.angle) * radiusY + centerY;
        var s = (this._y - perspective) /(centerY+radiusY-perspective);
        this._xscale = this._yscale = s*100;
        this.angle += this._parent.speed;
        this.swapDepths(Math.round(this._xscale) + 100);
    this.onMouseMove = function()
        speed = (this._xmouse-centerX)/8000;

    Kglad, you are my HERO!
    Thanks so much for your reply, I did not know about the embed options within flash...
    Mike

Maybe you are looking for