insert inside the <body> this <div>
<div id="yourParam" style="visibility: hidden;"><SCRIPT
LANGUAGE="JAVASCRIPT"
TYPE="TEXT/JAVASCRIPT">document.write(anything_you_want);</SCRIPT></div>

and inside the onModuleLoad retrieve the DIV in this way:

String param=DOM.getInnerHTML(DOM.getElementById("yourParam"));
int indexOfScriptEnd = param.toUpperCase().indexOf("</SCRIPT>");
if (indexOfScriptEnd!=-1) {
     choosedProduct =
param.substring(indexOfScriptEnd+"</SCRIPT>".length()).trim();
}

The indexOf is needed to have compatibility with all browser 'cause browsers
different from IE
gives back also the entire SCRIPT.
You can also use inside the div some Hidden Inputs and so retrieve as many
params as
you want.
Hope it helps, Patrizio

PS But there are other solutions based on GWT, this is my solution and you
can bet that isn't the smartest ;)


2009/6/16 Kinjal Khandhar <[email protected]>

> Thanks for that valuable information.
> Yes I was trying to read properties file from client-side.Can you give me
> the link or a way of how to implement using hidden DIV?
>
> Thanks,
> Kinjal
>
>
> On Mon, Jun 15, 2009 at 1:41 PM, Patrizio De Michele 
> <[email protected]>wrote:
>
>> Hello,
>> i believe you're trying to read a properties file on client-side....
>> obviously the class Properties doesn't exists in GWT and also
>> where did you search for the file? in which dir?
>> You can read a properties file on the server and send it to the client
>> by an async call, but i don't recommend it 'cause is slow and if you
>> need mandatory informations could be that when the service answers
>> it's too late.
>> maybe for you is enough to create an hidden DIV inside the
>> base html with the values you require or follow the link posted by
>> Gabriel.
>> Bye Patrizio
>>
>> 2009/6/15 Gabriel Ernesto Gutierrez Añez <[email protected]>
>>
>> If you want to load properties from the servlet, you can setup a context
>>> listener (this will not work on hosted mode, but on web mode, i dont know
>>> why listener does not work well on hosted mode),
>>> or you can take a look at
>>> http://gwt.google.com/samples/Showcase/Showcase.html#CwConstantsExample
>>>
>>> Regards,
>>> _____________________
>>> Ing. Gabriel Gutiérrez
>>>
>>>
>>>
>>> On Mon, Jun 15, 2009 at 9:01 AM, Kinjal Khandhar <
>>> [email protected]> wrote:
>>>
>>>> Hello All,
>>>> I am not able to read from a simple properties file on startup.
>>>> It gives me this error:
>>>>
>>>> [ERROR] Line 16: No source code is available for type
>>>> java.util.Properties; did you forget to inherit a required module?
>>>>
>>>> Can anyone help me as to how do I read from the properties file on
>>>> startup.
>>>>
>>>> Thanks in advance.
>>>>
>>>> -Kinjal
>>>>
>>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to