Getting User Selection of 3D-Object

Is there any possibility to get a reference to the Object(s) or Mesh(es) a user has selected in the 3D-scene?
I don't want wo work with the MouseHit-Function, since there is this much more sophisticated selection already implemented. I just can't get to finding its reference...?
Thx

I'm not sure I understand your question as I am rather green to 3D, but I'll take a shot... Have you tried using the Model Tree to do your part selection. In the 3D annotation's toolbar, click on the "Toggle Model Tree" button. You'll see a window open on the left side of the viewer. If you go into the top pane, the Structure pane, you can select individual parts. You can then look at the bottom pane, the Data pane, and read the number of Faces and Vertices. I hope this helps and that I'm not way off the mark where your question is concerned.

Similar Messages

  • Concurrent user selecting on same object

    Hi, the issue are like this, there is few patient in table. Nurse as user will select the patient and serve them, the question is, IF the 1st user select on patient A, 2nd user must be prompt that 1st user are selecting the patient A
    What im did is declare 1 vector, storing on the ID and user IPaddress (request.getRemoteAddr()), mean that when 1st user select on patient A, vector will store on (patientA ID and 1st user IP), so when 2nd user click on patient A, system will do checking base on the vector. If 1st user click on patient B, vector that storing (patientA ID and 1st user IP) will be release.
    Things run fine for the first few testing, BUT, if the user have close the application or click on another page, the patient A will forever save in the vector. And others ppl will not selecting on it anymore
    How should i solve it?
    1) anyone can let me know is there any command to check user IP address are connecting to system?
    2) is there any command can overtake my issue?
    Thanks for those who give suggestion.

    Yeah, everyone login have its own unique ID, but the problem is when userA select patientA, it will save in a vector ID + patientA
    How if the userA close the browser or go to another page, PatientA will forever stack with userA. Because patientA onli will be release when userA select on the others patient

  • How do I get a  value of a  cell when user selects in a JTable?

    Hi everybody,
    I need some help in order to complete my task. I 've a JTable. When user selects any particular column . I should able to get user selected value. I added a MouseListener to the table. And I 've written the following code - in mousePressed()
    JTable table = (JTable) e.getSource();
    iint col =JTablePartNumbers.getInstance().getSelectedColumn();
    int row = JTablePartNumbers.getInstance().getSelectedRow();
    System.out.println("row col value" +JTableModelPartNumbers.getInstance().getValueAt(row,col));
    I'm getting col and row value but when I'm using TableModel.getValue(row,col) - it is giving me null value.
    And my getValueAt() method is defined as
    public Object getValueAt( int nRow, int nCol )
         System.out.println("the nRow" nRow "And nCol " nCol "And row count" + getRowCount());
         int rowCount = getRowCount();
         System.out.println("the row count" +rowCount);
    if ( ( nRow < 0 ) || ( nRow >= getRowCount() ))
         return null;
              // Taking
              StartNewRevisedGenericSGMLFragmentsModel row = (StartNewRevisedGenericSGMLFragmentsModel) partNumberDetails.elementAt( nRow );
         //     System.out.println("row value" nRow "Col value" +nCol);
              switch ( nCol )
                   case 0:
                   return row.getParNo();                               case 1:
                        return row.getRev(); // gets model data
                   case 2:
                        return row.getDoneDate( );// gets revision data
              Vector rowVec = (Vector) partNumberDetails.get(nRow);
         return (String) rowVec.get(nCol);
    so please help me out resolving this problem.
    Thanks in advance
    purnima

    try calling jtable.getSelectionModel().addListSelectionListener(...)
    by the way, any good design of a generic UI Table must have a feature to do what you're talking about in an easy way. If it didn't, why would anyone use it?

  • How to get Date Format from Local Object.

    Hi All,
    I am new to Web Channel.
    I need to know Date format From date of locale.
    suppose there is a date "01/25/2010" date in date field I want to get string "mm/dd/yyyy". Actually I have to pass date format to backend when I call RFC. 
    Is there any way to get Date format from "Locale" object. I should get date format for local object
    I get local object from "UserSessionData" object but how to get Date format from it.
    I am not looking for Date value. I am looking for current local date format ("mm/dd/yyyy or dd/mm/yyyy or mon/dd/yyyy) whatever local date format.  I could not find example which show how to get date format from "Locale" object.
    Any help will be appreciated with rewards.
    Regards.
    Web Channel

    Hi,
    You can get it from "User" or "Shop" business object.
    Try to get User or Shop Business Object as shown below.
    BusinessObjectManager bom = (BusinessObjectManager) userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);
    User user = bom.getUser();
    char decimalNotation = user.getDecimalPointFormat().getGroupingSeparator();
    If you are seeing "1,234.00" then above code will return "."
    I hope this information help you to resolve your issue.
    eCommerce Developer.

  • JS-Referring to user selected objects

    I am trying to create a script for CS4 where I can manually select some, not all, images and have the script move them to a layer and/or apply a preset ID shadow. My question is. . . How do I write script to refer to the objects I have manually selected in my ID document? I'm new to scripting and just starting to get the hang of it. Any help would be greatly appreciated.

    Here's a class for InDesign JS that encapsulates the user selection and allows many manipulations:
    The “TSelection” class : http://marcautret.free.fr/geek/indd/selection/TSelection.zip
    Documentation (in French, sorry!) : http://marcautret.free.fr/geek/indd/selection/
    Class diagram : http://marcautret.free.fr/geek/indd/selection/TSelection-Interface.pdf
    @+
    Marc

  • How to get the Multiplied value between measure and a dimension base on user selection using dynamically

    Hi Experts,
    We had developed a cube with the Measures and Dimensions.
    I had a requirment as the measures should be muliplied by the currency value of different countries and get me the results.
    For Example.
    In SSRS report, the user will select "EUR" then the measures should multiply with the EUR based value for the particular month and get the result in the SSRS report. If the user select any other currency value, that should multiply with the measure
    value and get the result in SSRS report.
    How to do that in SSAS Cube.
    Thanks
    Shashi

    Hi ,
    If I understand your requirement  correctly , then you need currency Conversion.
    you can refer this links.
    http://consultingblogs.emc.com/christianwade/archive/2006/08/24/Currency-Conversion-in-Analysis-Services-2005.aspx
    http://www.ssas-info.com/analysis-services-faq/27-mdx/244-how-change-currency-symbol-based-on-selected-currency-dimension-member
    http://social.technet.microsoft.com/wiki/contents/articles/18672.currency-conversion-in-ssas-2012-multidimensional-tabular.aspx
    May I know , You Require all this using MDX and SSRS Parameter ?
    Thanks

  • Cant get com.apple.security.files.user-selected.read-only entitlement to work

    Hey I am curious how can I get the .ipa compiled file for iOS to be able to read all the directories on the iPhone?
    I made a file browser but I cant get to the pictures
    I tried adding the entitlements in Flash Builder 4.6 in the descriptor file like this:
    <key>com.apple.security.files.user-selected.read-only</key>
    <true/>
    <key>com.apple.security.assets.movies.read-only</key>
    <true/>
    <key>com.apple.security.assets.pictures.read-only</key>
    <true/>
    in the
      <iPhone>
            <Entitlements>
            <![CDATA[
    I got Push notifications working and accepted in the app store but it can't read the pictures directory when browsing for a file
    I know the app id and stuff is set up right or I wouldnt have been able to get it accepted in the app store.  In the entitlements area of course I have the application identifier set and aps-environment and keychain access groups and whatnot set up right.
    When I try to put the app onto the iPhone with iTunes it just says 'Entitlements are not valid' (does not mention anything about mismatched ids) I can't find anything about how to add this entitlement and I could have sworn I saw a thing that said I can just use the descriptor file to add entitlements in some of the documentation I have it set to use air 3.4
    Is there something I am doing wrong, how do I get apple to just put these entitlements in the mobileprovision file, I cant seem to edit it, if I do I also get an error in itunes that is some hex code...

    Did you ever solve your problem?
    I just transfered my web hosting and e-mail to bluehost. I had some of the same problems you are having. I noticed you have your incoming server set to bluehost.
    Incoming mail server: (SSL) box610.bluehost.com (sever requires authentication which I already have done)
    If bluehost is your server this is what worked for me:
    Account Information
    Account type— POP
    Description—anything you want
    Email Address—in your case would be [email protected]
    Full name—  first and last name
    Incoming server—mail.magnus.com
    User name—[email protected] Notice it is the @ symbol not a +
    password— your password . Remember they are case sensitive
    Outgoing Mail server—select edit smpt server list from the drop down window
    select the + to add a server
    Account Information
    Description—may be left blank
    Server name—mail.magnus.com
    TSL Certificate—None
    Advanced
    Use default ports
    Check  Use SSL
    Authenticate—password
    Username—[email protected]
    passowrd—your password
    Click ok
    In the accounts window
    Outgoing SMTP— select the server you just created.
    Check—use only this server
    Select the Advance tab next to the Mailbox Behaviors
    Check use SSL— it will be port 995
    Authenticate —use password
    Ann

  • Users shadowing a classroom object consistently get frozen screen in 4.41

    I've used 4.30 successfully for a year to hold web meetings in which several users shadow a classroom object at once.
    I installed 4.41 (installed fresh, not upgrade) on Monday and recreated classroom and shadow objects following same instructions in manual.
    Since then, in web meetings, both mac users and pc users report that their screens freeze and they can no longer see what's happening in the classroom - this happens every 5 to 15 minutes for some users and not at all for others. Thought it could be an X11 issue but it happens to PC users also.
    Users hadn't lost their internet connection as in each case I advised them to click again on the shadow application link on their webtop and they were able to rejoin the meeting.
    Has anyone else tested 4.41 with classroom shadowing?
    Any help would be much appreciated

    Have been testing this and found how to replicate this (RHEL4, SGD 4.41.907, Security Enabled)
    1) Create the classroom object as a windows application session with a web browser
    2) Create the shadow object according to instructions. I tested this when I assigned the shadow object to a user profile that has "multiple" checked as well as one that doesn't (single user profile)
    3) Start the classroom session
    4) Start the shadow session
    5) In the classroom, open the web browser and go to youtube and start any video. Also, scroll up and down a lot
    6) The classroom session will freeze soon into this. The classroom session window doesn't go away, it just freezes.
    So it seems that graphically intense classroom sessions are the problem (that's probably why sessions have been freezing on me when they did - I was using a drawing program and was dragging pictures and diagrams around the screen). I've performed this test and confirmed this several times. I'm able to get the shadow session to freeze in 1-2 minutes if I go right to a video and start playing it
    This is true with both mac and pc clients, on different networks

  • When user select 1 row in alv some other rows must automaticaly get selecte

    When user selects say any row in alv with vbeln = 1234 all rows which have vbeln = 1234 also must get selected automaticaly.Is there some event to handle row selection in alv by clicking the push button beside each row to left of ALV?

    Hi
    U can implement an your push button in order to select the remaining rows: in user-command u need to implement a code where u get the selected line and the select the other.
    Or simply u can select the other lines as soon as the user do something after selecting a row.
    How to do it depends on whick kind of alv you're using: if the internal table fir output has a flag field for the marker, "To select a line" means to check that field.
    Max

  • Get year from user selected month in field name

    Hi BExperts,
    I would your help about this problem on BI 7 :
    At the opening of the query, user selects a month (for example 03.2007).
    From this month, i have to indicate key figures on the selected month (03.2007) and key figures on the corresponding year (here 2007).
    I'm using a variable in order to get the selected month (0I_CMNTH).
    I don't know how to get the corresponding year (with a variable) ?
    For example : user selects "03.2007", in the query i would have :
    Period  Key figure
    03.2007     17
    2007           38
    Thanks for help.
    Points will be assigned.
    Cheers,
    Vince.

    Hello,
             I am not sure about the one you mentioned but this is another way which you can try by creating the customer exit variable V_YEAR under 0calyear characteristic and add the following code for gettting the previous year.
    data: year(4) type n,
             year1(4) type n.
    when 'V_YEAR '.
    if i_step = 2. "after the popup
    loop at i_t_var_range into loc_var_range
    where vnam = '0I_CMNTH'.
    year = loc_var_range-low (4).
    year1 = year - 1.
    clear l_s_range.
    l_s_range-low = year1.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    append l_s_range to e_t_range.
    exit.
    endloop.
    endif.

  • How to bind a user selected value to a view object bind variable?

    Hi
    I have two pages in ADF BC application. In the first page ,i will give a drop down menu to user which displays all the table names in my databse.
    when the user selects a table and goes to the second page..he should be given a menu or a check list of all the columns in the user selected table....
    to display the columns i have used the query
    Select COLUMN_NAME from user_tab_columns where table_name = : table_name in the view object.
    now how to bind the user selected table value in the first page to the table_name bind variable in view object ?
    thanks
    swathi.

    Hi,
    depends on how the select box is implemented. With ADF and ADF Faces, the default value selection is the list index. In a value change listener you could look up the selected value from the underlying iterator. Store this value e.g. in a session attribute and point the NDValue of the ExecuteWithParams operation to #{sessionScope.your_attribute}
    Frank

  • How to get the selected values from a selectmanylistbox?

    Hi ADF Experts,
    <af:selectManyListbox label="Label 1" id="sml1" partialTriggers="cb2"
                            value="#{viewScope.TestBean.lovValue}"
                      autoSubmit="true"      valuePassThru="true">
        <f:selectItems value="#{viewScope.TestBean.actualList}" id="si1"
                       binding="#{viewScope.TestBean.selectedItems}"/>
      </af:selectManyListbox>
      <af:commandButton text="get selected values" id="cb3"
                        actionListener="#{viewScope.TestBean.getSelectedValues}"
                        partialSubmit="true"/>
      private List<String> lovValue;
      private List<SelectItem> actualList;
    //getters and setters
      public void getSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
        for (String selectedItem : lovValue) {
            System.out.println("Selected item: " +selectedItem.); // this is giving 1 and 3 like this. how to get the checked values as I'm getting only the indexes. In this scenario I am populating the list programmatically.Just I wanted to know how can we get the selected values(not indexes). Please suggest.
    Thanks-
    Abhijit

    Hi Timo,
    As I am sharing the page fragment and the Java class. So its my usecase I have mentioned below
    I am sharing the jsff page fragment and java class. So that it wud be of help to others.
    jsff page fragment
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core">
            <af:panelGroupLayout id="pgl1">
              <af:commandButton text="Search"  id="cb1"
                                actionListener="#{viewScope.TestBean.searchSupplier}"/>
    </af:panelGroupLayout>
        <af:popup id="p1" binding="#{viewScope.TestBean.searchSupplierPopup}">
              <af:dialog id="d2"
                         type="none">
               <af:table value="#{bindings.Contacts.collectionModel}" var="row"
                      rows="#{bindings.Contacts.rangeSize}"
                      emptyText="#{bindings.Contacts.viewable ? 'No data to display.' : 'Access Denied.'}"
                      fetchSize="#{bindings.Contacts.rangeSize}"
                      rowBandingInterval="0"
                      binding="#{viewScope.TestBean.tsupportIssues}"
                      filterModel="#{bindings.ContactsQuery.queryDescriptor}"
                      queryListener="#{bindings.ContactsQuery.processQuery}"
                      filterVisible="true" varStatus="vs"
                      selectionListener="#{bindings.Contacts.collectionModel.makeCurrent}"
                      rowSelection="multiple" id="t1">
              <af:column sortProperty="name" filterable="true" sortable="true"
                         headerText="#{bindings.Contacts.hints.name.label}" id="c2">
                <af:outputText value="#{row.name}" id="ot1"/>
              </af:column>
              <af:column sortProperty="email" filterable="true" sortable="true"
                         headerText="#{bindings.Contacts.hints.email.label}"
                         id="c1">
                <af:outputText value="#{row.email}" id="ot2"/>
              </af:column>
            </af:table>
          <af:commandButton text="OK" id="cb5" partialSubmit="true"       actionListener="#{viewScope.TestBean.testMethod}"/>
          <af:commandButton text="Cancel" id="cb6"
                            actionListener="#{viewScope.TestBean.cancelPopupSearch}"/>
        </af:dialog>
            </af:popup>
      <af:selectManyListbox label="Label 1" id="sml1" partialTriggers="cb5"
                            value="#{viewScope.TestBean.lovValue}"
                      autoSubmit="true"      valuePassThru="true"
                            binding="#{viewScope.TestBean.prp1}">
        <f:selectItems value="#{viewScope.TestBean.actualList}" id="si1"
                       binding="#{viewScope.TestBean.selectedItems}"/>
      </af:selectManyListbox>
      <af:commandButton text="get selected values" id="cb3"
                        actionListener="#{viewScope.TestBean.getSelectedValues}"
                        partialSubmit="true"/>
      <af:commandButton text="remove selected" id="cb4"
             partialSubmit="true"           actionListener="#{viewScope.TestBean.removeSelectedValues}"/>
    </jsp:root>
    TestBean.java
    package com.demo.view;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import javax.faces.component.UISelectItems;
    import javax.faces.event.ActionEvent;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import oracle.adf.view.rich.component.rich.data.RichTable;
    import oracle.adf.view.rich.component.rich.input.RichSelectManyListbox;
    import oracle.adf.view.rich.context.AdfFacesContext;
    import oracle.adf.view.rich.event.DialogEvent;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.RowSetIterator;
    import org.apache.myfaces.trinidad.model.RowKeySet;
    public class TestBean {
      private RichTable tsupportIssues;
      private List<SelectItem> lovValue;
      private List<SelectItem> actualList;
      private RichSelectManyListbox prp1;
      private List valuesChoosed = new ArrayList();
      private UISelectItems selectedItems;
      private RichPopup searchSupplierPopup;
        public TestBean() {
        super();
      public void setTsupportIssues(RichTable tsupportIssues) {
        this.tsupportIssues = tsupportIssues;
      public RichTable getTsupportIssues() {
        return tsupportIssues;
      public void testMethod(ActionEvent actionEvent) {
        // Add event code here...
        // For learning purposes - show Select Many Button clicked 
         System.out.println("Select Many Button has been Clicked");
        // // RowKeySet Object can hold the selected rows from a user as follows    
        RowKeySet rksSelectedRows =         this.getTsupportIssues().getSelectedRowKeys();
        // Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows 
        Iterator itrSelectedRows = rksSelectedRows.iterator();  
        // Get the data control that is bound to the table - e.g.
        // OpenSupportItemsIterator    
        DCBindingContainer bindings =         (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 
        DCIteratorBinding dcIteratorBindings =         bindings.findIteratorBinding("findAllContactsIterator"); 
        // Information from binding that is specific to the rows  
        RowSetIterator rsiSelectedRows =         dcIteratorBindings.getRowSetIterator();   
        // Loop through selected rows  
        int i=1;
        while (itrSelectedRows.hasNext()) {        
          // Get key for selected row    
          Key key = (Key)((List)itrSelectedRows.next()).get(0);  
          // Use the key to get the data from the above binding that is related to the row      
          Row myRow = rsiSelectedRows.getRow(key);         
          // Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces       
          System.out.println(myRow.getAttribute("name"));
          valuesChoosed.add(myRow.getAttribute("name"));
    //        actualList = new ArrayList<SelectItem>();
    //        String j = Integer.toString(i);
    //        actualList.add(new SelectItem(j, (String)myRow.getAttribute("name")));
    //      i++;
           searchSupplierPopup.hide();
          AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
      public void setLovValue(List<SelectItem> lovValue) {
        this.lovValue = lovValue;
      public List<SelectItem> getLovValue() {
        return lovValue;
      public void setActualList(List<SelectItem> actualList) {
        this.actualList = actualList;
      public List<SelectItem> getActualList() {
        actualList = new ArrayList<SelectItem>();
        if(valuesChoosed.size()!=0){
        for(int i=0;i<valuesChoosed.size();i++){
          actualList.add(new SelectItem(valuesChoosed.get(i), (String)valuesChoosed.get(i)));
        else{
          actualList.add(new SelectItem("1","Select One"));
        return actualList;
      public void setPrp1(RichSelectManyListbox prp1) {
        this.prp1 = prp1;
      public RichSelectManyListbox getPrp1() {
        return prp1;
      public void setValuesChoosed(List valuesChoosed) {
        this.valuesChoosed = valuesChoosed;
      public List getValuesChoosed() {
        return valuesChoosed;
      public void getValues(ActionEvent actionEvent) {
        // Add event code here...
        for(int i=0;i<valuesChoosed.size();i++){
          System.out.println(valuesChoosed.get(i));
      public void getSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
         for(int i=0;i<this.getLovValue().size();i++){
             System.out.println("Selected Value:"+this.getLovValue().get(i));
      public void removeSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
      public void setSelectedItems(UISelectItems selectedItems) {
        this.selectedItems = selectedItems;
      public UISelectItems getSelectedItems() {
        return selectedItems;
        public void setSearchSupplierPopup(RichPopup searchSupplierPopup) {
            this.searchSupplierPopup = searchSupplierPopup;
        public RichPopup getSearchSupplierPopup() {
            return searchSupplierPopup;
        public void cancelPopupSearch(ActionEvent actionEvent) {
            // Add event code here...
            searchSupplierPopup.hide();
        public void searchSupplier(ActionEvent actionEvent) {
            // Add event code here...
            RichPopup.PopupHints hints = new RichPopup.PopupHints();
            searchSupplierPopup.show(hints);
    package com.demo.view;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import javax.faces.component.UISelectItems;
    import javax.faces.event.ActionEvent;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import oracle.adf.view.rich.component.rich.data.RichTable;
    import oracle.adf.view.rich.component.rich.input.RichSelectManyListbox;
    import oracle.adf.view.rich.context.AdfFacesContext;
    import oracle.adf.view.rich.event.DialogEvent;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.RowSetIterator;
    import org.apache.myfaces.trinidad.model.RowKeySet;
    public class TestBean {
      private RichTable tsupportIssues;
      private List<SelectItem> lovValue;
      private List<SelectItem> actualList;
      private RichSelectManyListbox prp1;
      private List valuesChoosed = new ArrayList();
      private UISelectItems selectedItems;
      private RichPopup searchSupplierPopup;
        public TestBean() {
        super();
      public void setTsupportIssues(RichTable tsupportIssues) {
        this.tsupportIssues = tsupportIssues;
      public RichTable getTsupportIssues() {
        return tsupportIssues;
      public void testMethod(ActionEvent actionEvent) {
        // Add event code here...
        // For learning purposes - show Select Many Button clicked 
         System.out.println("Select Many Button has been Clicked");
        // // RowKeySet Object can hold the selected rows from a user as follows    
        RowKeySet rksSelectedRows =         this.getTsupportIssues().getSelectedRowKeys();
        // Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows 
        Iterator itrSelectedRows = rksSelectedRows.iterator();  
        // Get the data control that is bound to the table - e.g.
        // OpenSupportItemsIterator    
        DCBindingContainer bindings =         (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 
        DCIteratorBinding dcIteratorBindings =         bindings.findIteratorBinding("findAllContactsIterator"); 
        // Information from binding that is specific to the rows  
        RowSetIterator rsiSelectedRows =         dcIteratorBindings.getRowSetIterator();   
        // Loop through selected rows  
        int i=1;
        while (itrSelectedRows.hasNext()) {        
          // Get key for selected row    
          Key key = (Key)((List)itrSelectedRows.next()).get(0);  
          // Use the key to get the data from the above binding that is related to the row      
          Row myRow = rsiSelectedRows.getRow(key);         
          // Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces       
          System.out.println(myRow.getAttribute("name"));
          valuesChoosed.add(myRow.getAttribute("name"));
    //        actualList = new ArrayList<SelectItem>();
    //        String j = Integer.toString(i);
    //        actualList.add(new SelectItem(j, (String)myRow.getAttribute("name")));
    //      i++;
           searchSupplierPopup.hide();
          AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
      public void setLovValue(List<SelectItem> lovValue) {
        this.lovValue = lovValue;
      public List<SelectItem> getLovValue() {
        return lovValue;
      public void setActualList(List<SelectItem> actualList) {
        this.actualList = actualList;
      public List<SelectItem> getActualList() {
        actualList = new ArrayList<SelectItem>();
        if(valuesChoosed.size()!=0){
        for(int i=0;i<valuesChoosed.size();i++){
          actualList.add(new SelectItem(valuesChoosed.get(i), (String)valuesChoosed.get(i)));
        else{
          actualList.add(new SelectItem("1","Select One"));
        return actualList;
      public void setPrp1(RichSelectManyListbox prp1) {
        this.prp1 = prp1;
      public RichSelectManyListbox getPrp1() {
        return prp1;
      public void setValuesChoosed(List valuesChoosed) {
        this.valuesChoosed = valuesChoosed;
      public List getValuesChoosed() {
        return valuesChoosed;
      public void getValues(ActionEvent actionEvent) {
        // Add event code here...
        for(int i=0;i<valuesChoosed.size();i++){
          System.out.println(valuesChoosed.get(i));
      public void getSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
         for(int i=0;i<this.getLovValue().size();i++){
             System.out.println("Selected Value:"+this.getLovValue().get(i));
      public void removeSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
        for(int i=0;i<this.getLovValue().size();i++){
            System.out.println("Selected Value:"+this.getLovValue().get(i));
            System.out.println(this.getLovValue().remove(i));
          AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
      public void setSelectedItems(UISelectItems selectedItems) {
        this.selectedItems = selectedItems;
      public UISelectItems getSelectedItems() {
        return selectedItems;
        public void setSearchSupplierPopup(RichPopup searchSupplierPopup) {
            this.searchSupplierPopup = searchSupplierPopup;
        public RichPopup getSearchSupplierPopup() {
            return searchSupplierPopup;
        public void cancelPopupSearch(ActionEvent actionEvent) {
            // Add event code here...
            searchSupplierPopup.hide();
        public void searchSupplier(ActionEvent actionEvent) {
            // Add event code here...
            RichPopup.PopupHints hints = new RichPopup.PopupHints();
            searchSupplierPopup.show(hints);
    Thanks,
    A. Abhijit

  • How to update records in a table based on user selection..

    Hi all,
    This time the above doubt is totally based on the logic of coding which I tried a lot but didn't get any solution. so atlast I come to sdn site.
    please help..
    The requirement is like that I have a table with 6 fields (1 primary key and other are nonkeys). If the user inputs some values in the fields on the screen, then a row will be added in the table. Upto this i have done well. but when the user want to change some value  in the existing row of the table my program unable to do so. Because I couldn't get any logic to do that as there are 5 nonkey fields, so if any one field is modified then the respective row should be selected first based on the user selection and then it should be updated.
    At this point I could not get any idea as it may take a lots of if conditions (I guess) to reach to that particular row.
    Please help..
    thanks ,
    sekhar

    Hi Sekhar,
    I am afraid, the whole design of your program is wrong, let me explain
    Let us say you have two rows(5 non key fields) that the user wants to update and the data in these five non key fields are identical and in your program you are getting a number(which is the key) using a number range object. So you will have two entries in the table for the same data.
    And on the update page when the user enters the non key fields, how will the program know(or for that matter any one of us) which record to pick, if you have two identical books and if asked for a book wouldn't you ask which one among these two do you want?
    Possible Solution: Identify a possible key maintaining the integrity of the data, that is a combination of the non key fields which will help you identify a unique row and make these fields as key fields in the table.
    A more costly solution(if you do not want to change the non key field keys to key fields) would be to, adding a check(using select statement) to see if the non key fields combination already exists in the Z table before inserting a record into the table.
    If yes, throw a message to the user and just update the values in the table, else insert the record.
    Another solution would be to, use the non key fields to generate a key(using some logic) and using this instead of the number range object.
    regards,
    Chen

  • Allowing access to select few public objects (moved from Native forum)

    I am moving my posting from Java Forums > Fundamentals > Key Classes > Native forum to this one. Sorry for posting it on the wrong forum earlier. Before each reply I have added a lien for clarity.
    Allowing access to select few public objects
    Author: COOLNM Posts: 5 Registered: 12/21/05
    Dec 21, 2005 9:59 AM
    I am developing a java application. I need to provide some scripting support (using Jython or Rhino) to my application so that the user can better use my application. Now the problem is I just want a select few public objects to be accesible via scripts and not all public objects I have written internally. I read somewhere that class name and code obfuscation could be a option but not a full proof solution. Can anyone suggest how a full proof solution can be achieved? Would running the script interpreter in seperate JVM help (and propogate the calls to the original JVM) ? Would a custom class loader help? Please suggest.
    Thanks,
    COOLNM
    Re: Allowing access to select few public objects
    Author: IanSchneider Posts: 1,381 Registered: 10/26/00
    Dec 21, 2005 10:14 AM (reply 1 of 10)
    I read somewhere that class name and code obfuscation could be a option but not a full proof solution.Correct, someone could still can call obfuscated methods.
    Would running the script interpreter in seperate JVM help (and propogate the calls to the original JVM) ?No.
    Would a custom class loader help? Possibly depending upon how the interpreter dispatches calls.
    Can anyone suggest how a full proof solution can be achieved?With jython, you could write custom PyObject subclasses (or general java facade classes) to expose only the methods you want to. The former technique allows more cool scripting functionality, the latter would presumably work in other interpreters. This would have to be done for every object you want to expose.
    Alternatively, you could enable a SecurityManager and allow only trusted code to invoke yours.
    Re: Allowing access to select few public objects
    Author: COOLNM Posts: 5 Registered: 12/21/05
    Dec 21, 2005 9:36 PM (reply 2 of 10)
    I read somewhere that class name and codeobfuscation could be a option but not a full proof
    solution.
    Correct, someone could still can call obfuscated
    methods.
    Would running the script interpreter in seperate JVMhelp (and propogate the calls to the original JVM) ?
    No.Could you please explain why this wouldn't work?
    The plan is:
    Let say I have 2 public objects A & B and I want the user to only use A via their scripts.
    In JVM1: I use both A & B
    In JVM2: I write a psuedo A and not B. For all the methods of A, I propogate the calls to JVM1 (I think this is achievable but not sure how)
    The script interpreter runs on JVM2.
    Now if the user tries to access A then the call would go to JVM1 but if he tries to access B then there is no B available in JVM2 so the user cant access B.
    I know this method could be heavy as each call would have to go from JVM1 to JVM2.
    By sepeate JVMs I mean seperate instance of java.
    >
    Would a custom class loader help? Possibly depending upon how the interpreter
    dispatches calls.
    Can anyone suggest how a full proof solution can beachieved?
    With jython, you could write custom PyObject
    subclasses (or general java facade classes) to expose
    only the methods you want to. The former technique
    allows more cool scripting functionality, the latter
    would presumably work in other interpreters. This
    would have to be done for every object you want to
    expose.
    Alternatively, you could enable a SecurityManager and
    allow only trusted code to invoke yours.-----------------------------------------------------------------------------------------------------
    Re: Allowing access to select few public objects
    Author: allquixotic Posts: 12 Registered: 12/19/05
    Dec 22, 2005 5:09 AM (reply 3 of 10)
    RMI has a way for multiple JVMs to communicate programmatically; you could also use sockets on the loopback network device (localhost). These techniques are how mature Java products constrain their number of running instances to a finite number (usually 1), they terminate any starting JVM early in the initialization procedures of the main method if the "already-running test" indicates one is running.
    If you use the networking method, you could basically read from a ServerSocket on the "executing" JVM, while the "scripting" JVM writes to a Socket. Then use reflection in the executing (server) side to determine if the method or object being referenced is one you want to expose. If not, do something -- like write back to the client that the method invocation was invalid. Reflection will slow down your code a lot though, so I don't recommend it for apps that already take up 50 megs or more of RAM ;)
    Regards,
    Sean
    Re: Allowing access to select few public objects
    Author: IanSchneider Posts: 1,381 Registered: 10/26/00
    Dec 22, 2005 9:05 AM (reply 4 of 10)
    Would running the script interpreter in seperate JVMhelp (and propogate the calls to the original JVM) ?
    No.
    Could you please explain why this wouldn't work?It could work. I said no because the other methods are better - easier to implement and vastly more performant without wasting resources.
    Re: Allowing access to select few public objects
    Author: COOLNM Posts: 5 Registered: 12/21/05
    Dec 23, 2005 12:48 AM (reply 5 of 10)
    Ya, the seperate JVM approach seems complex and might not be fully achievable.
    Can someone give small code snippets on how the method level control be achieved using Java SecurityManager. Just a recap on what I am trying to achieve -
    A & B are two public objects defined internally by my app.
    I have to give the user of my app the ability to write some code. But only B
    is to be exposed to client and not A.
    Let say I have this code -
    Object A = Interpreter.InitializeEngine(..);
    A.executeFromUser(stdin);
    The user mostly uses some scripting language, say Python and the Interpreter
    is Jython. Now my Interpreter is capable of understanding calls to Java
    objects from Python. If the user tries to access B via the scripts then it
    should be allowed to do so but access to A should not be allowed via the
    scripting language.
    Thanks,
    Neeraj
    Re: Allowing access to select few public objects
    Author: bschauwejava Posts: 721 Registered: 1/13/04
    Dec 26, 2005 2:13 PM (reply 6 of 10)
    What you probably want is to give the user access to an interface - not a class - that only exposes the methods that you want to expose.
    This is the way all RMI APIs are exposed to client programs.
    Re: Allowing access to select few public objects
    Author: bschauwejava Posts: 721 Registered: 1/13/04
    Dec 26, 2005 2:16 PM (reply 7 of 10)
    Just one more comment. You haven't said very much about the runtime model of the scripting environment vs your java environment. How many processes do you expect to have running to make the system work? Are you expecting your java code to wind up in a jar file and get loaded by the Python process? Or are you planning on the java code executing in a separate process? If the latter, then RMI is probably your best bet.
    Re: Allowing access to select few public objects
    Author: COOLNM Posts: 5 Registered: 12/21/05
    Dec 27, 2005 4:20 AM (reply 8 of 10)
    I haven't finalized on the runtime model yet as the scripting security issue is still not resolved. But I am sure that the java app code would init and run the scripting code and not the other way round. The app is pretty huge with heavy UI. Ya, the java code would be wrapped in jars (but mostly not in a single jar as I dont want the jar to be too hefty).
    Can someone comment on the use of SecurityManager in this case. My initial investigation shows that the objective on implementing method level security can't be implemented by this.
    Re: Allowing access to select few public objects
    Author: IanSchneider Posts: 1,381 Registered: 10/26/00
    Dec 27, 2005 9:14 AM (reply 9 of 10)
    My initial reply suggested writing a facade in java or by subclass PyObject. I highly recommend this path for ease of development, use, and runtime performance.
    Given that you don't understand the basics of java security, I will recommend this again.
    Re: Allowing access to select few public objects
    Author: COOLNM Posts: 5 Registered: 12/21/05
    Dec 27, 2005 11:33 PM (reply 10 of 10)
    I have started investigating on facade in java and subclassing PyObject. But I am not sure how these would resolve the primary issue. Even if I use these and if the script writer knows that there is a public class, say XYZ in my app then he can always access that class directly skipping my subclassed PyObject or the Java facade. Or am I missing something here?

    I have started investigating on facade in java and subclassing PyObject. But I am not sure
    how these would resolve the primary issue. Even if I use these and if the script writer knows
    that there is a public class, say XYZ in my app then he can always access that class directly
    skipping my subclassed PyObject or the Java facade. Or am I missing something here?Presumably your objects are somehow connected to the application. Your user could do something like:
    from com.foo import Player
    p = Player()
    p.setGold(Integer.MAX_VALUE)But of course the new Player object would not be part of the game. Now if you have some kind of static/singleton game state, then the malicious user could insert the Player into the game model...
    The real trick lies in understanding how to setup the jython interpreter. If your interpreter classloader can only load facade classes (and system classes) then the client script could not load other classes. There is also a hook for the import keyword so you could disallow importing java classes. Each interpretor instance has the ability to setup the locals and globals for the session so you can insert live game objects.
    I am only familiar with jythons internals, so this may or may not be applicable to rhino.

  • I want is that I get  user name!

    Hi,
    Below are my two annotated classes, namely, Requisition and User, that represent two tables requisitions and users. What I want is that I get
    to get username from users table in my requisition query instead of user id which is stored in the requisitions.request_by.
    Table field requisitions.request_by hold the ids of users ,ie, users.id values.
    Here are my tables:
         users
                   + id int(11)
                   username varchar(15)
                   password varchar(15)
                   role int(11)
                   last_login timestamp
         requisitions
                   id int(11)
                   post varchar(50)
                   + request_by int(11)
                   platform varchar(50)
                   experience_required int(11)
                   comments text
                   date_requested date
    Here is my Query for fetching requsition object in the RequisitionServiceimpl.java
         public List getRequisitions(User loggedInUser){
              Query queryRequsitions = em.createQuery("Select r FROM Requisition as r");
              List list = queryRequsitions.getResultList();          
              return list;     
    Below are my two annotated classes Requisition and User:
    import java.util.Date;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import javax.persistence.PrimaryKeyJoinColumn;
    import javax.persistence.SecondaryTable;
    import javax.persistence.Table;
    import javax.persistence.JoinColumns;
    import javax.persistence.JoinColumn;
    @Table(name="requisitions")
    @SecondaryTable(name="users")
    @Entity
    public class Requisition {
         @Id
         private int id;
         private String post;
         @Column(name = "request_by")
         private int requestBy;
         private String platform;
         @Column(name = "experience_required")
         private int experienceRequired;
         private String comments;
         @Column(name = "date_requested")
         private Date dateRequested;
         // Name from users Table
         @Column(table="users", name="username")
         private String username;
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getPost() {
              return post;
         public void setPost(String post) {
              this.post = post;
         public int getRequestBy() {
              return requestBy;
         public void setRequestBy(int requestBy) {
              this.requestBy = requestBy;
         public String getPlatform() {
              return platform;
         public void setPlatform(String platform) {
              this.platform = platform;
         public int getExperienceRequired() {
              return experienceRequired;
         public void setExperienceRequired(int experienceRequired) {
              this.experienceRequired = experienceRequired;
         public String getComments() {
              return comments;
         public void setComments(String comments) {
              this.comments = comments;
         public Date getDateRequested() {
              return dateRequested;
         public void setDateRequested(Date dateRequested) {
              this.dateRequested = dateRequested;
    // Only Getter for Users Table field username
         public String getUsername() {
              return username;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import javax.persistence.Table;
    @Table(name="users")
    @Entity
    public class User {
    @Id
    private Long id;
    @Column(name="username")
    private String name;
    private String password;
    private int role;
    public String getName() {
    return name;
    public void setName(String user) {
    this.name = user;
    public String getPassword() {
    return password;
    public void setPassword(String password) {
    this.password = password;
    public Long getId() {
    return id;
    public void setId(Long id) {
    this.id = id;
    public int getRole() {
    return role;
    public void setRole(int role){
    this.role = role;
    Thank you,
    Adil

    I made this changes to Requisition.java and now I can get user name
    import java.util.Date;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import javax.persistence.JoinColumn;
    import javax.persistence.OneToOne;
    import javax.persistence.Table;
    @Table(name="requisitions")
    @Entity
    public class Requisition {
    @Id
    private int id;
    private String post;
    @Column(name = "request_by")
    private int requestBy;
    private String platform;
    @Column(name = "experience_required")
    private int experienceRequired;
    private String comments;
    @Column(name = "date_requested")
    private Date dateRequested;
    @OneToOne
    @JoinColumn( name="request_by", insertable=false, updatable=false)
    private User user;
    public int getId() {
    return id;
    public void setId(int id) {
    this.id = id;
    public String getPost() {
    return post;
    public void setPost(String post) {
    this.post = post;
    public int getRequestBy() {
    return requestBy;
    public void setRequestBy(int requestBy) {
    this.requestBy = requestBy;
    public String getPlatform() {
    return platform;
    public void setPlatform(String platform) {
    this.platform = platform;
    public int getExperienceRequired() {
    return experienceRequired;
    public void setExperienceRequired(int experienceRequired) {
    this.experienceRequired = experienceRequired;
    public String getComments() {
    return comments;
    public void setComments(String comments) {
    this.comments = comments;
    public Date getDateRequested() {
    return dateRequested;
    public void setDateRequested(Date dateRequested) {
    this.dateRequested = dateRequested;
    public User getUser() {
    return user;
    public void setUser(User user) {
    this.user = user;
    Edited by: adilsun on Jul 23, 2008 8:36 PM

Maybe you are looking for