1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    4
    Vote Rating
    0
    sbeex is on a distinguished road

      0  

    Default Unanswered: ListField how does it works ?

    Unanswered: ListField how does it works ?


    Hello,

    I'm trying to use a ListField for my application :
    ListField.png
    Based on documentation provided there :
    http://docs.sencha.com/gxt-guides/3/...on/Fields.html

    I did it :

    View.java :
    Code:
        @UiField(provided = true)
        ListStore<Application> listStore = new ListStore<Application>(properties.abbr());	
    	
    	@UiField(provided = true)
    	ListField<Application, String>	applicationList;
    	
        private static ApplicationProperties properties = GWT.create(ApplicationProperties.class);
    	  
        interface ApplicationProperties extends PropertyAccess<Application> {
        	
          ModelKeyProvider<Application> abbr();
          
          LabelProvider<Application> name();
          
          @Path("name")
          ValueProvider<Application, String> nameProp();
          
        }	
    	
    	public interface Binder extends UiBinder<Widget, OpenApplicationDialogView> {}
    
    
    	@Inject
    	public OpenApplicationDialogView(final EventBus eventBus, final Binder binder) {
    		super(eventBus);
    		widget = binder.createAndBindUi(this);
    		
    		openButton.setEnabled(false);
    		
    		Application testApp = new Application();
    		testApp.setName("Test APP");
    		testApp.setDescription("App description");
    			
    		  listStore.add(testApp);
    			
    	      ListView<Application, String> listView = new ListView<Application, String>(listStore, properties.nameProp()); 
    	      applicationList = new ListField<Application, String>(listView);			
    		
    	}
    View.ui.xml :
    Code:
      <ui:with type="com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData" field="verticalLayoutData">
        <ui:attributes width="1" height="-1" />
      </ui:with>
      
      <ui:with type="com.sencha.gxt.data.shared.ListStore" field="listStore" />
    
    
    	<gxt:Window ui:field="dialog" buttonAlign="END" resizable="false" modal="true" blinkModal="true" autoHide="false" headingText="Open" minHeight="231" minWidth="256">
    	    
    			
    			<form:ListField ui:field="applicationList"/>    
    	    
    	</gxt:Window>
    When I run my code I get the following error :
    com.google.gwt.event.shared.UmbrellaException: Exception caught: UiField applicationList with 'provided = true' was null
    Do you have some ideas what's wrong with it ? If you have a working code for it with uibinder I'll be interested

    Thank you for your reading

  2. #2
    Sencha User
    Join Date
    May 2013
    Posts
    6
    Vote Rating
    0
    bessette is on a distinguished road

      0  

    Default


    Here's mine. I have it populating but I only can select one item at a time. If you fix that issue can you post it?

    uibinder snippet

    Code:
    <gxt:Window ui:field="window" bodyBorder="true" focusWidget="{closeButton}" minHeight="200" modal="true" onEsc="false" pixelSize="275, 200" resizable="false" headingText="OGP WPS">
            <gxt:ContentPanel headerVisible="false">
                <c:HBoxLayoutContainer enableOverflow="false" hBoxLayoutAlign="BOTTOM">
                    <c:child layoutData="{leftLayoutData}">
                        <f:FieldLabel labelAlign="TOP" text="Name">
                            <f:widget>
                                <f:ListField ui:field="wpsListField" allowTextSelection="false" pixelSize="150, 120" title="Double click name to see description"/>
                            </f:widget>
                        </f:FieldLabel>
                    </c:child> 
    
    ..............

    class snippets


    Code:
    interface WpsExecuteDataProperties extends PropertyAccess<WpsExecuteData> {
            ModelKeyProvider<WpsExecuteData> id();
            @Path("name")
            LabelProvider<WpsExecuteData> nameLabel();
            @Path("name")
            ValueProvider<WpsExecuteData, String> nameProp();
          }
    
    .....
    
    @UiField Window window;
     @UiField(provided = true) final ListField<WpsExecuteData, String> wpsListField;
    
    ....
     /**
         * 
         */
        WpsExecuteDataProperties data = GWT.create(WpsExecuteDataProperties.class);
      
       private final ListStore<WpsExecuteData> wpsStore;
       private List<WpsExecuteData> wps;
       private ListView<WpsExecuteData, String> view;
        /**
         * Creates a new {@code OpenDialogBox}.
         * @param catalogService the catalog service proxy
         * @param parent the parent {@code PST}
         * @param userid the user id
         * @param wps the list of network wps
         * @param placeFactory factory for generating new UI components
         */
        public OpenDialogBox(OgpBuilder parent) {
            this.parent = parent;
            this.wpsStore = new ListStore<WpsExecuteData>(this.data.id());
            this.view =  new ListView<WpsExecuteData, String>(this.wpsStore, this.data.nameProp());      
            this.wpsListField = new ListField<WpsExecuteData, String>(this.view);
            lookupAllNames();  //populates wpsStore
           this.view.getSelectionModel().setSelectionMode(SelectionMode.SIMPLE);
            uiBinder.createAndBindUi(this);

  3. #3
    Sencha User
    Join Date
    May 2013
    Posts
    4
    Vote Rating
    0
    sbeex is on a distinguished road

      0  

    Default Wow

    Wow


    Thank you very much ! It works like a chief now

    I tried to enable multi selection and graphically it is working for me. Where is your problem ? Maybe I can try to investigate a bit on it

  4. #4
    Sencha User
    Join Date
    May 2013
    Posts
    6
    Vote Rating
    0
    bessette is on a distinguished road

      0  

    Default


    Hi! Glad I could help.

    I also got it to work. I had to take out the Single Selection property.


    Code snippet....

    Code:
    @Inject
        public OpenDialogBox(OgpBuilder parent) {
            this.parent = parent;
            this.wpsStore = new ListStore<WpsExecuteData>(this.data.id());
            this.view =  new ListView<WpsExecuteData, String>(this.wpsStore, this.data.nameProp());      
            this.wpsListField = new ListField<WpsExecuteData, String>(this.view);
            lookupAllNames();  //populates wpsStore
            RootPanel.get().add(asWidget());
            this.wpsListField.focus();
            this.wpsListField.setEnabled(true);
            this.openButton.setEnabled(false);
            this.removeButton.setEnabled(false);

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar