Package org.itsnat.comp.list

Examples of org.itsnat.comp.list.ItsNatHTMLSelectMult


        return null;
    }

    public ItsNatHTMLSelectMult createItsNatHTMLSelectMult(HTMLSelectElement element,NameValue[] artifacts,boolean execCreateFilters,ItsNatStfulDocComponentManagerImpl compMgr)
    {
        ItsNatHTMLSelectMult comp = null;
        boolean doFilters = hasBeforeAfterCreateItsNatComponentListener(execCreateFilters,compMgr);
        if (doFilters) comp = (ItsNatHTMLSelectMult)processBeforeCreateItsNatComponentListener(element,getCompType(),null,artifacts,compMgr);
        if (comp == null)
            comp = new ItsNatHTMLSelectMultImpl(element,artifacts,compMgr);
        if (doFilters) comp = (ItsNatHTMLSelectMult)processAfterCreateItsNatComponentListener(comp,compMgr);
View Full Code Here


        ItsNatDocument itsNatDoc = getItsNatDocument();

        DisabledEventsAndCompListener docPrev = loadDocumentFromSession();
        //ItsNatDocument itsNatDocPrev = docPrev.getItsNatDocument();

        ItsNatHTMLSelectMult prevListComp = docPrev.getListComponent();
        DefaultListModel model = (DefaultListModel)prevListComp.getListModel();
        ListSelectionModel oldSelModel = prevListComp.getListSelectionModel();
        prevListComp.dispose(); // to disconnect data model and selection models from the old markup (removing internal listeners)

        listComp.setListModel(model);// Reusing the data model
        // The selection model object may be reused but the current selection state will be lost,
        // so we reuse the selection state saved before
        boolean[] selection = getSelection(model.size(),oldSelModel);
View Full Code Here

    public void processAction(String action)
    {
        ItsNatDocument itsNatDocPrev = loadDocumentFromSession();

        ItsNatHTMLSelectMult prevListComp = (ItsNatHTMLSelectMult)itsNatDocPrev.getItsNatComponentManager().findItsNatComponentById("listId");
        DefaultListModel model = (DefaultListModel)prevListComp.getListModel();
        prevListComp.dispose(); // to disconnect the data model from the old markup

        listComp.setListModel(model);// Reusing the data model

        setSelection();
View Full Code Here

        ItsNatHTMLSelectComboBox selectCombo = (ItsNatHTMLSelectComboBox)compMgr.findItsNatComponentById("selectComboId");
        check(selectCombo);
        ((MutableComboBoxModel)selectCombo.getComboBoxModel()).addElement("Option 1");
        ((MutableComboBoxModel)selectCombo.getComboBoxModel()).addElement("Option 2");

        ItsNatHTMLSelectMult selectList = (ItsNatHTMLSelectMult)compMgr.findItsNatComponentById("selectListId");
        check(selectList);
        ((DefaultListModel)selectList.getListModel()).addElement("Option 1");
        ((DefaultListModel)selectList.getListModel()).addElement("Option 2");

        ItsNatFreeComboBox freeCombo = (ItsNatFreeComboBox)compMgr.findItsNatComponentById("freeComboBoxId");
        check(freeCombo);
        ((MutableComboBoxModel)freeCombo.getComboBoxModel()).addElement("Option 1");
        ((MutableComboBoxModel)freeCombo.getComboBoxModel()).addElement("Option 2");
View Full Code Here

    public void processAction(String action,ItsNatServletRequest itsNatRequest)
    {
        ItsNatDocument itsNatDocPrev = loadDocumentFromSession(itsNatRequest);

        ItsNatHTMLSelectMult prevListComp = (ItsNatHTMLSelectMult)itsNatDocPrev.getItsNatComponentManager().findItsNatComponentById("listId");
        DefaultListModel model = (DefaultListModel)prevListComp.getListModel();
        prevListComp.dispose(); // to disconnect the data model from the old markup

        listComp.setListModel(model)// Reusing the data model

        setSelection(itsNatRequest); // set the selection state from the server
View Full Code Here

    public void processAction(String action,ItsNatServletRequest itsNatRequest)
    {
        ItsNatDocument itsNatDocPrev = loadDocumentFromSession(itsNatRequest);

        ItsNatHTMLSelectMult prevListComp = (ItsNatHTMLSelectMult)itsNatDocPrev.getItsNatComponentManager().findItsNatComponentById("listId");
        DefaultListModel model = (DefaultListModel)prevListComp.getListModel();
        prevListComp.dispose(); // to disconnect the data model from the old markup

        listComp.setListModel(model)// Reusing the data model

        setSelection(itsNatRequest);
View Full Code Here

    public static void LISTS_MULTIPLE_SELECTION()
    {
        ItsNatDocument itsNatDoc = null;
        ItsNatComponentManager componentMgr = itsNatDoc.getItsNatComponentManager();

        ItsNatHTMLSelectMult listComp = (ItsNatHTMLSelectMult)componentMgr.createItsNatComponentById("compId");

        DefaultListModel dataModel = (DefaultListModel)listComp.getListModel();
        dataModel.addElement("Madrid");
        dataModel.addElement("Sevilla");
        dataModel.addElement("Segovia");
        dataModel.addElement("Barcelona");
        dataModel.addElement("Oviedo");
        dataModel.addElement("Valencia");

        ListSelectionModel selModel = listComp.getListSelectionModel();
        selModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        selModel.setSelectionInterval(2,3);

        EventListener evtListener = new EventListener()
        {
            public void handleEvent(Event evt)
            {
                System.out.println(evt.getCurrentTarget() + " " + evt.getType());
            }
        };
        listComp.addEventListener("change",evtListener);

        ListDataListener dataListener = new ListDataListener()
        {
            public void intervalAdded(ListDataEvent e)
            {
View Full Code Here

        ItsNatHttpSession itsNatSession = (ItsNatHttpSession)itsNatRequest.getItsNatSession();
        HttpSession session = itsNatSession.getHttpSession();
        ItsNatDocument itsNatDocPrev = (ItsNatDocument)session.getAttribute("previous_doc");
        session.removeAttribute("previous_doc"); // No longer available

        ItsNatHTMLSelectMult prevListComp = (ItsNatHTMLSelectMult)itsNatDocPrev.getItsNatComponentManager().findItsNatComponentById("listId");
        DefaultListModel model = (DefaultListModel)prevListComp.getListModel();
        prevListComp.dispose(); // to disconnect the data model from the old markup

        ItsNatComponentManager compMgr = itsNatDoc.getItsNatComponentManager();
        ItsNatHTMLSelectMult listComp = (ItsNatHTMLSelectMult)compMgr.addItsNatComponentById("listId");
        listComp.setListModel(model)// Reusing the data model
        // ...
    }
View Full Code Here

TOP

Related Classes of org.itsnat.comp.list.ItsNatHTMLSelectMult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.