Hi,

Try adding the following parameter to your Table component:

keyExpression="officeName"

Does it work?

(I guess it is high time to get the documentation checked in...)


Somu Chandra wrote:

Hello,
        I am using tapestry 4  beta-5 for my application. I have Checkboxes
in my contrib table which I am trying to update.
Upon submission of the form I do not see any of the checkboxes being
selected in my java  code.

I tried printing out the object ID's for the Offices. I noticed that
it  is the same before and after submission of the page.
Also I noticed the checkboxes are set to selected on a different set
of offices which I don't have control of.

Any help is appreciated.

.html
 <form jwcid="@Form">
   <div>
<table border="0" cellpadding="0" cellspacing="0" class="styledTable" jwcid="[EMAIL PROTECTED]:Table" source="ognl:offices" columns="selected,officeName,supervisor,parentOffice,facId,facName" rowsClass="ognl:beans.evenOdd.next"
                        pageSize="10"
                        initialSortColumn="officeName" >   
                        <span jwcid="[EMAIL PROTECTED]">
                                <input type="Checkbox" jwcid="@Checkbox"
value="ognl:components.table.tableRow.selected" />
                        </span>
                </table>  

   </div>
   <fieldset>
                <input name="Submit" type="submit" value="Remove Facility"
jwcid="@Submit" listener="ognl:listeners.onRemoveOffices"/>
   </fieldset>
 </form>


.page
<property name="offices" persist="session"></property>
<bean name="evenOdd" class="org.apache.tapestry.bean.EvenOdd"/>
.java

        public abstract void setOffices(List Offices);

        public abstract List getOffices();

        public void onRemoveOffices(IRequestCycle cycle) {
                List Offices = getOffices();
                Iterator OfficesIterator = Offices.iterator();

                while (OfficesIterator.hasNext()) {
                        Office office = (Office) OfficesIterator.next();
                        if (office.isSelected()) {
// Control does not come to this block Even if the Checboxes are selected       
                
                                office.setSelected(false);
                                OfficesIterator.remove();
                        }
                }
        }



Office.java
        private boolean selected ;

        public boolean isSelected() {
                return selected;
        }

        public void setSelected(boolean selected) {
// This gets printed for a different set of Offices
System.out.println("OfficeName --> "+ officeName +" Selected --> "+
selected + " Address -->"+ this);
                this.selected = selected;
        }






Thanks,
Somu Chandra

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to