Table initialization

View: New views
4 Messages — Rating Filter:   Alert me  

Table initialization

by Ted Byers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I set the title of a table in function init().  I know the value to be used is calculated correctly, but when the table is displayed, the value I set is not shown and the default value "Table" is shown.

I suspect this is due to my changes being replaced somewhere in the process of rendering the page.  It would be trivial for me to store the computed value for the Table title (rather than moving code which depends on other code that has to be in the initialization function.  But where should I retrieve it in order to ensure that the table gets the right title?  I Do set the table title in an event hadnler, so once an item is selected, the table has the right title.  The problem manifests itself only the first time the page is displayed.

Any tips on how to fix this would be appreciated.

Thanks

Ted

Re: Table initialization

by Futaleufu_John :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I recall seeing other posts similar to this.

I think this has something to do with the way the page is initialized and the "default" values set. When you set the table's title in init() it gets overwritten by the title embedded in the JSP code (which by default is Table).

Try putting the title code in prerender.

Another option is to bind the title property to a page or session bean property. When you update the property the next time the page is displayed the updated title will appear in the table.

Ted Byers wrote:
I set the title of a table in function init().  I know the value to be used is calculated correctly, but when the table is displayed, the value I set is not shown and the default value "Table" is shown.
Any ads or links to ads that appear in this post are not endorsed nor recommended by this poster.

Re: Table initialization

by Ted Byers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi John,

Thanks.  I think you're mostly right.

Setting the table's title in prerender didn't work, but adding a property to the session bean and binding the title to that does.  I would have hoped that the page beans would have provided a function that is invoked during the page construction process in such a way that we could easily set such properties; but at least we have a way around such a deficiency.

Thanks

Ted

I recall seeing other posts similar to this.

I think this has something to do with the way the page is initialized and the "default" values set. When you set the table's title in init() it gets overwritten by the title embedded in the JSP code (which by default is Table).

Try putting the title code in prerender.

Another option is to bind the title property to a page or session bean property. When you update the property the next time the page is displayed the updated title will appear in the table.

Ted Byers wrote:
I set the title of a table in function init().  I know the value to be used is calculated correctly, but when the table is displayed, the value I set is not shown and the default value "Table" is shown.


Parent Message unknown Re: Table initialization

by Rick Fincher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ted,

The setTitle method works, you just have to be sure that the title is
NOT set in the visual editor properties.  That  puts stuff in the JSP
page.  When stuff gets put in the JSP page, it is the last stage before
HTML gets written, so it overwrites your previous settings.

If you bring up the visual editor, select the table, then go to the
"properties" pane and erase the "Table" string from the "title" box or
click the "..." and select "Reset to default" in the editor window that
pops up.  That avoids the problem.

If you leave "Table" in the "title" block, then click the "JSP" button
at the top of the editor pane in Netbeans and search for "title", you
will see an entry in the ui:table tag.

That's all the properties editor really does: generate code for the JSP
page tags.


Rick

Ted Byers wrote:

> Hi John,
>
> Thanks.  I think you're mostly right.
>
> Setting the table's title in prerender didn't work, but adding a property to
> the session bean and binding the title to that does.  I would have hoped
> that the page beans would have provided a function that is invoked during
> the page construction process in such a way that we could easily set such
> properties; but at least we have a way around such a deficiency.
>
> Thanks
>
> Ted
>
> Futaleufu_John wrote:
>  
>> I recall seeing other posts similar to this.
>>
>> I think this has something to do with the way the page is initialized and
>> the "default" values set. When you set the table's title in init() it gets
>> overwritten by the title embedded in the JSP code (which by default is
>> Table).
>>
>> Try putting the title code in prerender.
>>
>> Another option is to bind the title property to a page or session bean
>> property. When you update the property the next time the page is displayed
>> the updated title will appear in the table.
>>
>>
>> Ted Byers wrote:
>>    
>>> I set the title of a table in function init().  I know the value to be
>>> used is calculated correctly, but when the table is displayed, the value
>>> I set is not shown and the default value "Table" is shown.
>>>
>>>
>>>      
>>    
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...