On Mon, Jun 20, 2011 at 9:59 AM, Igor Vaynberg <igor.vaynb...@gmail.com> wrote:
> components are rendered in the same order they are in markup. how does
> your component know now if the table is empty or not?
>

Igor,
It does not. The way it works is that if the table detects thespecial
data during rendering (onBeforeRender) , it informs the page about it
(by calling a page method).
Any component, either table or other, that detects that data informs
the page about it.
Then the page renders the header component, using the data it received
from the rest of the components of the page).
That is why I need to change the rendering order, because the
rendering of that header component depends on the presence of that
special data in the page (which could be in the table)
-Nelson

> -igor
>
> On Mon, Jun 20, 2011 at 9:37 AM, Nelson Segura <nsegu...@gmail.com> wrote:
>> On Thu, Jun 16, 2011 at 10:23 PM, Igor Vaynberg <igor.vaynb...@gmail.com> 
>> wrote:
>>> give your component the dataprovider that the datatable has and use
>>> that to calc visibility.
>>>
>>> -igor
>>
>> This does not work for me because:
>>
>> a) my pages might have multiple providers, and each one of them might
>> change the state of the header component, depending on data on the
>> list
>> b) my header does not know what lists are on the page,  as it is
>> shared between different pages. I might be none, one, or multiple.
>> c) providers are not the only elements that can cause the header
>> component to change.
>>
>> It seems to me that I need to force the component to be rendered last,
>> after all the providers/tables have had a change to analyze its data.
>>
>> I have worked around this by adding the header component after the
>> page onBeforeRender(), and then calling the components
>> onBeforeRender(), like this
>>
>> BasePage.java
>>
>> public void onBeforeRender() {
>>  super.onBeforeRender();
>>  addOrReplace(new MyComponent());
>>  component.onBeforeRender()
>> }
>>
>> It is not pretty, but I dont know other way to force a change in the
>> rendering sequence of the components.
>>
>> -Nelson
>>
>>
>>>
>>> On Thu, Jun 16, 2011 at 9:22 PM, Nelson Segura <nsegu...@gmail.com> wrote:
>>>> I might mention that I am still using a version of wicket where
>>>> onConfigure is not available,and we are not due to upgrade until after
>>>> I need to finish this component.
>>>> -Nelson
>>>>
>>>> On Thu, Jun 16, 2011 at 9:21 PM, Nelson Segura <nsegu...@gmail.com> wrote:
>>>>> Is there a way to force components to be rendered in different order
>>>>> than in which they were added?
>>>>> I have the following dilemma:
>>>>>
>>>>> I have component on the header of my pages whose behavior
>>>>> (visibility/content) depends on the results displayed in a data table.
>>>>> Since the header of my pages is added in the base page, before the
>>>>> tables are added, and the results are only known during the rendering
>>>>> of the rows, I have no access to the information I need.
>>>>>
>>>>> Is there any pattern solutions you guys can suggest for solving these
>>>>> type of problems?
>>>>>
>>>>> Help is greatly appreciated.
>>>>>
>>>>> -Nelson
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to