>
> Your encoder shouldn't depend on a pre-fetched list. Just fetch the encoded
> object in your encoder.


... my encoder implements this method:

        public T toValue(String clientValue)

So in my case, the encoder needs data from the database. I've spent cpu
cycles in getModel() to pull a list of items. It seems like I should
leverage that list when I hydrate the object back from it's screen
representation to an actual object ... no?

I guess - I could inject a dao or connection to the database into the
ValueEncoder - but on first glance, that seems like overkill ... but - maybe
I just need to get comfortable with it. Iv'e got the list right there. It
can't have changed eh?

To sum up, the main issue here is that the object I'm 'toValue'ing exists in
the dbase (and in the model). The Wiki example for GenericSelectModel
queries the database two times but I think it is redundant to do so.

But again, if thats what the framework wants me to do - I'll work with it. I
just needed to explore every option here to make sure I wasn't missing some
BlockEdit event ... it seems natural when components and pages have events
eh? But as natrual as I might intuit it, I do realize from your conversation
that Blocks just aren't made or implemented that way.




>
>
>  On that note, pageAttached is currently firing in my EditBlock.java class.
>>
>
> It is expected. Your page is activated when BeanEditForm gets a component
> from it.
>


My confusion here stems from my understanding that the edit block is NOT a
page and you' ve mentioned a few times "Your page is activatated ... and the
event fires." I understand that event fires - but shouldn't it be handled by
the PAGE and not the Edit Block?

When a page includes a component - does the component suddenly handle that
page's events? Likewise, I'm confused how the edit block (which is not a
page or a component) is getting the pageAttached event. I understand it is a
page event - I just don't understand why the Edit Block is handling it. Does
it fire in the Page.java as well? Is there a diagram or somethign to see
this?



> BlockEdit is a page that is not used as a regular page. Regular pages are
> requested though HTTP. BlockEdit is used just to declare blocks.
>
> Again: stop understanding lifecycle events in BlockEdit for a while and try
> to learn them on regular pages and components.
>

Remember here, my goal right now is not to understand events per se but to
get my custom select drop down working ... and it is indeed getting "void
pageAttached" -- so that is why I must proceed down understanding lifecycle
events for BlockEdit.

Learning about events for pages and components is fine - but I need to know
exactly how that applies to my current issue with the Edit Block. That is
what I am practicing :)

Thanks again,

-Luther

Reply via email to