Hi Thiago, Thanks a lot for your reply it works fine but the problem is using this line of code in beginRender() function shows the "div" when the page is loaded. but What I want is to show the div after a button is pressed. When I used this line of code in the onSubmit() button function it gives me "No object of type org.apache.tapestry5.services.javascript.JavaScriptSupport is available from the Environment" exception!! Could you explain this for me?
Regards, Marwa On Sat, Oct 3, 2020 at 10:01 PM Thiago H. de Paula Figueiredo < thiag...@gmail.com> wrote: > Hello! > > @Inject private JavaScriptSuport javaScriptSupport; > > void beginRender() { > > javaScriptSupport.addScript("document.getElementById("div1").style.display > = '';"); > } > > On Sat, Oct 3, 2020 at 10:06 AM marwa hussein <marwa.huss...@gmail.com> > wrote: > > > Hello all, > > I am new to Tapestry and to Web development in general but I have to > > implement a simple web application for my research. > > > > I use a div that when loading the page I need to hide it, so I use this > > line: > > <div id="div1" class="grid3" scroll="true" style="display:none"> > > The div contains "inside it" a grid that will contain some elements > after a > > "load" button is pressed. > > how can I unhide the div again "after pressing the load button"? > > > > I know that I could do this with JS Line of code like: > > document.getElementById("div1").style.display =""; > > But how and where can I add a javascrpt line of code directly in my Java > > class? > > > > Thansk in advance > > > > -- > > > > > > > > *Marwa Hussein M. TA @ Information Systems Department Faculty of > Computers > > & Information Assuit University* > > <imanhe...@yahoo.com> > > > > > -- > Thiago > -- *Marwa Hussein M. TA @ Information Systems Department Faculty of Computers & Information Assuit University* <imanhe...@yahoo.com>