[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Feature Request: Dropdown with Auto-Complete / Search Functionality  XML
Forum Index -> Development
Author Message
mreich

Power User
[Avatar]

Joined: 30/01/2009 08:34:23
Messages: 750
Offline

Hi,

would it make sense to integrate such a functionality by standard?

A picture (or two) tells more than words

Markus
 Filename Dropdown_1.PNG [Disk] Download
 Description
 Filesize 14 Kbytes
 Downloaded:  391 time(s)

 Filename Dropdown_2.PNG [Disk] Download
 Description
 Filesize 5 Kbytes
 Downloaded:  369 time(s)

[WWW]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5555
Offline

Hmm, I am a bit sceptical about making this a standard control... every time we provide "composite components" then each user has his/her specific requirements. Life is tough...

It is quite simple (...) to implement such a component with exsiting components:
(.) Button
(.) modeless popup, no decoration, close on click outside
(.) field with flush and flushtimer
(.) grid

Björn


Code:
 
 Base Screen:
 <%@page contentType="text/html"%>
 <%@page pageEncoding="UTF-8"%>
 
 <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
 <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
 
 <%@taglib prefix="demo" uri="/WEB-INF/democontrols"%>
 <%@taglib prefix="t" uri="/WEB-INF/eclnt"%>
 
 
 <!-- ========== CONTENT BEGIN ========== -->
 <f:view>
 	<h:form>
 		<f:subview id="workplace_demopopupundecoratedg_sv">
 			<t:rowheader id="g_1">
 				<t:coldistance id="g_2" width="100%" />
 				<t:button id="g_3"
 					actionListener="#{wp.DemoPopupUndecorated.onOpenSearch}"
 					contentareafilled="false" horizontaltextposition="left"
 					image="/images/icons/magnifier.png" text="Search..." />
 				<t:coldistance id="g_4" width="200" />
 			</t:rowheader>
 			<t:rowbodypane id="g_5">
 				<t:row id="g_6">
 					<t:label id="g_7"
 						text="Some content... (the interesting part is the button inside the header...)" />
 				</t:row>
 			</t:rowbodypane>
 			<t:pageaddons id="g_pa" />
 		</f:subview>
 	</h:form>
 </f:view>
 <!-- ========== CONTENT END ========== -->
 
 
 Code:
 package workplace;
 
 import java.io.Serializable;
 
 import javax.faces.event.ActionEvent;
 
 import org.eclnt.editor.annotations.CCGenClass;
 import org.eclnt.jsfserver.defaultscreens.ModelessPopup;
 import org.eclnt.jsfserver.elements.util.DefaultModelessPopupListener;
 import org.eclnt.workplace.IWorkpageDispatcher;
 
 @CCGenClass (expressionBase="#{wp.DemoPopupUndecorated}")
 
 public class DemoPopupUndecorated
     extends DemoBase
     implements Serializable
 {
     
     public DemoPopupUndecorated(IWorkpageDispatcher dispatcher)
     {
         super(dispatcher);
     }
 
     public void onOpenSearch(ActionEvent event) 
     {
         ModelessPopup popup = getOwningDispatcher().createModelessPopup();
         popup.open("/workplace/demopopupundecoratedsearch.jsp","Search",250,300,new DefaultModelessPopupListener(popup));
         popup.setUndecorated(true);
         popup.setCloseonclickoutside(true);
     }
 }
 
 
 Popup for search:
 <%@page contentType="text/html"%>
 <%@page pageEncoding="UTF-8"%>
 
 <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
 <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
 
 <%@taglib prefix="demo" uri="/WEB-INF/democontrols"%>
 <%@taglib prefix="t" uri="/WEB-INF/eclnt"%>
 
 
 <!-- ========== CONTENT BEGIN ========== -->
 <f:view>
 	<h:form>
 		<f:subview id="workplace_demopopupundecoratedsearchg_sv">
 			<t:rowbodypane id="g_1" padding="0">
 				<t:row id="g_2">
 					<t:pane id="g_3" border="#00000030" height="100%" padding="20"
 						width="100%">
 						<t:row id="g_4">
 							<t:field id="g_5"
 								actionListener="#{wp.DemoPopupUndecoratedSearch.onSearch}"
 								bgpaint="image(100%-5,50%,/images/icons/magnifier.png,rightmiddle)"
 								flush="true" flushtimer="1000"
 								text="#{wp.DemoPopupUndecoratedSearch.searchText}" width="100%" />
 						</t:row>
 						<t:rowdistance id="g_6" height="20" />
 						<t:row id="g_7">
 							<t:fixgrid id="g_8" avoidroundtrips="true" background="#ffffff40"
 								bordercolor="#00000010" borderheight="1" borderwidth="1"
 								drawoddevenrows="true" height="100%"
 								objectbinding="#{wp.DemoPopupUndecoratedSearch.grid}"
 								rowheight="18" sbvisibleamount="30" suppressheadline="true"
 								width="100%">
 								<t:gridcol id="g_9" text="Column" width="100%">
 									<t:label id="g_10" text=".{text}" />
 								</t:gridcol>
 							</t:fixgrid>
 						</t:row>
 					</t:pane>
 				</t:row>
 			</t:rowbodypane>
 			<t:pageaddons id="g_pa" />
 		</f:subview>
 	</h:form>
 </f:view>
 <!-- ========== CONTENT END ========== -->
 
 
 Code:
 package workplace;
 
 import java.io.Serializable;
 import java.util.Random;
 
 import javax.faces.event.ActionEvent;
 
 import org.eclnt.editor.annotations.CCGenClass;
 import org.eclnt.jsfserver.elements.impl.FIXGRIDItem;
 import org.eclnt.jsfserver.elements.impl.FIXGRIDListBinding;
 
 @CCGenClass (expressionBase="#{wp.DemoPopupUndecoratedSearch}")
 
 public class DemoPopupUndecoratedSearch implements Serializable
 {
 
     public class GridItem extends FIXGRIDItem implements java.io.Serializable
     {
         protected String m_text;
         public String getText() { return m_text; }
         public void setText(String value) { m_text = value; }
         
     }
     
     protected FIXGRIDListBinding<GridItem> m_grid = new FIXGRIDListBinding<GridItem>();
     protected String m_searchText = "";
 
     public String getSearchText() { return m_searchText; }
     public void setSearchText(String value) { m_searchText = value; }
     
     public FIXGRIDListBinding<GridItem> getGrid() { return m_grid; }
 
     public void onSearch(ActionEvent event) 
     {
         // dummy search
         m_grid.getItems().clear();
         int maxi = (new Random()).nextInt(20) + 2;
         for (int i=0; i<maxi; i++)
         {
             GridItem gi = new GridItem();
             gi.setText(m_searchText + " " + i);
             m_grid.getItems().add(gi);
         }
     }
 
 }
 
 
 
 
[Thumb - undecoratedpopup.png]
 Filename undecoratedpopup.png [Disk] Download
 Description
 Filesize 7 Kbytes
 Downloaded:  402 time(s)


Björn Müller, CaptainCasa GmbH
mreich

Power User
[Avatar]

Joined: 30/01/2009 08:34:23
Messages: 750
Offline

Hi Björn,

thanx for your detailed answer

Markus
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team