You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Stan Kwan <sk...@anatas.com> on 2008/09/01 09:44:02 UTC

inputText and readonly

swk schrieb:
> hi all,
>
> Hoping that someone can help me with the following problem that i have:
> I'm using the latest myfaces 1.1.6, tomahawk 1.1.6, tomahawk sandbox 
> 1.1.7
>
> Basically i have...
>
> <s:form>
>   <t:panelTabbedPane ...>
>     <t:panelTab>
>        <h:panelGrid ...>
>            multiple <h:inputText> to display data from backing beans.
>            some with attribute readonly="true" and others without
>            and a <h:commandButton> to update data
>        <h:panelGrid>
>     </t:panelTab>
>
>     multiple <t:panelTabs> like the one above
>
>   </t:panelTabbedPane>
> </s:form>
>
> My problem is that the <h:inputText> that have the attribute
> readonly="true"
> specified shows the data. It's rendered fine with data from the beans. 
> The <h:inputText> that don't have readonly defined show's nothing.
> But if i put readonly="true" on these, then it works fine.
>
> Can anyone advise what i am doing wrong?
>
> Another point is that if i change this to have a form in each panelTab 
> (as opposed to 1 form for all tabs) it also displays all the data, 
> readonly and non readonly.
>
>   

I expect that you're getting a validation failure, but that you do not have
an h:messages tag in your page, so do not see it.

Try adding an h:messages tag to your page.

And in future, please send these sorts of questions to the user list, not
the dev list.

Regards, Simon



-- 
View this message in context: http://www.nabble.com/inputText-and-readonly-tp19250077p19250077.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: inputText and readonly

Posted by "simon.kitching@chello.at" <si...@chello.at>.
Stan Kwan schrieb:
> Thanks for your feedback Simon. I have added the messages tag and it doesn't
> display any errors.
> I also turned on some debug facilities that i'm aware of that shows the
> parameters passed in and there was no difference apart from the names and
> binding variables which were all expected.
>
> Just to add to my previous post... On another panelTab that i have, there is
> a t:commandLink that i use to retrieve some more data from the backend. Once
> the results are returned, i do see that the fields previously not rendered
> are now rendering as i wanted!
>
> I also checked my other panelTabs and it looks like my form is only
> displaying values that have readonly="true"
>
> Does this look like a rendering issue?
>   

It really looks to me like the components are rendering their cached 
"submittedValue" rather than fetching data from the actual backing bean. 
This deliberately happens after a conversion or validation failure, so 
that invalid user input is redisplayed rather than thrown away. Of 
course "readonly" components do not have a cached "submittedValue", so 
the data from the backing bean is always displayed.

But if your h:messages component is definitely not showing any messages, 
then I guess this is not the cause.

I cannot think of any other cause though. I have certainly not seen 
anything like this.

Regards,
Simon


Re: inputText and readonly

Posted by Stan Kwan <sk...@anatas.com>.
Thanks for your feedback Simon. I have added the messages tag and it doesn't
display any errors.
I also turned on some debug facilities that i'm aware of that shows the
parameters passed in and there was no difference apart from the names and
binding variables which were all expected.

Just to add to my previous post... On another panelTab that i have, there is
a t:commandLink that i use to retrieve some more data from the backend. Once
the results are returned, i do see that the fields previously not rendered
are now rendering as i wanted!

I also checked my other panelTabs and it looks like my form is only
displaying values that have readonly="true"

Does this look like a rendering issue?

thanks again





Stan Kwan wrote:
> 
> swk schrieb:
>> hi all,
>>
>> Hoping that someone can help me with the following problem that i have:
>> I'm using the latest myfaces 1.1.6, tomahawk 1.1.6, tomahawk sandbox 
>> 1.1.7
>>
>> Basically i have...
>>
>> <s:form>
>>   <t:panelTabbedPane ...>
>>     <t:panelTab>
>>        <h:panelGrid ...>
>>            multiple <h:inputText> to display data from backing beans.
>>            some with attribute readonly="true" and others without
>>            and a <h:commandButton> to update data
>>        <h:panelGrid>
>>     </t:panelTab>
>>
>>     multiple <t:panelTabs> like the one above
>>
>>   </t:panelTabbedPane>
>> </s:form>
>>
>> My problem is that the <h:inputText> that have the attribute
>> readonly="true"
>> specified shows the data. It's rendered fine with data from the beans. 
>> The <h:inputText> that don't have readonly defined show's nothing.
>> But if i put readonly="true" on these, then it works fine.
>>
>> Can anyone advise what i am doing wrong?
>>
>> Another point is that if i change this to have a form in each panelTab 
>> (as opposed to 1 form for all tabs) it also displays all the data, 
>> readonly and non readonly.
>>
>>   
> 
> I expect that you're getting a validation failure, but that you do not
> have an h:messages tag in your page, so do not see it.
> 
> Try adding an h:messages tag to your page.
> 
> And in future, please send these sorts of questions to the user list, not
> the dev list.
> 
> Regards, Simon
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/inputText-and-readonly-tp19250077p19250270.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.