You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Stephen Friedrich (JIRA)" <de...@myfaces.apache.org> on 2008/08/28 10:25:44 UTC

[jira] Created: (TRINIDAD-1199) Field is always required, even when set to false via PPR

Field is always required, even when set to false via PPR
--------------------------------------------------------

                 Key: TRINIDAD-1199
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1199
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions: 1.2.9-core
            Reporter: Stephen Friedrich


When a tr:inputText is switched from required="true" to required="false" using PPR, then the required icon is correctly removed, but validation still fails if the inputText is empty.

See TRINIDAD-1130 for an example app.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1199) Field is always required, even when set to false via PPR

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627692#action_12627692 ] 

Matthias Weßendorf commented on TRINIDAD-1199:
----------------------------------------------

the problem is that there is an inline (rendered) _addValidators(...) function.
so doing PPR to make it disabled, doesn't update the client side knowledge that the guy isn't required anymore...


> Field is always required, even when set to false via PPR
> --------------------------------------------------------
>
>                 Key: TRINIDAD-1199
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1199
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>         Attachments: required.png
>
>
> When a tr:inputText is switched from required="true" to required="false" using PPR, then the required icon is correctly removed, but validation still fails if the inputText is empty.
> See TRINIDAD-1130 for an example app.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1199) Field is always required, even when set to false via PPR

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650162#action_12650162 ] 

Matthias Weßendorf commented on TRINIDAD-1199:
----------------------------------------------

A simple test case it here:
<?xml version='1.0' encoding='utf-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:tr="http://myfaces.apache.org/trinidad"
          version="1.2">
  <jsp:directive.page contentType="text/html;charset=utf-8"/>
  <f:view>
    <tr:document title="test">
        <!-- initialize session variables -->
        <jsp:scriptlet>
          if (session.getAttribute("alreadyInitialized") == null)
          {
            session.setAttribute("flag1", true);
            session.setAttribute("alreadyInitialized", "done");
          }
        </jsp:scriptlet>

<tr:form id="trForm">

<tr:subform id="setup">
<tr:panelHorizontalLayout> 
   <tr:selectBooleanCheckbox id="internal2"
    label="checker"
    value="#{sessionScope.flag1}"
    autoSubmit="true"
    immediate="true" />
</tr:panelHorizontalLayout>
</tr:subform>

<tr:subform>
<tr:panelHorizontalLayout partialTriggers=":setup:internal2">
  <tr:inputText label="Some value"
    partialTriggers=":internal2"
    required="#{sessionScope.flag1}"/>
  <tr:commandButton id="save2" text="Save"/>
</tr:panelHorizontalLayout>
</tr:subform>

         </tr:form>

    </tr:document>
  </f:view>
</jsp:root>

> Field is always required, even when set to false via PPR
> --------------------------------------------------------
>
>                 Key: TRINIDAD-1199
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1199
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>         Attachments: required.png
>
>
> When a tr:inputText is switched from required="true" to required="false" using PPR, then the required icon is correctly removed, but validation still fails if the inputText is empty.
> See TRINIDAD-1130 for an example app.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1199) Field is always required, even when set to false via PPR

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627698#action_12627698 ] 

Matthias Weßendorf commented on TRINIDAD-1199:
----------------------------------------------

the client-side validation engine is a bit ugly...
so, best would be... to have a _updateValidators(..........)

to at least ensure something like is is re-set on every PPR as well:
          // write out whether or not this element is required
          writer.writeText(convertValidate.required? "1" : "0", null);

But writing out a bunch of extra JS could cost some perf....

> Field is always required, even when set to false via PPR
> --------------------------------------------------------
>
>                 Key: TRINIDAD-1199
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1199
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>         Attachments: required.png
>
>
> When a tr:inputText is switched from required="true" to required="false" using PPR, then the required icon is correctly removed, but validation still fails if the inputText is empty.
> See TRINIDAD-1130 for an example app.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1199) Field is always required, even when set to false via PPR

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627672#action_12627672 ] 

Matthias Weßendorf commented on TRINIDAD-1199:
----------------------------------------------

eh, out of curiosity... I just checked again, and I now see it...
very strange. ok... will take care of it

> Field is always required, even when set to false via PPR
> --------------------------------------------------------
>
>                 Key: TRINIDAD-1199
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1199
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>         Attachments: required.png
>
>
> When a tr:inputText is switched from required="true" to required="false" using PPR, then the required icon is correctly removed, but validation still fails if the inputText is empty.
> See TRINIDAD-1130 for an example app.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1199) Field is always required, even when set to false via PPR

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626488#action_12626488 ] 

Matthias Weßendorf commented on TRINIDAD-1199:
----------------------------------------------

I don't see the validation error....

-unchecked isInternal => "Contract Vacation Days"  become not required (and disabled)
-clicking SAVE works fine.

also, when I remove the disabled flag (so the field is editable), I don't get any warnings (when the field is not required)
tested w/ 1.2.10 and server-side validation OFF and! ON.

Help me to understand the problem

> Field is always required, even when set to false via PPR
> --------------------------------------------------------
>
>                 Key: TRINIDAD-1199
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1199
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>
> When a tr:inputText is switched from required="true" to required="false" using PPR, then the required icon is correctly removed, but validation still fails if the inputText is empty.
> See TRINIDAD-1130 for an example app.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.