This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 22, 2015, 6:43 AM
12 Posts

Dialog with view - picklist

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 9.0.1
  • Role: Developer
  • Tags: dialog,view,search
  • Replies: 4

I am searching for a solution with dialog box and view to pick/select document and returning also unid of the selected document.

Sep 22, 2015, 7:20 AM
38 Posts
My take

I have code who get all entries from a view and store them in a custom Java object

public static List<User> findUsersbyAccountId(String accountId){

        List<User> list = new ArrayList<User>();

        try{

            ViewNavigator nav = findViewNavigatorById(VIEW_USERS, accountId);

            if(nav.getCount()>0){

                for (Iterator<ViewEntry> it = nav.iterator(); it.hasNext();){

                    Document doc = it.next().getDocument();

                    list.add(fillUserObject(doc));

                  }

            }

        }catch(Exception e){

            XspOpenLogUtil.logError(e);

        }

        return list;

    }

Where the fillUserObject creates an User Object and return it with all the values of a user document, like DocId and Unid

As you can see, the method returns a Java List

In my Dialog I have a DataTable where I call a controller class to get me the list as described above

I display the values in the columns, with EL, as you access every row directly my User object.

Per row I have a link

<xp:link escape="true" text=""

                                            id="link3"

                                            rendered="#{javascript:!compositeData.controller.showUserRemoveIcon(row)}">

                                            <i

                                                class="fa fa-plus-circle">

                                            </i>

                                            <xp:eventHandler

                                                event="onclick" submit="true" refreshMode="partial"

                                                refreshId="userSelections" immediate="true">

                                                <xp:this.action>

                                                    <xp:executeScript>

                                                        <xp:this.script><![CDATA[#{javascript:compositeData.controller.addSelectedUser(row);

                                                        }]]></xp:this.script>

                                                    </xp:executeScript>

                                                </xp:this.action>

                                            </xp:eventHandler>

                                        </xp:link>

 

I call a method addSelectedUser(row), where row is the User Object. In the method I add it to a list and do things with this object.

 

If you need more information let me know.

 

Sep 22, 2015, 9:41 AM
12 Posts
What with large dataset ?

What is your way to select form large dataset ?

Sep 22, 2015, 1:51 PM
586 Posts
standby snippet

That snippet might have problems with bootstrap applications in iOS9.  Be careful there.  I had some issues and moved to a different technique.

 

 


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal