Force validation of a container

I've finally finished my first layout manager (implements LayoutManager2), but there is a small problem.
The layout manager adjusts the size of its components to fit the size of the parent container with a private function called fixLayout(). This function is called at the beginning of the layout manager's layoutContainer(Container parent) function. It works as long as the parent container is resized slowly. But, say the parent container is a JFrame's content pane. When the user maximizes the JFrame, the layout manager only accommodates for a part of the increase in the parent container's dimensions. This unwanted behavior also occurs when the user resizes the frame very quickly by dragging its edge across the screen.
I know the problem is that the layoutContainer function isn't being called fast enough to keep up with the frame's edges (Zeno's paradox: Tortoise vs. Achilles -- cool read). A quick fix would be to call <parent container's name>.validate() after the frame has been resized, but I don't know how to capture such an event. I would have liked to post a runnable snippet, but I can't think of an easy way to reproduce the problem for all of you, short of posting 11 kB of mostly irrelevant java code.
This is my first post. Be nice. And thanks for reading this far.

fixLayout is just a way to contain all the code that makes the components fit the container. It is called whenever layoutComponent is called, so it does, in fact, happen automatically. I guess it really didn't need to be mentioned... I'll try to be a little more concise with future posts.
I tried the componentListener. The problem is less noticeable but it is still there. I believe layoutComponent is now just being called twice at every resize event. There has to be a better way to do this.
By the way, is it possible to post my code here, even if it is a little long? Because I would appreciate some suggestions or comments (or praise lol).

Similar Messages

  • Urgent....Forcing validation on tab

    Hi,
    I am doing ADF BC Application. I want to force validations(client and server) on tab.
    please Help.

    Hi Shay
    I am trying to do both client and server side validations.
    I Have a creation form with 2 fields and a editable table.
    Now 1st condition
    In the editable table, the user can modify any no.of records. But every time forcing a refresh condition on pressing tab does no good.
    2nd condition
    How to check for null condition for the fields in the editable table.
    Thanks.

  • Get-ChildItem with -LiteralPath is throwing "The specified wildcard character pattern is not valid" when filenames contain brackets

    I'm trying to get a list of folders in a hierarchy that don't contain any mp3 files. (The goal here is to eventually clean up all the "empty" folders that only have album art, thumbs.db, desktop.ini, etc. files left). So I wrote a quick PowerShell
    command to try to do this. But it doesn't seem to be working.
    I already checked out this thread <Get-ChildItem
    SomeFile[].txt occurs error because of the [brackets]: "specified wildcard pattern not valid"> and I think I'm using LiteralPath correctly. Any other hints for troubleshooting this problem? Here's the command I'm using.
    Get-ChildItem -Recurse -Directory | ?{
    @( @(Get-ChildItem -LiteralPath $_.FullName -Recurse) | ?{
    $_.Extension -eq ".mp3"}).Count -eq 0 }
    This is on the latest version of PowerShell found in Windows Technical Preview.

    Fair enough, but it still doesn't answer the original question- why isn't this working with -LiteralPath when the path contains brackets? 
    Get-ChildItem -Recurse -Directory | ?{
    @( @(Get-ChildItem -LiteralPath $_.FullName -Recurse) | ?{
    $_.Extension -eq ".mp3"}).Count -eq 0 }
    Thanks,
    Ben

  • Validation Rule - Should contain only alphabets and can be upto 4 characters long

    Hi, I am using MDS 2012 and want to create a business rule for data validation which says,
    "Should contain only alphabets and can be up to 4 characters long". How can I create such a rule in MDS? Also the Code and Name attributes are 250 characters by default. How to restrict them to 4 characters if business need them to be 4 or
    less character?
    Any help appreciated.
    Thanks, Ashish Singh

    When creating a business rule, under Actions there is "Must be maximum length of" and "must contain patern".
    See:
    http://technet.microsoft.com/en-us/library/ff487015.aspx

  • Forcing XML from String containing prefix

    Is there way to create an XML node from a String which contains a prefix?
    example:
    var str:String = "<w:body>content</w:body>";
    var newXML:XML = new XML(str);
    This returns:         The prefix "w" for element "body" is not bound.
    Is there a way to force this?
    I have tried adding a namespace to w   but with no luck.

    In a strict sense, using CDATA feels like a hack. It, perhaps, makes sense only if string in your example will eventually become a text() value of another node.
    In your case "w" is obviously a namespace. So, you should explore how to get and make your XML aware of this name space.
    For example the following works:
    var str:String = "<w:node xmlns:w=\"http://www.microsoft.com/\"><w:body >content</w:body></w:node>";
    var newXML:XML = new XML(str);

  • Validation - template cannot contain escape characters

    Hi all, im new to Warehouse builder, i find the documentation lacking, the tutorials lacking and i can't find any books on warehouse builder either. Am I stupid ? :-)
    Anyway, i've set up 3 constants (varchar2) to pass as parameter values to a function im calling and when i try to validate the mapping im getting 'Template cannot contain escape characters'.
    Then im getting validation completed successfully..however, when i try to deploy im getting this:
    VLD-1141: Internal error during mapping generation.
    java.lang.IllegalArgumentException: Template cannot contain escape characters.
    at oracle.wh.util.expr.WBLiteralExpression.<init>(WBLiteralExpression.java:34)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformGenerationDelegate.addContextExpressionsForGroups(GenericTransformGenerationDelegate.java:345)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformGenerationDelegate.prepareOutputContextPlSql(GenericTransformGenerationDelegate.java:1433)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformPlSqlDelegate.prepareOutputContext(GenericTransformPlSqlDelegate.java:147)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:239)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleCursorLoopInternal(PlSqlGenerationMediator.java:3206)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleCursorLoop(PlSqlGenerationMediator.java:3190)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleRowBased(PlSqlGenerationMediator.java:3115)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assemble(PlSqlGenerationMediator.java:538)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:770)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:316)
    at oracle.wh.service.impl.mapping.generation.WBDeployableMappingGenerator.generate(WBDeployableMappingGenerator.java:99)
    at oracle.wh.service.impl.generation.common.WBGenerationService.generateCode(WBGenerationService.java:433)
    at oracle.wh.service.impl.generation.common.WBGenerationService.generateCode(WBGenerationService.java:311)
    at oracle.wh.service.impl.generation.service.WhValidationGenerationTransaction.run(WhValidationGenerationTransaction.java:241)
    I have no clue whatsoever what this is about, can anyone tell ?

    hi ,
    I also got the same error when i migrated MDL from owb 9.2 version.
    I was using OWB 10.2.01, and heard that it is a bug which is fixed in owb 10.2.0.3
    So i applied the patch and this error gone.
    In case if it help u.
    rojo

  • Af:inputDate with both date and time: modal popup forces validation

    Hello,
    I am using an af:inputDate with an af:convertDateTime type='both' (displaying date and time).
    When the calendar popup is shown it's a modal popup. I guess it is because of the type='both'?
    My problem is: when the modal popup is shown I get also the validation popup with errors (for example required fields) which is shown too.
    Maybe someone could help?
    Is there a way to force non-modal popup for this kind of calendar?
    Is there a way to stop validation if I am already displaying another popup?
    Thanks in advance,
    Cindy

    Hi,
    U just override ok cancel button type="none"., inside the <af:panelGroupLayout id="pgl10" layout="horizontal" valign="middle">
    <af:commandButton id="ok" text="Ok" action="#{beanName.okAction}" immediate="true"/>
    <af:commandButton id="can" text="Cancel" action="#{beanName.cancelAction}" />
    </af:panelGroupLayout>
    Regards,
    parame

  • How to force validator method instead of data type validation in af:table

    This post will probably once again illustrate exactly how new I am to the Java/JDeveloper world so thanks in advance for any help! I have tried searching but couldn't find anything that seemed to mirror my problem.
    I am using a modification of Frank's idea on how to individually color table cell backgrounds.
    http://thepeninsulasedge.com/frank_nimphius/2008/04/10/adf-faces-conditionally-color-table-cell-background-2/
    My intention was to use this along with custom validation to color cells with invalid values. It was a user request that it be done so as to quickly spot input errors (when updating records) if someone had missed the initial faces message and was no longer in the field that generated the error. It works fine for fields in my af:table based on VO attributes with varchar2 types but the 2 values with float and number types handle character input with a faces message "Not a number" and then do not seem to process the validator. The reason I (think I) need to use the validator in addition to Franks code is that in the validator code I use an addpartialtarget to the uicomponent that refreshes the background color if it changed in the backing bean.
    FYI the project is based on ADF BC/JSF.
    I tried gave the full use case as suggested so you understand what I am trying to accomplish and if you have a better way to accomplish this please let me know as well.
    Thanks,
    Rich
    Managed-Bean
        public String getMODELColorString() {
            MODELColorString = "width:125px;";
            Object MODEL = getRowValue("#{row.ModelType}");
            if (MODEL != null) {
                if (!isValidMODEL(MODEL.toString())) {
                    MODELColorString = "background-color:red;width:125px;";
            return MODELColorString;
        }Backing-Bean
            if (!myValidation.isValidMODEL(object.toString())) {
                System.out.println("InValid Data");
            AdfFacesContext.getCurrentInstance().addPartialTarget(uiComponent);P.S. If I made any newbie mistakes in my code please let me know, although this is obviously not production code yet by any means.
    Message was edited by:
    BengalGuy

    Frank (or anyone else who might offer some advice),
    I thought that solved my issue as I could see the validator getting triggered, however something else is now happening. It seems to pass through the validator once for each of the values on my table with the invalid input I entered on one of the numbers, "a" in this case, and then once again through the color change backing bean but at that time the invalid input reverts to the original input and the change is rendered on the af:table as well. Any thoughts ? I put a print in the validator method, in the method that gets called from the validator (checks to see if value can be converted to float) , and then the color change bean (which also calls the float validation test) and pasted the output below.
    Validator Triggered \Current Value = 0.037178375 \FloatTestOn: 0.037178375 \Result: Valid Data
    Validator Triggered \Current Value = 0.109212324 \FloatTestOn: 0.109212324 \Result: Valid Data
    Validator Triggered \Current Value = 0.18624917 \FloatTestOn: 0.18624917 \Result: Valid Data
    Validator Triggered \Current Value = 0.26863635 \FloatTestOn: 0.26863635 \Result: Valid Data
    Validator Triggered \Current Value = 0.35674548 \FloatTestOn: 0.35674548 \Result: Valid Data
    Validator Triggered \Current Value = -0.38118127 \FloatTestOn: -0.38118127 \Result: Valid Data
    Validator Triggered \Current Value = -0.3382032a \FloatTestOn: -0.3382032a NumberFormatException: For input string: "-0.3382032a"
    08/04/16 10:03:14 \Result: InValid Data
    Validator Triggered \Current Value = -0.29224017 \FloatTestOn: -0.29224017 \Result: Valid Data
    Validator Triggered \Current Value = -0.24308495 \FloatTestOn: -0.24308495 \Result: Valid Data
    Validator Triggered \Current Value = -0.1905158 \FloatTestOn: -0.1905158 \Result: Valid Data
    Validator Triggered \Current Value = -0.13429564 \FloatTestOn: -0.13429564 \Result: Valid Data
    Validator Triggered \Current Value = -0.07417088 \FloatTestOn: -0.07417088 \Result: Valid Data
    Validator Triggered \Current Value = -0.009870344 \FloatTestOn: -0.009870344 \Result: Valid Data
    \Checking for color change \FloatTestOn: 0.037178375
    \Checking for color change \FloatTestOn: 0.109212324
    \Checking for color change \FloatTestOn: 0.18624917
    \Checking for color change \FloatTestOn: 0.26863635
    \Checking for color change \FloatTestOn: 0.35674548
    \Checking for color change \FloatTestOn: -0.38118127
    \Checking for color change \FloatTestOn: -0.3382032 <- "a" is no longer there ?
    \Checking for color change \FloatTestOn: -0.29224017
    \Checking for color change \FloatTestOn: -0.24308495
    \Checking for color change \FloatTestOn: -0.1905158
    \Checking for color change \FloatTestOn: -0.13429564
    \Checking for color change \FloatTestOn: -0.07417088
    \Checking for color change \FloatTestOn: -0.009870344

  • Error validating business rules containing variable from another plan type.

    We have created few business rules in in plan type "Plan1" which we are using variable from plan type "Capex". This is how we are using it.
    "(@XREF(cpx,"Intangible Assets Finite, Gross","Unspecified","No Project","Information Technology (IT)","371064911-01"))"
    But when we validate this rule it gives the following error
    "An error occurred in: Rule:IFLJAN13.Plan1.B - Trail Balance - Capex
    A validation error was received from the Planning server 'http://hptstorg:8300/HyperionPlanning/servlet/HspAppManagerServlet?appname=IFLJAN13'.
    'Error:The member 'Unspecified' cannot be found.
    The member 'Unspecified' cannot be found.
    The member 'Intangible Assets' cannot be found.
    The member 'Unspecified' cannot be found.
    The member 'Unspecified' cannot be found. Rule IFLJAN13.Plan1.B - Trail Balance - Capex'."
    We have checked the location aliases using EAS Console and they are correct.

    Could you pls. check if you can see your BR in the location for the cube where you are unable to validate the rule?! (EAS console --> Administration --> Locations --> (right click) open)
    your user must be able to "validate or launch" the rule in this location (changeable with "Add Access Privileges") and the rule itself must be able to launch in this location (changeable with "Add rules").
    Kind regards
    André

  • Workflow Substitutions - Force Validity End Date

    Is there a way I can configure Business Workplace Substitution Validity date from and to dates to fall within a specific range?  Can I prevent someone from using the default 12/31/9999 date when creating a substitute?

    Hi Mark,
    Well for starters a lot depends on:
    a) What release/environment are you using?
    b) What type of substitution - user to user or position to person are you using?
    If you are using position to person, that's HR infotype A210 so you could use HR Structural Authorisations to only allow the infotype to be created e.g. up to the end of the current year.
    If you are using user to user, its a bit harder.  In that case its based on table HRUS_D2, which only checks the end date is a valid date.
    So you would really have to code in an additional check from wherever you are maintaining the data.
    So now the question is, how do your users maintain substitutions? i.e. in which release/environment? using which maintenance tool?  Then you need to check out how that tool works.
    E.g. you might be using the API SAP_WAPI_SUBSTITUTE_MAINTAIN or the table maintenance generated for HRUS_D2.
    E.g. if its just the table maintenance view, you could add a table maintenance generation "event" with your additional check (go to the table maintenance generation and try menu Environment > Modification > Events).
    Unfortunately the other maintenance tools use function modules - none of which currently offer any BADIs or user exits for adding additional checks.  So at this stage it would be a mod.  But a good thing to ask for in a development request perhaps.
    Regards,
    Jocelyn

  • Problem with custom validated data types using domain on 11g

    Hi,
    I ' m on a migration process from 10 to 11 and I notice that a custom domain didn't work correctly anymore
    to be more specific every time that I was submiting a page a was getting an error cannot convert from myclass to oracle.jbo.domain.String
    I search the forum and I saw a similar problem
    Cannot convert type class java.lang.String to class oracle.jbo.domain.Clob
    at which Frank says that it is a known bug and suggests a work around.
    I use the workaround and it worked but some more issues came up:
    1. If the validation fails I get the error that I throw at the validate method not in a popup with just my message
    but in the whole window with the whole error stack, meaning that my custom validation is not handled like native ADF validation errors by
    the framework (at 10.1.3.4 worked OK)
    2 If i dont give a value at the attribute in the validation phase mdata variable is not null but is length is zero (at 10.1.3.4 its value was null)
    public class AFM implements DomainInterface, Serializable {
    public AFM(String val) {
    mData = new String(val);
    validate();
    private String mData;
    protected void validate() {
    // ### Implement custom domain validation logic here. ###
    mData==null // returns false
    mData.length()==0 // returns true
    3. Can i force validation only for new or updated values? I saw that the validation process is taking place every time a row is fetched.
    This is not only a performance issue, the bigger problem is that if a fetched from the DB value fails the validation an error is return but the
    user cannot change the value to correct it.
    TIA
    Tilemahos

    since i don't get any answer I wonder if i should have use a more provocative title like
    "custom domains in 11g don't work"
    is it true?
    Tilemahos

  • The InfoCube contains non-cumulative values

    Hi,
    While creating multicube for inventory on two cubes its askin the below "The InfoCube contains non-cumulative values. A validity table is created for these non-cumulative values, in which the time interval is stored, for which the non-cumulative values are valid.
    The validity table automatically contains the "most detailed" of the selected time characteristics (if such a one does not exist, it must be defined by the user, meaning transfered into the InfoCube)", what is that and how to solve this,
    Please through some light on this its urgent.
    Chandan

    Hi,
    Your multi cube is probably based on the infociune 0IC_C03 containing non cumulative key figures taht's why you get this message.
    You generaly don't have to maintain validity area unless you are in a special configuration (for exemple loading data from two source systems).
    UThe following link should give more information about validity area with non cumulative :
    [http://help.sap.com/saphelp_nw04/helpdata/en/02/9a6a1c244411d5b2e30050da4c74dc/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/en/02/9a6a1c244411d5b2e30050da4c74dc/frameset.htm]
    Hope this helps.
    Cyril

  • Define the Characteristics of the validity table for non-cumulatives

    Hi Friends,
      Here I am designing MultiProvider ( ZCA_M01), based on the Two Business content info cubes (0IC_C03 & 0SD_C03 ) & one customized info cube (ZPUR_C01).
    I done Identification for char & keyfigures also.
    When i trying to activating the Multiprovider, here i am getting the error , error message is : Define the Characteristics of the validity table for non-cumulatives.
    Even here I am attaching the error message help also.
    Message no. R7846
    Diagnosis
    The InfoCube contains non-cumulative values. A validity table is created for these non-cumulative values, in which the time interval is stored, for which the non-cumulative values are valid.
    The validity table automatically contains the "most detailed" of the selected time characteristics (if such a one does not exist, it must be defined by the user, meaning transfered into the InfoCube).
    Besides the most detailed time characteristic, additional characteristics for the InfoCube can be included in the validity table:
    Examples of such characteristics are:
    •     A "plan/actual" indicator, if differing time references exist for plan and actual values (actual values for the current fiscal year, plan values already for the next fiscal year),
    •     the characteristic "plant", if the non-cumulative values are reported per plant, and it can occur that a plant already exists for plant A for a particular time period, but not yet for plant B.
    Procedure
    Define all additional characteristics that should be contained in the validity table by selecting the characteristics.
    In the example above, the characteristics "plan/actual" and  "plant" must be selected.
    The system automatically generates the validity table according to the definition made. This table is automatically updated when data is loaded.
    Please take as a high priority.
    Thanks & Regards,
    Vanarasi Venkat.

    Hi Venkat,
    If you want to include 0IC_C03 cube in your multi provider the you must make sure that the time characterestics ( 0CALDAY, 0CALMONTH ....) are present in all of the other info providers which you are including in the MP. The Time char to choose depends upon the Inventory cube in which you have mentioned during the definition. As you are using the standard cube 0IC_C03 it has the time char as 0CALDAY. Try to include this in all the other info providers and dont include more tha one Non-cumulative in the MP.
    Try this and see if it helps....

  • Alert inbox - Alert Categories - Container elements

    Hi all,
    I have configured alerts in alrtcatdef tcode. I am able to receive the alerts in the alert inbox. But the container elements are filled in. When tried <b>with checking the Dynamic Text</b> there is no long text in the alert received in the alert inbox.
    We r on SP 17.
    Did any one try this.
    reg,

    naveen
    If u had typed the container elements then u may need to delete those and again insert thru the std option (an icon where you can fetch it). Also check the corresponding data type for the container element. If you are using a wrong data type, which is not valid for that container element, you might face problems.
    Check Note : 947738 to solve this issue. Also check Troubleshooting Note specifically 913858.

  • How to deal with validation errors from DAO layer.

    I have been pondering on how to deal with validation errors from DAO layer.
    Lets say you have a DAO that can save a car object. A car has a year, make, model, vin and so on. During the save operation of this DAO, it validates the car attributes to see if they pass some business rules. If it does not it throws some validation exception that contains all the validation errors. These validation errors know nothing about jsf or my components it just knows what attributes on the object are invalid and why.
    If I just want to show those errors at the top of the page that would be no problem I could just create some FacesMessage objects and add them to the FacesContext messages. But if the DAO layer is telling me that the make attribute is invalid it would be nice to map it to the make field on the screen. I am wondering if any of you have tackled this problem or have some ideas on how to tackle it?
    Brian

    Let it throw an exception with a self explaining message, then catch it and embed that message in a FacesMessage.
    Or let it throw more specific exception types (InvalidCarMakeException extends CarDAOException and so on) and let JSF handle it with own FacesMessage message.

Maybe you are looking for

  • Invoices u0096 Report

    Hi,I have a requirementto develop the report to view Novertis invoices –  that will list invoice information for all divested products sold on behalf of Novertis.  Current company has list of divested material that are sold by company Archis but now

  • Menu Bar Icons no longer showing, not able to switch on in control panel

    I had sleep problems with my MBP (http://discussions.apple.com/thread.jspa?threadID=2449728&tstart=0) and as such I did a combo update as this could possibly solve it. However, now all the control panel icons in the menu bar have gone (like the clock

  • Photoshop version 7.0.1 'program error problem' on Mac10.6.8 is there a fix?

    I installed this version onto my new computer Mac 10.6.8 and Message comes up .....An unexpected and unrecoverable problem has occured because of a programe error photoshop will now quit. What if anything can I do to fix this? Can anyone point me in

  • Official link to download 11r2

    I am using 10.2.0.4 oracle database for linux. I have 11g r1. i want to download 11gr2 for education purpose. - please provide valid link to download 11gr2 - os: redht 5.1

  • Safari disappeared from my husband's account.

    Safari disappeared from my husband's account (not the administrator's account).  How do I retreive it?