MyFaces Extensions Validator
  1. MyFaces Extensions Validator
  2. EXTVAL-54

Code that gets the Metadata for a Compontent is not reusable

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 1.2.2, 1.1.1, 1.1.2
    • Fix Version/s: 1.2.3, 2.0.3, 1.1.3
    • Component/s: Core
    • Labels:
      None

      Description

      I am refering to the code that is contained in ValidationInterceptor::initComponent
      It would be helpfull if I could get the Metadata for a component via a simple Util-Class

        Activity

        Hide
        Gerhard Petracek added a comment -

        hi thomas,

        that's already possible with:
        ExtValUtils.getComponentMetaDataExtractor().extract(facesContext, uiComponent).getMetaDataEntries();

        do you need something else?

        regards,
        gerhard

        Show
        Gerhard Petracek added a comment - hi thomas, that's already possible with: ExtValUtils.getComponentMetaDataExtractor().extract(facesContext, uiComponent).getMetaDataEntries(); do you need something else? regards, gerhard
        Hide
        Thomas Wilhelm added a comment -

        Hi Gerhard,

        as far as I see the Extractor does provide me with the metadata as its define in my bean. The code in ValidationInterceptor::initComponent normalizes the metadata so it is implementation independant. I would like to have a util which would give me this normalized representation.

        For better understanding:
        What I want to do is to add a marker to a label of each required field. Therefore I need to know wether the field that is associated with a label is required or not by the time the label is rendered.

        regards,
        Thomas

        Show
        Thomas Wilhelm added a comment - Hi Gerhard, as far as I see the Extractor does provide me with the metadata as its define in my bean. The code in ValidationInterceptor::initComponent normalizes the metadata so it is implementation independant. I would like to have a util which would give me this normalized representation. For better understanding: What I want to do is to add a marker to a label of each required field. Therefore I need to know wether the field that is associated with a label is required or not by the time the label is rendered. regards, Thomas
        Hide
        Gerhard Petracek added a comment -

        hi thomas,

        yes due to the refactorings for EXTVAL-48 that's basically possible. the only blocking "issue" is the skipValidation method.
        so we have to introduce an interface for this method. i'll provide a patch which illustrates the result.
        i'm not completely sure about the name. maybe you have a better suggestion.

        regards,
        gerhard

        Show
        Gerhard Petracek added a comment - hi thomas, yes due to the refactorings for EXTVAL-48 that's basically possible. the only blocking "issue" is the skipValidation method. so we have to introduce an interface for this method. i'll provide a patch which illustrates the result. i'm not completely sure about the name. maybe you have a better suggestion. regards, gerhard
        Hide
        Gerhard Petracek added a comment -

        a possible solution

        Show
        Gerhard Petracek added a comment - a possible solution
        Hide
        Gerhard Petracek added a comment -

        hi thomas,

        i committed the final version.

        http://svn.apache.org/repos/asf/myfaces/extensions/validator/trunk/component-support/trinidad-support/src/main/java/org/apache/myfaces/extensions/validator/trinidad/interceptor/TrinidadRendererInterceptor.java
        ... is very similar to what you will need to do. so you can use it as a small example.

        if it is a generic solution in combination with richfaces, it would be nice to get it as donation for:
        http://code.google.com/p/sandbox890/source/browse/#svn/trunk/component-support/richfaces-support

        regards,
        gerhard

        Show
        Gerhard Petracek added a comment - hi thomas, i committed the final version. http://svn.apache.org/repos/asf/myfaces/extensions/validator/trunk/component-support/trinidad-support/src/main/java/org/apache/myfaces/extensions/validator/trinidad/interceptor/TrinidadRendererInterceptor.java ... is very similar to what you will need to do. so you can use it as a small example. if it is a generic solution in combination with richfaces, it would be nice to get it as donation for: http://code.google.com/p/sandbox890/source/browse/#svn/trunk/component-support/richfaces-support regards, gerhard
        Hide
        Thomas Wilhelm added a comment -

        Hi Gerhard,

        it works. Thank you very much. Once I am done with my Implementation I will see if I can share some code.

        Regards,
        Thomas

        Show
        Thomas Wilhelm added a comment - Hi Gerhard, it works. Thank you very much. Once I am done with my Implementation I will see if I can share some code. Regards, Thomas

          People

          • Assignee:
            Gerhard Petracek
            Reporter:
            Thomas Wilhelm
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 2h
              2h
              Remaining:
              Remaining Estimate - 2h
              2h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development