Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Grid Cell widget showing some background thingy

    Hello there,

    I am using SmartClient Version: v10.0p_2015-05-08/PowerEdition Deployment (built 2015-05-08) with FF26

    I am trying to display ImgButton in a listgrid but for some reason I see some weird thingy in between those two icons. I have attached a screenshot of it. Below is my code

    Code:
    orderList = new ListGrid()
    		{
    			@Override
    			protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum)
    			{
    				String fieldName = this.getFieldName(colNum);
    
    				if (fieldName.equals("sden"))
    				{
    					IButton button = new IButton();
    					button.setHeight(18);
    					button.setWidth(65);
    					button.setIcon("send16.png");
    					button.setTitle("");
    					button.setAlign(Alignment.CENTER);
    					button.addClickHandler(new ClickHandler()
    					{
    						public void onClick(ClickEvent event)
    						{
    							SC.say(record.getAttribute("productName") + " info button clicked.");
    						}
    					});
    					return button;
    				}
    				else if (fieldName.equals("port"))
    				{
    					HLayout recordCanvas = new HLayout(3);
    					recordCanvas.setHeight(22);
    					recordCanvas.setWidth100();
    					recordCanvas.setAlign(Alignment.CENTER);
    					ImgButton editImg = new ImgButton();
    					editImg.setShowDown(false);
    					editImg.setShowRollOver(false);
    					editImg.setLayoutAlign(Alignment.CENTER);
    					editImg.setSrc("export.png");
    					editImg.setPrompt("Export GTIN A");
    					editImg.setHeight(16);
    					editImg.setWidth(16);
    					editImg.addClickHandler(new ClickHandler()
    					{
    						public void onClick(ClickEvent event)
    						{
    							SC.say("Export GTIN A Icon Clicked");
    						}
    					});
    
    					ImgButton chartImg = new ImgButton();
    					chartImg.setShowDown(false);
    					chartImg.setShowRollOver(false);
    					chartImg.setAlign(Alignment.CENTER);
    					chartImg.setSrc("export1.png");
    					chartImg.setPrompt("Export GTIN B");
    					chartImg.setHeight(16);
    					chartImg.setWidth(16);
    					chartImg.addClickHandler(new ClickHandler()
    					{
    						public void onClick(ClickEvent event)
    						{
    							SC.say("Export GTIN B Icon Clicked");
    						}
    					});
    
    					recordCanvas.addMember(editImg);
    					recordCanvas.addMember(chartImg);
    					return recordCanvas;
    				}
    				else
    				{
    					return null;
    				}
    			}
    		};
    and my datasource file

    Code:
    <DataSource ID="newOrderDS" serverType="sql" tableName="rde">
    
     	<fields>
    		<field name="id" type="sequence" hidden="true" primaryKey="true" />
    
            
    		<field name="dfid" title="Dosage Form" type="integer" foreignKey="dosformDS.id" joinType="outer" displayField = "dosageformName" required="true">
    		</field>
    		<field name="dosageformName" includeFrom="dosformDS.name" hidden="true" />
    		
    		<field name="idp" title="Product" type="integer" foreignKey="productDS.id" joinType="outer" displayField = "productName" required="true">
    		</field>
    		<field name="productName" includeFrom="productDS.name" hidden="true" />
    		     
    		<field name="upck" title="GTIN A Order Quantity" type="integer" required="true" hidden="true"/>
    		<field name="puck" title="GTIN B Order Quantity" type="integer" required="true" hidden="true"/>
    		
    		<field name="thc" title="Batch Number" type="text" required="true"/>
    		
    		<field name="date1" title="Manufacturing Date" type="date" required="true"/>
    		
    		<field name="date2" title="Expiry Date" type="date" required="true"/>
    		
    		<field name="dip" title="Distributor" type="integer" foreignKey="distributorDS.id" joinType="outer" displayField = "distributorName" required="false">
    		</field>
    		<field name="distributorName" includeFrom="distributorDS.name" hidden="true" />
    		
    		<field name="sden" type="boolean" title="Send"/>
    		
    		<field name="port" type="boolean" title="Export"/>
    		
    	</fields>
    </DataSource>
    Attached Files

    #2
    Hi zaj,

    you'll need to use an artificial name for the ListGridField. "port" is part of your .ds.xml.:
    Code:
    <field name="port" type="[B]boolean[/B]" title="Export"/>
    As it is a boolean field, this is the normal checkbox.

    Best regards
    Blama

    Comment


      #3
      Hi Blama,

      Thanks for your feedback. What do you mean by artificial name for the listgridfield.

      Comment


        #4
        That you use a name that does not exist in your .ds.xml. Use it in the ListGridField-constructor call and in the createRecordComponent()-method as well. See this sample.

        Best regards
        Blama

        Comment


          #5
          Thanks,Blama!!

          Comment

          Working...
          X