Relationship through SelectManyCheckbox

Hi:
I am trying to implement a relation for a User than can have several Roles, through a UserRole table that implements the relationship
The idea is present an interface that displays several checkboxes representing the Roles, so the administrator can give a single user the number of roles he needs. I assume that this can be acomplished using SelectManyCheckbox control, so, for each checkbox selected, a new UserRole registry is added.
How can i do this using ADF ??? Is there any example available ???
Honestly, the examples provided in the Jdev official site, are too much simple for a real world application, wich is very annoying
Thanks

Hi,
I just finished implementing a function exactly the same as you want.
Here is what I did
in backing bean (the most important part)
1) declare variables to support the selection and of course add the accessor method for the first two variables
private String[] selectedItems; to store list of selected roles
private List items; to store master role list that is available
private int maxSelectedItems = 0; to store total of role available
2) initialize items with full role list in your bean
setItems(new ArrayList());
for each of your master role list record (I retrieved this via a view object from database)
getItems().add(new SelectItem(yourRoleID, yourRoleName));
maxSelectedItems = total number of your master role list
setSelectedItems(new String[maxSelectedItems]); (if you don't do this, you will hit IndexOutBound exception)
optional: if you need to pre-check some roles (e.g. in case of editing an existing user record), then you need to
for (int i=0; i<noOfpreCheckedBox; i++) {
selectedItems = what ever your Role is
3) saveButton method
noOfItemSelected = getSelectedItems().length;
for (int i=0; i<noOfItemSelected; i++) {
create a new row in your target view object
set role id attribute to selecteditems[i]
set user id to whatever user id is
Of course, for existing user record it is more complicated.
You may need to compare whether the role exists in database or not (I check it from a view object). create row only if it does not exist.
You also need to check whether a role shown in your user's role view object exists in your selecteditems list. if not, it means user has unchecked it, then you need to delete it from the view.
Finally, do a commit. I pre-created an action binding in my PageDef for this, so I can simply call getOperationBinding("Commit").execute()
in jsp
<af:selectManyCheckbox label="Assign user to Role(s)"
requiredMessageDetail="You must select at least one role"
value="#{backingbean.selectedItems}"
required="true">
<f:selectItems value="#{backingbean.items}"/>
</af:selectManyCheckbox>
Hope this help.

Similar Messages

  • Creating a relationship between two tables  through configuration manager

    I've just created two tables in the underlying db, each with a primary key and established a primary key - foreign key relationship. I've also created a relationship through stellent and it shows up under the 'Relations' Tab.
    However, when I go to Information Fields > Field Info > Click on my Field > 'Edit' > Enable Option List and Configure > Use the view of one of the tables and click on Dependant Field , I don't see any Relationships defined. What could I have done wrong here?
    Thanks.

    ok...solved...followed metalink note 445363.1 for clarification on the right approach to creating Dependant Choice Lists (DCL).

  • Characteristic Relationship - displaying data

    Hi All,
    I implemented characteristic relationship (through ABAP class) and it is working fine except one thing.
    It displays the desired combinations, but also posted data in infoprovider in planning mode, that were suppose to be hidden (according to char. rel. logic).
    I set for all the relevant characteristics "characteristic relationship" in query designer....
    Any idea what I am doing wrong?
    Many Thanks!
    Pavel

    Hi Pavel,
    sorry, maybe your exist does not work in all cases (implementation of the check method).
    From your description it seems that you want to control access or maybe only make something not input ready. In the first case use authorization, in the latter use data slices.
    When you say 'measures' it is also not clear for me whether you mean 'key figures'. You can not control key figures with characteristics relations, except you are using a characteristic to model key figures (account model). But again, characteristic relationships are a means to control the valid combination in the cube (so to say they define the 'truth' in the cube or what are 'consistent' data records). Data slices are a concept to protect data from being changed (typical example: lock a planning version).
    Regards,
    Gregor

  • Extending DataFinder to include Non-Data Entries and Relationships Between Entries

    I am trying to create custom data centralization and management software for our lab with DataFinder Toolkit.  In addition to storing data from data acquisitions, I want to be able to store additional information with the data such as images, pdf files, word documents that can be easily accessed after finding the data.  My current idea is to handle external files by storing the filepath in a property of an object vs trying to store the data itself in the datafinder database.  My code would know how to open these files so the user can see them with external software or a custom labview app.
    I also want to be able to store non-data objects such as an object that describes a piece of test equipment or a sample through properties and external files.  Images and documents are again important here.  And then create relationships through unique barcoded IDs that are a property in the datafinder entry.  So not only could I look at the data, I could find information about the samples and lab equipment. Or anything else we think needs to be saved.
    The code I am writing around DataFinder would be in charge of maintaining the unique IDs and know how the relationships between those IDs work to generate the proper queries. Like a 'Get Test Equipment Used' button next to a search result.
    For the external non-data objects I was going to use Labview code to create a file with all the information about the object (unique ID, properties and external file paths) and create a plug-in so the datafinder will index the file and make it searchable.
    Does this seem reasonable? I like the idea of working with one system and having everything update based on adding, deleting and modifying files in a folder. Also, I like the idea of not splitting the data management up into multiple technologies and having to make those work together.
    Solved!
    Go to Solution.

    From the description, you've given the system seems plausible. The non-data elements you discussed when broken down are just additional data to associate with an object.  Storing file paths seems plausible as done in the community example below:
    Execute String/Numeric Querry Using Data Finder Toolkit
    https://decibel.ni.com/content/docs/DOC-10631
    Regards,
    Isaac S.
    Regards,
    Isaac S.
    Applications Engineer
    National Instruments

  • Many-to-many relationship - show all values

    Hi,
    I'm building a cube in 2008R2 and have a many-to-many relationship through a bridging table but when displaying the results it is effectively an inner join and I would like to see a full outer join with the unknown rows set to "unknown".
    I've managed to achieve this by doing a full outer join in the view that creates my bridging table and having an unknown member in my dimensions but then when I added in a dimension that wasn't directly related to the bridging table the unknown rows
    were removed again. I was able to get past this by adding a row to my fact table with all the keys set to unknown and the metrics set to zero.
    Whilst this works it really does not seem like an ideal solution, especially as previously empty metrics are now returning a zero.
    Is there any way to achieve this in SSAS? Perhaps in the way unknown members are processed?
    Thanks,

    cccparkhill,
    What you did is the only way to achieve what you want.
    In cubes you connect Dimensions throw Facts. By definition dimensions are
    “How do business people describe the data that
    results from the business process?”
     and facts are “What are we measuring?”, noting the underlined
    we can understand that _normally and usually_ the relation between the dimensions and the facts represent incidents happened in the real world ... the way you approach, think, and deal with dimensions and facts in cubes is different than dealing with tables
    in normal relational transnational database.
    Personally I do what you did when I want to achieve "Left join"
    Please mark this reply as the answer
    or vote as helpful, as appropriate, to make it useful for other readers

  • Cost center relationship with department

    Hi experts,
    I have one question to ask about cost center relationship.Let say one department use only one cost-center. Is it I have to key-in the relationship between department and cost-center only or I have to key -in all the position in that department with the cost-center.If I don't keyin the relationship between position and cost center, how about the report. It will automatically appear or not.

    HI MJ,
    Please assign the Org Unit to a Cost Center using A011 Relationship through IT1001.
    Secondly, the principle of Inheritance works here.....i.e.
    IF you have assigned a O-K relationship at the Org Unit Level, all the reporting Org Units & Positions will inherit the Same Parent Cost Center........except in cases where the O-K / S-K Relationship is changed for any other org Units...or Positions... in such cases, the reporting org units or positions will inherit that.....
    Cost center assignments are inherited along the organizational structure.
    Hope it is clear...
    Good Luck !!!!
    Kumarpal Jain.

  • Org unit - Orgunit relationship

    Hi Experts,
    I have uploaded org unit to org unit relationship through BDC using PO13 transaction code and relationship type A0003 but somehow in ppom_old i am not able to view the relationship between org unit to org unit.
    Kindly suggest.
    Regards,
    J

    As mentioned by Dilek, t-code pp02 can be used to maintain any OM Object (but you have to specify the Object Type).
    Some other t-codes are specific to Object Types
    po03 Maintain Job
    po10 Maintain Organizational Unit
    po13 Maintain Position
    po14 Maintain Task
    and if you replace poXX by pqXX, you'll get the Measure for the same Object type.
    Just for fun, I typed in other t-codes starting with po and got
    po01 Maintain Work Centre
    po02 Maintain Development Plan
    po04 Maintain Business event type
    etc...

  • How to import Relationship

    we are having large data nearly about 10k so it is very tedious to create relationships in data manager. can anyone please tell us the proper way of importing relationships through data manger and also specify the changes we are suppose to make in the console manager, if any.
    please provide us with a simple example so that we can apply it on a broader scale.
    help required urgently
    thanks in advance
    swapnil

    Hi Prasad,
    for your given example, you want to import the record into hierarchy:
    your source will be like this:
    common group;computer related;hard ware;Soft ware.
    then you can import this in a hierarchy and follow these steps.
    1. select the category and right click, in the context menu set the split delimeter, in that choose split hierarchy.
    2. select the category and right click, from the context menu select split into hierarchy.
    3. In Map fields/values tab, in source fields you will see new split hierachy field, map this field to corresponding destination cateory field.
    4. in values pane, you can see the source values in a hierarchy.
    5. Map these values to the corresponding destination values, other wise you can add to the destination in a new category, ( select the source values node and click on add button and you can selcect Add branch as child Or Add branch as sibling)
    6. Once value mapping is over, do the importing and you can see these results in Data manager Taxonomy mode.
    hope this may help You,
    Regards,
    srinivas

  • Relationship import | Import manager

    Hi ,
      I am trying to import relationships through import manager in the material repository . What I do is , there are some existing relationships that I created in the data manager . I export them first [ data manager > relationships > export to a file ] to a file and then make changes to the existing file . I use the same file to import relationships but this time with the import manager . I have the following column names in my ".TXT" file ...
    1) material numbe <name of the relationship defined in the console>
    2) material number <>
    3) quantity
    I can successfully map the fields and then when I choose the import action it gives me the following error ...
    Import failed. Field not found.
    Import action: NoneSource record no: 8
    there is no record in my file actually at number 8 . I removed the last "Enter" from the file and then imported it but with same results . I exported the existing relationships to an excel file and then tried to import it through the import manager but with the same result .
    To verify if there is a problem with the file I use the same file to import the relationships through data manager [relationships > import from file > name of the relationship defined in the console ] and I am able to successfully import it .
    What do you guys think is the problem ??
    Regards
    Deepak Singh

    Hi Deepak,
    I had performed the following steps and it worked perfectly fine.
    Just go through them once and check that you have did the same.
    1. Export Relationship using Data Manager -> Relationships -> Export to File.[There is only Display Field i.e. Material]
    2. Imported the same text file with Type="Delimited Text" and Delimiter="\t"
    3. Select the Relationship table from the Destination drop down list.
    4. Map the Parent Material with the Material[Parent] and Child with Material[Child].Also Quantity with the qualifier Quantity.
    5. Execute the import.
    Note : Please dont make any changes to the Text file and try importing.
    Regards,
    Jitesh Talreja
    Edited by: Jitesh Talreja on Apr 10, 2008 7:25 AM

  • Unidirectional one-to-many relationship without a join table

    Hello,
    I have 2 classes, Invoice and InvoiceLine, and a one-to-many unidirectional relationship from Invoice to InvoiceLine. By default, with JPA, it would be mapped by a join table with foreign keys that refer to the 2 tables which represent Invoice and InvoiceLine.
    My problem: the database has already a foreign key in the table which represents InvoiceLine that refers to the table which represents Invoice.
    To solve my problem I could make the relationship bidirectional but I would like to know if it is possible to keep it unidirectional and to use the foreign key which already exists (in the table that represents InvoiceLine). How could I declare the mapping with JPA?
    Thanks in avance for your answers.

    JPA requires that any @OneToMany mapping not using a join table have an inverse @ManyToOne mapping. In general the foreign key in the target object needs to be mapped and a @ManyToOne mapping is normally the best way to map it, so making the relationship bi-directional is your best option.
    There are other ways in TopLink to map a unidirectional 1-m, but these are not directly supported by the JPA spec. You could define a TopLink OneToManyMapping for the relationship through a TopLink DescriptorCustomizer and the code API. You would still need to map the foreign key in the target object some way, but you could use a @Basic mapping for this as long as you keep it in synch.
    In TopLink you could also map the relationship using an AggregateCollectionMapping (basically a collection of embeddables), and then not require mapping the foreign key in the target, but this imposes limitations on the target object (must be treated like an embeddable instead of entity). You would also need to configure the target object to be an aggregateCollectionDescriptor if using this option.

  • NAKISA_Dotted Line Relationship

    Dear Expert,
    We need maintain Dotte line relationship in SAP OM and we need to reflect the relationship over NAKISA Organizational Visualization "OrgChart" and in the details panel as well.
    We plan to maintain dotted-line relationship through either a standard relationship e.g., A|088-’Dotted line reports to’ or a custom relationship A|Z88-’Dotted line reports to’ if SAP can recommend?
    Does the Dotted Line in NAKISA required any further configuration via NAKISA Admin or it can be reflecting automatically in OrgChart?
    Regards,
    Ihsan

    Ihsan.
    The latest version of OrgChart (you don't actually mention what version you are using) will display dotted line relationships without any additional configuration.
    The following is the information it uses for visualising the dotted line relationships (as per field mapping check list):
    Generic Fields and Relationships
    SAP Table Name
    Object Type
    SAP Relationship
    Notes
    Dotted position to position
    HRP1001
    S to S
    A005
    Dotted position to org unit
    HRP1001
    S to O
    ZNG
    Nakisa hierarchy dataelement has default value of 'ZNG' for dotted relationship. This value must be adjusted to match SAP backend data.
    Regards,
    Stephen.

  • All values showing up when selecting attributes from dimension

    I have two dimensions:
    DimCustomer - CustomerID, name, etc
    DimProduct - ProductID, price etc
    FactOrderDetail - CustomerID, OrderID, OrderDetailID, ProductID
    When i drag CustomerName onto the pivot table, it shows ALL customers.
    When I then drag ProductName on to the pivot table, it does a cross join, links all Customers to All Products.
    I expected id only get a list of customers linked the products they bought, due to the relationship through the fact table. What am i doing wrong here?

    You need to add a measure in the pivot to make the relationship effective.
    Something simple like this should work:
    RowCount:= COUNTROWS(FactOrderDetail)
    That works, thanks!
    How come a measure such as TotalValue:=SUMX(product,product[Cost]) doesnt work?

  • Fixing entry already exists . Error in creation of fixed pegging

    Hi,
    we are calling CTP from GATP after product availability check. Using fixed pegging relationship through standarad abap class
    error message is coming as
    Error occurred during creation of fixed pegging relationships
    Fixing entry already exists
    Message no. /SAPAPO/OM_ERROR2328
    diagnosis
       An application program called an LCA routine. This led to an error.
    Procedure for system administrator
    Contact SAP Service. Specify the application
    message occurred.
    You must also enter:
    o   The message number
    o   Return code 17313 (om_pb_fixentry_exists)
    o   Error code COM Core

    Dear Santosh,
    the common cause for the error LC Return code 17313:                                                   
    The heuristic tries to determine locking arguments, but other processes are locking these.                                                      
    Therefore the proposal,                                            
    1. Don't run the MRP in a parallel mode.                                
    2. Check the note 513827 for more information.               
    Regards,
    Tibor

  • Cost center in PP01

    While using tcode PP01 and choosing "relationship" infotype, Iam not able to view cost center relationshp though I can view relationships like "belongs to", holder  and "reports to".
    I checked in PPOME for the particular position and found that cost center is existing for the particular position.
    Pl. help to sort out this problem.

    Dear Raghu,
    It s not mandatory to maintain the cost center relationship  through PP01  or po13.
    Maintaining of Cost center by  infotype 0027  Cost distribution is enough.
    Regards,
    Sairam.

  • SUS administrator working as supplier user

    Hello to all,
        I want to know if it possible that an administrator works like users from different supplier. I mean, if there is a problem can a administrator confirm a PO or create an ASN like an supplier user?
    I have tried to assign two " is contact person of " relationship through BP transaction but i can't change between them on the portal
    Best regards,
    Nacho

    it is not possible.
    purchaser administrator , can have access to sus system --> but he can not create documents on behalf of the suppliers.
    he can just --> make changes to supplier companies..

Maybe you are looking for

  • How do I update my software?

    I currently have a mac version 10.4.11 (2 GHz Intel Core 2 Duo), and I am unable to download the new version of itunes or sync my iphone with this. How do i go about updating my software? My computer says no system updates available.

  • Macbook Pro no longer connects to Samsung TV thru HDMI

    So my 13" MacBook Pro and Samsung HDTV i got back in feburaury were working perfectly together thru HDMI cable to a Dynex Mini DisplayPort, then all of a sudden they stopped. Now whenever I plug the two in together the MacBook turns blue ( as it did

  • Dmcrypt performance sucks on my fileserver

    I have a fileserver running x86_64 version of ArchLinux. The boot drive is unencrypted, all data disks use dmcrypt with aes-xts-benbi cipher, keysize 512bit (256bit effectively), I use the aes_x86_64 module. The encrypted devices are in two LVM volum

  • Discover 10.1.2.0

    hi all, can you help me , where can i download oracle discoverer 10.1.2.0 for linux .. i checked throughly, iam  getting only discoverer 10.1.2.0 for windows only . but i need for linux platform... anybody send me the exact location for download "dis

  • Infocube design - Navigational attribute

    Hi Gurus, 0ASSET is my characteristics and ZLOCCODE is a navigational attribute of 0ASSET. In infocube , the ZLOCCODE is defined in dimension and as well in navigational attribute. So , gurus could you please explain why we need to define the ZLOCCOD