001    // Copyright 2004, 2005 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    //     http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.tapestry.junit.mock.c31;
016    
017    import org.apache.tapestry.IRequestCycle;
018    import org.apache.tapestry.html.BasePage;
019    
020    /**
021     * Tests for the Hidden component.
022     * 
023     * @author Tsvetelin Saykov
024     * @since 3.0
025     */
026    
027    public abstract class Home extends BasePage
028    {
029        public abstract String getValue();
030    
031        public abstract void setValue(String value);
032    
033        public abstract String getHiddenID();
034    
035        public abstract void setHiddenID(String hiddenID);
036    
037        public abstract String getValueWithID();
038    
039        public abstract void setValueWithID(String valueWithID);
040    
041        public abstract String getValueWithEncoding();
042    
043        public abstract void setValueWithEncoding(String valueWithID);
044    
045        public abstract Boolean getBooleanValue();
046    
047        public abstract void setBooleanValue(Boolean value);
048    
049        protected void finishLoad()
050        {
051            setValue("1234567890");
052            setHiddenID("0987654321");
053            setValueWithID("1234567890-with id");
054            setValueWithEncoding("1234567890-with encoding");
055            setBooleanValue(Boolean.FALSE);
056        }
057    
058        public void formSubmit(IRequestCycle cycle)
059        {
060            Two page = (Two) cycle.getPage("Two");
061    
062            page.setValue(getValue());
063            page.setHiddenID(getHiddenID());
064            page.setValueWithEncoding(getValueWithEncoding());
065    
066            cycle.activate(page);
067        }
068    
069        public void hiddenListener(IRequestCycle cycle)
070        {
071            //just a test for listener
072        }
073    
074        public boolean getEncode()
075        {
076            return false;
077        }
078    }