This is most likely due to serialization of the enum in the session,

I use a workarround that does not affect the code too much,
and I can track references to the enum.

I persist a string variable, but always use enum.name()
to change the variable.

I use this to keep track of major blocks that are visible in a page or comp

 private enum Blocks{EDIT,DETAILS, EDIT_DANGER}

I persist the string
    @Persist            private String      _currentBlock = Blocks.EDIT.name
();
I return block:
    public Block getCurrentBlock(){
        return _resources.getBlock(_currentBlock);
    }

whne I change current block, I use the enum

    public void resetView() {
        _currentBlock = Blocks.DETAILS.name();
        _splitGoodId = null;
        _containerId = null;
    }

    public boolean onGoTo() {
        resetView();
        return true;
    }

    public boolean onGoToEditor() {
        _currentBlock = Blocks.EDIT.name();
        return true;
    }

this might be helpfull... and it is not too far from classic usage

Davor Hrg

On Tue, Mar 25, 2008 at 10:49 PM, Adam Zimowski <[EMAIL PROTECTED]>
wrote:

> If Page or Component defines Enum internally, Tapestry throws a
> ClassCastException the moment said page or component  class (or even
> the template) is "hot" reloaded due to any kind of change.
>
> Can this be fixed/change to allow inner Enums?
>
> -adam
> as of 5.0.11
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to