ItemSearchCreate funktioniert jetzt
git-svn-id: https://svn.libreccm.org/ccm/trunk@1762 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
2ff87520fb
commit
5dc1a8ee92
|
|
@ -1093,4 +1093,4 @@ cms.ui.category.undeletable=Diese Kategorie kann nicht gel\u00f6scht werden.
|
||||||
cms.ui.item_search.flat.filter.submit=Filtern
|
cms.ui.item_search.flat.filter.submit=Filtern
|
||||||
cms.ui.item_search.selected=Ausgew\u00e4hltes Content Item (ID)
|
cms.ui.item_search.selected=Ausgew\u00e4hltes Content Item (ID)
|
||||||
cms.ui.item_search.create=Neu anlegen
|
cms.ui.item_search.create=Neu anlegen
|
||||||
cms.ui.item_search.create.folder_select=Order ausw\u00e4hlen
|
cms.ui.item_search.create.folder_select=Ordner ausw\u00e4hlen
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,11 @@ import java.math.BigDecimal;
|
||||||
class ItemSearchCreateItemPane extends CMSContainer implements FormProcessListener, FormSubmissionListener {
|
class ItemSearchCreateItemPane extends CMSContainer implements FormProcessListener, FormSubmissionListener {
|
||||||
|
|
||||||
private static final String CONTENT_TYPE_ID = "ct";
|
private static final String CONTENT_TYPE_ID = "ct";
|
||||||
|
private static final String FOLDER_ID = "folder_id";
|
||||||
private NewItemForm m_newItem;
|
private NewItemForm m_newItem;
|
||||||
private SingleSelectionModel m_typeSel;
|
private SingleSelectionModel m_typeSel;
|
||||||
private FlatFolderPicker m_folderPicker;
|
private FlatFolderPicker m_folderPicker;
|
||||||
private final BaseTree m_tree;
|
//private final BaseTree m_tree;
|
||||||
private final SingleSelectionModel m_model;
|
private final SingleSelectionModel m_model;
|
||||||
private final FolderSelectionModel m_folderSel; // To support legacy UI code
|
private final FolderSelectionModel m_folderSel; // To support legacy UI code
|
||||||
private final FolderRequestLocal m_folder;
|
private final FolderRequestLocal m_folder;
|
||||||
|
|
@ -62,10 +63,11 @@ class ItemSearchCreateItemPane extends CMSContainer implements FormProcessListen
|
||||||
m_newItemSeg = new Segment();
|
m_newItemSeg = new Segment();
|
||||||
|
|
||||||
m_newItem = new SectionNewItemForm("newItem");
|
m_newItem = new SectionNewItemForm("newItem");
|
||||||
m_newItem.addProcessListener(this);
|
//m_newItem.addProcessListener(this);
|
||||||
|
|
||||||
m_tree = new BaseTree(new FolderTreeModelBuilder());
|
//m_tree = new BaseTree(new FolderTreeModelBuilder());
|
||||||
m_model = m_tree.getSelectionModel();
|
//m_model = m_tree.getSelectionModel();
|
||||||
|
m_model = new ParameterSingleSelectionModel(new BigDecimalParameter(FOLDER_ID));
|
||||||
m_folderSel = new FolderSelectionModel(m_model);
|
m_folderSel = new FolderSelectionModel(m_model);
|
||||||
m_folder = new FolderRequestLocal(m_folderSel);
|
m_folder = new FolderRequestLocal(m_folderSel);
|
||||||
|
|
||||||
|
|
@ -111,24 +113,32 @@ class ItemSearchCreateItemPane extends CMSContainer implements FormProcessListen
|
||||||
}
|
}
|
||||||
|
|
||||||
public void submitted(final FormSectionEvent fse) {
|
public void submitted(final FormSectionEvent fse) {
|
||||||
|
final PageState state = fse.getPageState();
|
||||||
|
|
||||||
|
final BigDecimal typeID = m_newItem.getTypeID(state);
|
||||||
|
m_typeSel.setSelectedKey(state, typeID);
|
||||||
|
final BigDecimal folderId = (BigDecimal) m_folderPicker.getValue(state);
|
||||||
|
m_folderSel.setSelectedKey(state, folderId);
|
||||||
|
|
||||||
|
m_newItemSeg.setVisible(state, false);
|
||||||
|
m_creationSeg.setVisible(state, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void process(FormSectionEvent fse) throws FormProcessException {
|
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||||
final PageState state = fse.getPageState();
|
final PageState state = fse.getPageState();
|
||||||
final Object source = fse.getSource();
|
final Object source = fse.getSource();
|
||||||
//if (source == m_newItem) {
|
//if (source == m_newItem) {
|
||||||
final BigDecimal typeID = m_newItem.getTypeID(state);
|
final BigDecimal typeID = m_newItem.getTypeID(state);
|
||||||
m_typeSel.setSelectedKey(state, typeID);
|
m_typeSel.setSelectedKey(state, typeID);
|
||||||
final BigDecimal folderId = (BigDecimal) m_folderPicker.getValue(state);
|
final BigDecimal folderId = (BigDecimal) m_folderPicker.getValue(state);
|
||||||
m_folderSel.setSelectedKey(state, folderId);
|
m_folderSel.setSelectedKey(state, folderId);
|
||||||
|
|
||||||
//m_newItem.setVisible(state, false);
|
//m_newItem.setVisible(state, false);
|
||||||
//m_creator.setVisible(state, true);
|
//m_creator.setVisible(state, true);
|
||||||
//m_newItemSeg.setVisible(state, false);
|
m_newItemSeg.setVisible(state, false);
|
||||||
m_creationSeg.setVisible(state, true);
|
m_creationSeg.setVisible(state, true);
|
||||||
//parent.setTabActive(state, this, true);
|
//parent.setTabActive(state, this, true);
|
||||||
//newItemMode(state);
|
//newItemMode(state);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -141,6 +151,5 @@ class ItemSearchCreateItemPane extends CMSContainer implements FormProcessListen
|
||||||
public ContentSection getContentSection(PageState s) {
|
public ContentSection getContentSection(PageState s) {
|
||||||
return CMS.getContext().getContentSection();
|
return CMS.getContext().getContentSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,10 @@ public class ItemSearchPage extends CMSPage {
|
||||||
|
|
||||||
final String query = (String) state.getValue(new StringParameter(ItemSearchPopup.QUERY));
|
final String query = (String) state.getValue(new StringParameter(ItemSearchPopup.QUERY));
|
||||||
|
|
||||||
|
if (m_tabbedPane.getCurrentPane(state) == m_create) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ((query == null) || query.isEmpty()) {
|
if ((query == null) || query.isEmpty()) {
|
||||||
m_tabbedPane.setSelectedIndex(state, 1);
|
m_tabbedPane.setSelectedIndex(state, 1);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue