Rowtablearea2 Control Issues

Hi,

I have the issue with Rowtablearea2 Control. There is a ROWCOUNT & HIGHT attributes which according to the documentation

If a HEIGHT value is defined an addition (e.g. as percentage value
“100%”) then the number of rows depends on the actual height of
the control. The ROWCOUNT value in this case indicates the
maximum number of rows that is picked from the server.

The ROWCOUNT is 12 and normally it has only 3-5 values. I specified HIGHT in pixels and it just doesn’t work. It makes no difference whatsoever what value in pixels I put from 20 to 500.

Is it something of my wrong doing or it is simply a bug?

Could you add your XML layout definition?
No bugs known for this area on our side.

Thanks! Bjoern

Don’t know why I can’t upload the file. The error I got is - “Upload Error: Could not upload Attachment to ./files/au.com.nissan.fbt_v2_503.xml.”

Here is XML anyway. There is only one rowtablearea2:

<?xml version="1.0" encoding="UTF-8"?>

…well, I have to admit that you are right. I am not yet aware of what it has to do with the problem, but…: if you set the width of the ROWTABLEAREA2 to 100% instaed of 725 then it works.

Is this an option to survive…?

Bjoern

Yes and no really. Originally I wanted to change the height to show only 6 rows out of 12 and assumed the scrolling will be automatically enabled. I’ve just tested it and it isn’t the case. Once the WIDTH set to “100%” the HEIGHT parameter does take effect, however the scrolling doesn’t work. The VSCROLL set to “scroll”. It appears from the documentation that if the ROWCOUNT is bigger than what fits on the screen due to HEIGHT the scroll bar should be at least available. I am unclear if there is a need to implement a listener or not for this control. It doesn’t look that way. May be I am interpreting the documentation incorrectly.

P.S. Hope the bug is logged appropriately, or is it better to open a support call?

Hi,

first: if you want to show 6 rows then specify ROWCOUNT=“6” - and do NOT specify a height in addition. The control will take the space it requires.

(The additional specification of the height typically is done in “percentage scenarios”: the ROWTABLEAREA2 should occupy “100% of available height”. But also works with pixel heights…)

Even in the scenario that you mention the vertical scrollbar should appear - without any registration of listeners etc.

Bug-logging: I recommend to write bug report in parallel - this is the only guaranteed, follow-up-able way for you! Never trust development minded people… :wink:

Bjoern

Ok, I’ve tried this way before, and the only reason I went into specifying the height was that it didn’t work. I specified the ROWCOUNT=2. The scroll bar appears when there is more then 2 items in the collection, however it doesn’t scroll through the elements. :frowning:

Hi,

I just tested your layout with the following program: when pressig the “Get my vehicles” button then 100 items are loaded - scrollbar is displayed automatically + scrolling works fine.

Bjoern

BTW: HSCROLL=“true” in the ROWTABLEAREA2 controls allows you to horizontally scroll the grid once the content of the grid exceeds the available width.

import java.util.;
import com.softwareag.cis.server.
;
import com.softwareag.cis.server.util.;
import com.softwareag.cis.util.
;

public class AaaaaaAdapter
extends Adapter
{
String m_email;
public String getEmail() { return m_email; }
public void setEmail(String value) { m_email = value; }

String m_emailStatusProp;
public String getEmailStatusProp() { return m_emailStatusProp; }
public void setEmailStatusProp(String value) { m_emailStatusProp = value; }

int m_employeeNumber;
public int getEmployeeNumber() { return m_employeeNumber; }
public void setEmployeeNumber(int value) { m_employeeNumber = value; }

String m_employeeNumberStatusProp;
public String getEmployeeNumberStatusProp() { return m_employeeNumberStatusProp; }
public void setEmployeeNumberStatusProp(String value) { m_employeeNumberStatusProp = value; }

String m_periodDetails;
public String getPeriodDetails() { return m_periodDetails; }
public void setPeriodDetails(String value) { m_periodDetails = value; }

public class VehiclesItem
{
    String m_chassis;
    public String getChassis() { return m_chassis; }
    public void setChassis(String value) { m_chassis = value; }

    String m_kmStatusProp;
    public String getKmStatusProp() { return m_kmStatusProp; }
    public void setKmStatusProp(String value) { m_kmStatusProp = value; }

    long m_km_reading;
    public long getKm_reading() { return m_km_reading; }
    public void setKm_reading(long value) { m_km_reading = value; }

    String m_model;
    public String getModel() { return m_model; }
    public void setModel(String value) { m_model = value; }

    float m_private_use;
    public float getPrivate_use() { return m_private_use; }
    public void setPrivate_use(float value) { m_private_use = value; }

    float m_receipts_other;
    public float getReceipts_other() { return m_receipts_other; }
    public void setReceipts_other(float value) { m_receipts_other = value; }

    float m_receipts_petrol;
    public float getReceipts_petrol() { return m_receipts_petrol; }
    public void setReceipts_petrol(float value) { m_receipts_petrol = value; }

    String m_regoNo;
    public String getRegoNo() { return m_regoNo; }
    public void setRegoNo(String value) { m_regoNo = value; }

    boolean m_selectedVehicle;
    public boolean getSelectedVehicle() { return m_selectedVehicle; }
    public void setSelectedVehicle(boolean value) { m_selectedVehicle = value; }

    String m_suo;
    public String getSuo() { return m_suo; }
    public void setSuo(String value) { m_suo = value; }

    String m_usage;
    public String getUsage() { return m_usage; }
    public void setUsage(String value) { m_usage = value; }
}

GRIDCollection m_vehicles = new GRIDCollection();
public GRIDCollection getVehicles() { return m_vehicles; }

public void onSaveChanges()
{
}

public void onShowMyVehicles()
{
    for (int i=0; i<100; i++)
    {
        VehiclesItem vi = new VehiclesItem();
        vi.setChassis("Chassis " + i);
        vi.setModel("Model " +i);
        m_vehicles.add(vi);
    }
}

}

Yes, you’re right! It works now, it was a bug in my adapter :oops:

Your assistance is much appreciated. THANK YOU Bjoern !

Hi,

having the same problems as Mikhail, but additionally nothing is displayed when even the width is set to 100% (rowcount = 20; height = 100%). → As soon as the height is set to a percentage value nothing shows up (taking away the height or setting it to a fixed pixel value, everything is fine) !!!

Here is the XML:

<?xml version="1.0" encoding="UTF-8"?>

Please let me know if there is something off, or if it is a bug.

Thanks,

Rob.

Sizing with percentages means you always have to think about where the percentage definition refers to. In other words: the parent controls have to provide the space so that the contained controls (which says 100%) knows what the 100% refers to.

In your case you need to tell the pagebody to occupy the full heigh (attribute takefullheigh=true), afterwards the grid should appear.

Additional comment: it’s the same as with plain HTML:

hhhhh

If the table is not set to a height of 100% itself the height of the cell will be following its content. 100% from 0 is 0 :wink:

Bjoern

PS: do not misunderstand me - this is a quite tough issue… the golden rule is: if you see nothing but expect to see 100% ==> follow the control-hierarchy from the bottom to the top (pagebody). In 2.2 we will introduce an automated way of setting the heights in the control hierarchy… (planned for Nov/Dec 2006)

Hi,

got it and makes sense, sort of similar to certain layout manager of Java in respect of the get/setPrefferedSize(…) method, it also depends on the hierarchy.

Thanks,

Rob.