Return-Path: Delivered-To: apmail-incubator-beehive-user-archive@www.apache.org Received: (qmail 42716 invoked from network); 13 Jun 2005 21:48:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jun 2005 21:48:48 -0000 Received: (qmail 12833 invoked by uid 500); 13 Jun 2005 21:48:47 -0000 Delivered-To: apmail-incubator-beehive-user-archive@incubator.apache.org Received: (qmail 12811 invoked by uid 500); 13 Jun 2005 21:48:46 -0000 Mailing-List: contact beehive-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Beehive Users" Delivered-To: mailing list beehive-user@incubator.apache.org Received: (qmail 12792 invoked by uid 99); 13 Jun 2005 21:48:46 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from 60-240-202-161.tpgi.com.au (HELO main.adamjenkins.net) (60.240.202.161) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 13 Jun 2005 14:48:42 -0700 Received: from localhost ([127.0.0.1]) by main.adamjenkins.net (JAMES SMTP Server 2.2.0) with SMTP ID 8; Tue, 14 Jun 2005 07:44:54 +1000 (EST) Subject: Re: treeItem remembering expanded state? From: Adam Jenkins Reply-To: mail@adamjenkins.net To: Carlin Rogers Cc: Beehive Users In-Reply-To: References: <1118533520.10781.2.camel@main.adamjenkins.net> <1118534235.10781.10.camel@main.adamjenkins.net> <1118534893.10781.16.camel@main.adamjenkins.net> <1118535004.10781.18.camel@main.adamjenkins.net> Content-Type: text/plain Date: Tue, 14 Jun 2005 07:44:53 +1000 Message-Id: <1118699093.20867.32.camel@main.adamjenkins.net> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Carlin, Yes, there is a different Controller.java for the admin directory. I have included relevant code snippets below. Everything works fine (e.g. the submitting of the form and expanding of the tree). The only problem is when I click back on 'home' the tree collapses and when I successfully submit the change password form the tree collapses. The code doesn't really do anything at the moment (just returns "success"). If you can't figure it out from the snippets below, let me know and I'll package up a working snapshot. Thanks for you help. Cheers Adam -------------Tiles Definitions-------------------- ------------End Tiles Definitions-------------------- -----------Menu.jsp--------------------- <%@ page language="java" contentType="text/html;charset=UTF-8"%> <%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%> <%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%> <%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
${bundle.app.homeCommandLabel} ${bundle.app.adminCommandGroupLabel} ${bundle.app.changePasswordCommandLabel} -----------Menu.jsp--------------------- ----------Main Controller.java declarations------------ @Jpf.Controller( tilesDefinitionsConfigs = { "/WEB-INF/tiles-defs.xml" }, simpleActions={ @Jpf.SimpleAction(name="home", tilesDefinition="default"), @Jpf.SimpleAction(name="changePassword", tilesDefinition="changePassword") }, catches={ @Jpf.Catch(type=ApplicationDeploymentException.class, path="deploymentError.jsp") }, messageBundles={ @Jpf.MessageBundle(bundlePath="com.infocomp.certificateserver.i18n.application") }, multipartHandler=Jpf.MultipartHandler.memory, customValidatorConfigs={ "/WEB-INF/validator-rules-custom.xml" } ) ---------End Main Controller.java declarations------------ ------/admin/changepassword/Controller.java--------------- package admin.changepassword; import org.apache.beehive.netui.pageflow.Forward; import org.apache.beehive.netui.pageflow.PageFlowController; import org.apache.beehive.netui.pageflow.annotations.Jpf; import org.apache.beehive.netui.pageflow.FormData; @Jpf.Controller( tilesDefinitionsConfigs = { "/WEB-INF/tiles-defs.xml" }, simpleActions={ @Jpf.SimpleAction(name="begin", path="main.jsp") }, messageBundles={ @Jpf.MessageBundle(bundlePath="com.infocomp.certificateserver.i18n.application") } ) public class Controller extends PageFlowController { @Jpf.Action( forwards={ @Jpf.Forward(name="success", tilesDefinition="passwordChanged") }, validationErrorForward=@Jpf.Forward(name="fail", tilesDefinition="changePassword") ) public Forward processPasswordChange(PasswordChangeForm form) { return new Forward("success"); } //-----------BEGIN INNER CLASSES---------------// public static final class PasswordChangeForm extends FormData implements java.io.Serializable{ private String oldPassword; private String newPassword; private String confirmPassword; @Jpf.ValidatableProperty( displayNameKey="error.passwordlength", validateRequired=@Jpf.ValidateRequired(), validateMinLength=@Jpf.ValidateMinLength(chars=3, messageKey="new.password.tooShort") ) public String getNewPassword() { return newPassword; } public void setNewPassword(String newPassword) { this.newPassword = newPassword; } @Jpf.ValidatableProperty( displayNameKey="error.passwordmismatch", validateRequired=@Jpf.ValidateRequired(), validateValidWhen=@Jpf.ValidateValidWhen( condition="${actionForm.confirmPassword == actionForm.oldPassword}", messageKey="passwords.mismatch" ) ) public String getConfirmPassword() { return confirmPassword; } public void setConfirmPassword(String confirmPassword) { this.confirmPassword = confirmPassword; } public String getOldPassword() { return oldPassword; } public void setOldPassword(String oldPassword) { this.oldPassword = oldPassword; } } //----------- END INNER CLASSES---------------// } -----end /admin/changepassword/Controller.java--------------- On Mon, 2005-06-13 at 14:32 -0600, Carlin Rogers wrote: > Adam, > > I have been unable to reproduce the issue but I just have a simple > example based on details below. > > Is there a different page flow controller that handles the admin actions > in /admin? For example, once you're at the changePassword tile > definition, is there a form that submits a form bean to a different > Controller action and then on success you end up at the > "passwordChanged" tile. > > My example is within a single page flow Controller and seems to > work, keeping the menu tree expanded. > > Let me know if you've managed to resolve this issue or can narrow > down the problem a little more. Thanks! > > Carlin > > On 6/11/05, Adam Jenkins wrote: > > FYI...it also collapses when executing the "passwordChanged" tile. > > > > On Sun, 2005-06-12 at 10:08 +1000, Adam Jenkins wrote: > > > Nope, it's even when I redirect back from the tree handling method :( > > > > > > Does anyone know why, when I click the change-password treeItem it > > > redirects to the appropriate tile, and maintains the tree expanded state > > > ("admin" node stays expanded), but when I click on "home" it > > > successfully executes the 'default' tile, but collapses the tree? Does > > > anyone know a way around this? > > > > > > Code is below. > > > > > > Cheers > > > Adam > > > > > > > > > My tree code is: > > > > > > > > > > > > > > dataSource="pageFlow.menuRoot" > > > selectionAction="selectTreeElement" > > > runAtClient="true" > > > tagId="menuTree"> > > > > > > > > > ${bundle.app.homeCommandLabel} > > > > > disabled="true"> > > > > > > ${bundle.app.adminCommandGroupLabel} > > > > > title="change-password">${bundle.app.changePasswordCommandLabel} > > > > > > > > > > > > > > > > > > > > > > > > > > > My handler method is: > > > > > > @Jpf.Action( > > > forwards={ > > > @Jpf.Forward(name="success", tilesDefinition="default"), > > > @Jpf.Forward(name="0", tilesDefinition="default"), > > > @Jpf.Forward(name="0.0.0", tilesDefinition="changePassword") > > > } > > > ) > > > protected Forward selectTreeElement(){ > > > return new > > > Forward(getRequest().getParameter(TreeElement.SELECTED_NODE)); > > > } > > > > > > > > > > > > > > > Tiles definitions are: > > > > > > > > > > > > > > "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" > > > "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > value="/admin/changepassword/passwordChanged.jsp"/> > > > > > > > > > > > > > > > > > > On Sun, 2005-06-12 at 09:57 +1000, Adam Jenkins wrote: > > > > Clarification: > > > > > > > > I believe the menu only resets when I use the action attribute on > > > > treeItem, so I think this is probably a knowledge shortfall on my part. > > > > > > > > I'll keep pluggin away at it. > > > > > > > > Cheers > > > > Adam > > > > > > > > On Sun, 2005-06-12 at 09:45 +1000, Adam Jenkins wrote: > > > > > Hi All, > > > > > > > > > > I have a tree on one of my tiles and it all works great except for one > > > > > minor issue. Whenever I navigate to a new tile, the tree returns to > > > > > it's original expanded state. > > > > > > > > > > Is there anyway to make tree items remember their expanded state between > > > > > refreshes? > > > > > > > > > > Cheers > > > > > Adam > > > > > > > > > > > > > > > >