tags:

views:

370

answers:

3

I Have a hidden box in my HTML. How I can get it value in my GWT when onModuleLoad??

the hidden box will content a value pass from another page. Now I can see the hidden box content the value but I fail to get the value in my GWT onModuleLoad.

HTML page: [code] <% String sSessionID=request.getParameter("NA_SessionID"); if(sSessionID==null) session.setAttribute("NetAdminSession",(String)session.getAttribute("NetAdminSession")); else session.setAttribute("NetAdminSession",sSessionID); %>

">

[/code]

+1  A: 

You can access any element in the DOM by using the GWT DOM Class. For example, if your hidden box has the id "NetAdminSession", you may use the following to access the hidden box...

DOM.getElementById("NetAdminSession");
prometheus
A: 

To: Geoffrey Wiseman my HTML file is in the GWT HTML.. but I change it to JSP file instead of HTML

To: prometheus Thanks you information, I will give it a try now.

guaz
A: 

I'm not sure what your overall approach/architecture is, but it might also be helpful to look into some of the new features added in GWT 2.0. Specifically, Declarative Layout with UIBinder. With this you can actually construct your user interface with declarative XML instead of using pure Java. I would steer away from creating too much of your UI in the actual HTML file since it will be easier to control those UI elements if you construct them in your GWT code. You can still stick to good MVC principles if you break your classes/code up the right way.

prometheus