You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by CarlHowarth <ca...@dlapiper.com> on 2006/11/29 13:01:00 UTC

Error using inputHidden with resource file

Hi,

I'm trying to return javascript alerts for certain error messages in my
application, however I want to get the text from a resource file. I have
added an inputHidden control and set its value to the text in the resource
file. In the javascript I return the text from the inputHidden control's
rendered value. This works fine unless my page performs a postback at which
point I get the following error:

Conversion Error "dateRangeValidation": Error during model data update.

Having done a bit of searching it would appear that this is due to a lack of
a setter for this value. Has anybody come across this problem, and if so
could they please point me in the right direction?

Many thanks, Carl
-- 
View this message in context: http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598077
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Error using inputHidden with resource file

Posted by Volker Weber <we...@googlemail.com>.
> Gerald means to use a inputHidden with style="display:none".
this was wrong, should be:

Gerald means to use a outputText with style="display:none".


2006/11/29, Volker Weber <we...@googlemail.com>:
> Hi Carl,
>
> Gerald means to use a inputHidden with style="display:none".
>
> an other solution is to force a readonly valuebinding like this:
>
> value="X#{bean.errorMesage}"
>
> and remove the leading 'X' in javascript.
>
> Regards,
>   Volker
>
> 2006/11/29, CarlHowarth <ca...@dlapiper.com>:
> >
> > Hi Gerald,
> >
> > Unfortunately style is not a valid attribute of the inputHidden control so
> > this method won't work unfortunately.
> >
> > Thanks, Carl
> >
> >
> >
> > Gerald Müllan wrote:
> > >
> > > Hi,
> > >
> > > the problem is that you do a little mixture between output and input
> > > values. In your case it seems that you need a hidden outputText
> > > element, which will only be read but never posted back.
> > >
> > > I would suggest to set display:none in the style (or styleClass) and
> > > that should do the job.
> > >
> > > cheers,
> > >
> > > Gerald
> > >
> > > On 11/29/06, CarlHowarth <ca...@dlapiper.com> wrote:
> > >>
> > >> Hi,
> > >>
> > >> I'm trying to return javascript alerts for certain error messages in my
> > >> application, however I want to get the text from a resource file. I have
> > >> added an inputHidden control and set its value to the text in the
> > >> resource
> > >> file. In the javascript I return the text from the inputHidden control's
> > >> rendered value. This works fine unless my page performs a postback at
> > >> which
> > >> point I get the following error:
> > >>
> > >> Conversion Error "dateRangeValidation": Error during model data update.
> > >>
> > >> Having done a bit of searching it would appear that this is due to a lack
> > >> of
> > >> a setter for this value. Has anybody come across this problem, and if so
> > >> could they please point me in the right direction?
> > >>
> > >> Many thanks, Carl
> > >> --
> > >> View this message in context:
> > >> http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598077
> > >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> > >>
> > >>
> > >
> > >
> > > --
> > > http://www.irian.at
> > >
> > > Your JSF powerhouse -
> > > JSF Consulting, Development and
> > > Courses in English and German
> > >
> > > Professional Support for Apache MyFaces
> > >
> > >
> >
> > --
> > View this message in context: http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598487
> > Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >
> >
>

Re: Error using inputHidden with resource file

Posted by Gerald Müllan <bi...@gmail.com>.
Try the solution with <h:outputText style="display:none;" value="xyz"
id="abc" forceId="true">

On 11/29/06, CarlHowarth <ca...@dlapiper.com> wrote:
>
> Hi,
>
> I placed the style attribute on the inputHidden but was given an error
> stating that style is not allowed.
>
> I have tried your method but that too gives an error on refresh:
>
> Parsed Expression of unsupported type for this operation. Expression class:
> org.apache.commons.el.ExpressionString. Expression:
> 'X#{webtext.dateRange_Validation}'
>
> Cheers, Carl
>
>
> Volker Weber-4 wrote:
> >
> > Hi Carl,
> >
> > Gerald means to use a inputHidden with style="display:none".
> >
> > an other solution is to force a readonly valuebinding like this:
> >
> > value="X#{bean.errorMesage}"
> >
> > and remove the leading 'X' in javascript.
> >
> > Regards,
> >   Volker
> >
> > 2006/11/29, CarlHowarth <ca...@dlapiper.com>:
> >>
> >> Hi Gerald,
> >>
> >> Unfortunately style is not a valid attribute of the inputHidden control
> >> so
> >> this method won't work unfortunately.
> >>
> >> Thanks, Carl
> >>
> >>
> >>
> >> Gerald Müllan wrote:
> >> >
> >> > Hi,
> >> >
> >> > the problem is that you do a little mixture between output and input
> >> > values. In your case it seems that you need a hidden outputText
> >> > element, which will only be read but never posted back.
> >> >
> >> > I would suggest to set display:none in the style (or styleClass) and
> >> > that should do the job.
> >> >
> >> > cheers,
> >> >
> >> > Gerald
> >> >
> >> > On 11/29/06, CarlHowarth <ca...@dlapiper.com> wrote:
> >> >>
> >> >> Hi,
> >> >>
> >> >> I'm trying to return javascript alerts for certain error messages in
> >> my
> >> >> application, however I want to get the text from a resource file. I
> >> have
> >> >> added an inputHidden control and set its value to the text in the
> >> >> resource
> >> >> file. In the javascript I return the text from the inputHidden
> >> control's
> >> >> rendered value. This works fine unless my page performs a postback at
> >> >> which
> >> >> point I get the following error:
> >> >>
> >> >> Conversion Error "dateRangeValidation": Error during model data
> >> update.
> >> >>
> >> >> Having done a bit of searching it would appear that this is due to a
> >> lack
> >> >> of
> >> >> a setter for this value. Has anybody come across this problem, and if
> >> so
> >> >> could they please point me in the right direction?
> >> >>
> >> >> Many thanks, Carl
> >> >> --
> >> >> View this message in context:
> >> >>
> >> http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598077
> >> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > http://www.irian.at
> >> >
> >> > Your JSF powerhouse -
> >> > JSF Consulting, Development and
> >> > Courses in English and German
> >> >
> >> > Professional Support for Apache MyFaces
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598487
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7599948
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Error using inputHidden with resource file

Posted by CarlHowarth <ca...@dlapiper.com>.
Hi,

I placed the style attribute on the inputHidden but was given an error
stating that style is not allowed.

I have tried your method but that too gives an error on refresh:

Parsed Expression of unsupported type for this operation. Expression class:
org.apache.commons.el.ExpressionString. Expression:
'X#{webtext.dateRange_Validation}'

Cheers, Carl


Volker Weber-4 wrote:
> 
> Hi Carl,
> 
> Gerald means to use a inputHidden with style="display:none".
> 
> an other solution is to force a readonly valuebinding like this:
> 
> value="X#{bean.errorMesage}"
> 
> and remove the leading 'X' in javascript.
> 
> Regards,
>   Volker
> 
> 2006/11/29, CarlHowarth <ca...@dlapiper.com>:
>>
>> Hi Gerald,
>>
>> Unfortunately style is not a valid attribute of the inputHidden control
>> so
>> this method won't work unfortunately.
>>
>> Thanks, Carl
>>
>>
>>
>> Gerald Müllan wrote:
>> >
>> > Hi,
>> >
>> > the problem is that you do a little mixture between output and input
>> > values. In your case it seems that you need a hidden outputText
>> > element, which will only be read but never posted back.
>> >
>> > I would suggest to set display:none in the style (or styleClass) and
>> > that should do the job.
>> >
>> > cheers,
>> >
>> > Gerald
>> >
>> > On 11/29/06, CarlHowarth <ca...@dlapiper.com> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I'm trying to return javascript alerts for certain error messages in
>> my
>> >> application, however I want to get the text from a resource file. I
>> have
>> >> added an inputHidden control and set its value to the text in the
>> >> resource
>> >> file. In the javascript I return the text from the inputHidden
>> control's
>> >> rendered value. This works fine unless my page performs a postback at
>> >> which
>> >> point I get the following error:
>> >>
>> >> Conversion Error "dateRangeValidation": Error during model data
>> update.
>> >>
>> >> Having done a bit of searching it would appear that this is due to a
>> lack
>> >> of
>> >> a setter for this value. Has anybody come across this problem, and if
>> so
>> >> could they please point me in the right direction?
>> >>
>> >> Many thanks, Carl
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598077
>> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> > http://www.irian.at
>> >
>> > Your JSF powerhouse -
>> > JSF Consulting, Development and
>> > Courses in English and German
>> >
>> > Professional Support for Apache MyFaces
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598487
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7599948
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Any way to output HTML from (for example) a resource bundle?

Posted by Gerald Müllan <bi...@gmail.com>.
> If your problem is that < and > gets rendered as &lt; and &gt;, add
> escape="false" to the h:outputFormat tag. Note, this is h:outputFormat,
> not f:outputFormat.

Yes, or just put escape="false" to an outputText component.

But i would be little careful with this, especially taking html stuff
from resource bundles. This makes your view layer much more less
readable and more difficult to maintain.

Also it`s more difficult to see at a first glance what the output will be.

cheers,

Gerald

On 11/29/06, David Delbecq <de...@oma.be> wrote:
> If your problem is that < and > gets rendered as &lt; and &gt;, add
> escape="false" to the h:outputFormat tag. Note, this is h:outputFormat,
> not f:outputFormat.
>
>
> Stephen Osella a écrit :
> > I tried using f:outputFormat...but that doesn't render the HTML that I
> > have in a string in a message resource bundle.  Is there any way to do
> > this? Have HTML in a resource bundle and then have it rendered as HTML
> > in a page?
> >
> > Thanks!
>
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Any way to output HTML from (for example) a resource bundle?

Posted by David Delbecq <de...@oma.be>.
If your problem is that < and > gets rendered as &lt; and &gt;, add
escape="false" to the h:outputFormat tag. Note, this is h:outputFormat,
not f:outputFormat.


Stephen Osella a écrit :
> I tried using f:outputFormat...but that doesn't render the HTML that I
> have in a string in a message resource bundle.  Is there any way to do
> this? Have HTML in a resource bundle and then have it rendered as HTML
> in a page?
>
> Thanks!


Any way to output HTML from (for example) a resource bundle?

Posted by Stephen Osella <so...@austin.rr.com>.
I tried using f:outputFormat...but that doesn't render the HTML that I have 
in a string in a message resource bundle.  Is there any way to do this? 
Have HTML in a resource bundle and then have it rendered as HTML in a page?

Thanks! 


Re: Error using inputHidden with resource file

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

yes, that`s it.

cheers,

Gerald

On 11/29/06, Volker Weber <we...@googlemail.com> wrote:
> Hi Carl,
>
> Gerald means to use a inputHidden with style="display:none".
>
> an other solution is to force a readonly valuebinding like this:
>
> value="X#{bean.errorMesage}"
>
> and remove the leading 'X' in javascript.
>
> Regards,
>   Volker
>
> 2006/11/29, CarlHowarth <ca...@dlapiper.com>:
> >
> > Hi Gerald,
> >
> > Unfortunately style is not a valid attribute of the inputHidden control so
> > this method won't work unfortunately.
> >
> > Thanks, Carl
> >
> >
> >
> > Gerald Müllan wrote:
> > >
> > > Hi,
> > >
> > > the problem is that you do a little mixture between output and input
> > > values. In your case it seems that you need a hidden outputText
> > > element, which will only be read but never posted back.
> > >
> > > I would suggest to set display:none in the style (or styleClass) and
> > > that should do the job.
> > >
> > > cheers,
> > >
> > > Gerald
> > >
> > > On 11/29/06, CarlHowarth <ca...@dlapiper.com> wrote:
> > >>
> > >> Hi,
> > >>
> > >> I'm trying to return javascript alerts for certain error messages in my
> > >> application, however I want to get the text from a resource file. I have
> > >> added an inputHidden control and set its value to the text in the
> > >> resource
> > >> file. In the javascript I return the text from the inputHidden control's
> > >> rendered value. This works fine unless my page performs a postback at
> > >> which
> > >> point I get the following error:
> > >>
> > >> Conversion Error "dateRangeValidation": Error during model data update.
> > >>
> > >> Having done a bit of searching it would appear that this is due to a lack
> > >> of
> > >> a setter for this value. Has anybody come across this problem, and if so
> > >> could they please point me in the right direction?
> > >>
> > >> Many thanks, Carl
> > >> --
> > >> View this message in context:
> > >> http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598077
> > >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> > >>
> > >>
> > >
> > >
> > > --
> > > http://www.irian.at
> > >
> > > Your JSF powerhouse -
> > > JSF Consulting, Development and
> > > Courses in English and German
> > >
> > > Professional Support for Apache MyFaces
> > >
> > >
> >
> > --
> > View this message in context: http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598487
> > Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >
> >
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Error using inputHidden with resource file

Posted by Volker Weber <we...@googlemail.com>.
Hi Carl,

Gerald means to use a inputHidden with style="display:none".

an other solution is to force a readonly valuebinding like this:

value="X#{bean.errorMesage}"

and remove the leading 'X' in javascript.

Regards,
  Volker

2006/11/29, CarlHowarth <ca...@dlapiper.com>:
>
> Hi Gerald,
>
> Unfortunately style is not a valid attribute of the inputHidden control so
> this method won't work unfortunately.
>
> Thanks, Carl
>
>
>
> Gerald Müllan wrote:
> >
> > Hi,
> >
> > the problem is that you do a little mixture between output and input
> > values. In your case it seems that you need a hidden outputText
> > element, which will only be read but never posted back.
> >
> > I would suggest to set display:none in the style (or styleClass) and
> > that should do the job.
> >
> > cheers,
> >
> > Gerald
> >
> > On 11/29/06, CarlHowarth <ca...@dlapiper.com> wrote:
> >>
> >> Hi,
> >>
> >> I'm trying to return javascript alerts for certain error messages in my
> >> application, however I want to get the text from a resource file. I have
> >> added an inputHidden control and set its value to the text in the
> >> resource
> >> file. In the javascript I return the text from the inputHidden control's
> >> rendered value. This works fine unless my page performs a postback at
> >> which
> >> point I get the following error:
> >>
> >> Conversion Error "dateRangeValidation": Error during model data update.
> >>
> >> Having done a bit of searching it would appear that this is due to a lack
> >> of
> >> a setter for this value. Has anybody come across this problem, and if so
> >> could they please point me in the right direction?
> >>
> >> Many thanks, Carl
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598077
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > http://www.irian.at
> >
> > Your JSF powerhouse -
> > JSF Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598487
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Re: Error using inputHidden with resource file

Posted by CarlHowarth <ca...@dlapiper.com>.
Hi Gerald,

Unfortunately style is not a valid attribute of the inputHidden control so
this method won't work unfortunately.

Thanks, Carl



Gerald Müllan wrote:
> 
> Hi,
> 
> the problem is that you do a little mixture between output and input
> values. In your case it seems that you need a hidden outputText
> element, which will only be read but never posted back.
> 
> I would suggest to set display:none in the style (or styleClass) and
> that should do the job.
> 
> cheers,
> 
> Gerald
> 
> On 11/29/06, CarlHowarth <ca...@dlapiper.com> wrote:
>>
>> Hi,
>>
>> I'm trying to return javascript alerts for certain error messages in my
>> application, however I want to get the text from a resource file. I have
>> added an inputHidden control and set its value to the text in the
>> resource
>> file. In the javascript I return the text from the inputHidden control's
>> rendered value. This works fine unless my page performs a postback at
>> which
>> point I get the following error:
>>
>> Conversion Error "dateRangeValidation": Error during model data update.
>>
>> Having done a bit of searching it would appear that this is due to a lack
>> of
>> a setter for this value. Has anybody come across this problem, and if so
>> could they please point me in the right direction?
>>
>> Many thanks, Carl
>> --
>> View this message in context:
>> http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598077
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> http://www.irian.at
> 
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
> 
> Professional Support for Apache MyFaces
> 
> 

-- 
View this message in context: http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598487
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Error using inputHidden with resource file

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

the problem is that you do a little mixture between output and input
values. In your case it seems that you need a hidden outputText
element, which will only be read but never posted back.

I would suggest to set display:none in the style (or styleClass) and
that should do the job.

cheers,

Gerald

On 11/29/06, CarlHowarth <ca...@dlapiper.com> wrote:
>
> Hi,
>
> I'm trying to return javascript alerts for certain error messages in my
> application, however I want to get the text from a resource file. I have
> added an inputHidden control and set its value to the text in the resource
> file. In the javascript I return the text from the inputHidden control's
> rendered value. This works fine unless my page performs a postback at which
> point I get the following error:
>
> Conversion Error "dateRangeValidation": Error during model data update.
>
> Having done a bit of searching it would appear that this is due to a lack of
> a setter for this value. Has anybody come across this problem, and if so
> could they please point me in the right direction?
>
> Many thanks, Carl
> --
> View this message in context: http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7598077
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Error using inputHidden with resource file

Posted by CarlHowarth <ca...@dlapiper.com>.
Sorry, just got the response re output text - this works well with the
display:none.

Cheers, Carl


CarlHowarth wrote:
> 
> Hi,
> 
> I'm trying to return javascript alerts for certain error messages in my
> application, however I want to get the text from a resource file. I have
> added an inputHidden control and set its value to the text in the resource
> file. In the javascript I return the text from the inputHidden control's
> rendered value. This works fine unless my page performs a postback at
> which point I get the following error:
> 
> Conversion Error "dateRangeValidation": Error during model data update.
> 
> Having done a bit of searching it would appear that this is due to a lack
> of a setter for this value. Has anybody come across this problem, and if
> so could they please point me in the right direction?
> 
> Many thanks, Carl
> 

-- 
View this message in context: http://www.nabble.com/Error-using-inputHidden-with-resource-file-tf2724670.html#a7600082
Sent from the MyFaces - Users mailing list archive at Nabble.com.