Maybe L (which contains F) just needs to use:
@Persist("cookie")
private String filterValue
Downsides might be it's not bookmarkable, and the client-side state persists
beyond the page.
On 26/03/2014, at 11:47 AM, Geoff Callender wrote:
> Sorry, but I've read the solution below 10 times now and it hurts my head
> every time! :-) I don't see how it gets around the problem that when E is
> AJAX-submitted, the server-side elements can find ways to prod L to refresh
> but they cannot tell L the current value of F. The server-side doesn't know
> the current value of F, unless we make the server-side stateful (no thank
> you), or we somehow include the value of F in every request.
>
> What I'm aiming for is a solution which works declaratively. You know, where
> you don't see the plumbing. Just like @ActivationRequestParameter, but at the
> component level.
>
> On 21/03/2014, at 2:35 AM, Lance Java wrote:
>
>> I'm imagining the pub sub would work like...
>>
>> public class L {
>> @Inject
>> private Publisher publisher;
>>
>> @Inject
>> private Block someBlock;
>>
>> /**
>> * Fired when the select menu changes
>> */
>> public Object onFilterChange(Entity entity) {
>> publisher.publish("changeEntity", entity);
>> return someBlock;
>> }
>> }
>>
>> public class E {
>> @Inject
>> private AjaxResponseRenderer ajaxResponseRenderer;
>>
>> @Inject
>> private Zone someZone;
>>
>> @Property
>> private Entity entity;
>>
>> @Subscribe(topic="changeEntity")
>> void subscribeChangeEntity(Entity entity) {
>> this.entity = entity;
>> ajaxResponseRenderer.addRender(someZone;
>> }
>> }
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]