This discussion is archived
1 2 Previous Next 27 Replies Latest reply: Dec 3, 2012 7:38 AM by 761975 RSS

Restricting display field size to 50 for standard OAF

761975 Newbie
Currently Being Moderated
Hi gurus,

I'm newbie to oaf and trying to restrict field size to 50 for standard oaf screen using personalization but unable to get it work.
For screen, I clicked on personalize stack layout region.
Expanded complete view to select message styled text: Description and clicked pencil icon to enter 50 for maximum length property. It is working for this change.

Please help me to resolve this issue.

thanks,
mallik
  • 1. Re: Restricting display field size to 50 for standard OAF
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    Then try to do this from controller extension.

    --Sushant                                                                                                                                                                                               
  • 2. Re: Restricting display field size to 50 for standard OAF
    761975 Newbie
    Currently Being Moderated
    Hi,

    Thanks for reponse.
    Since i'm newbie here to clarify with you again..Is it not possible through VO extension as it is restricting display to field size of 50??
    I tried with VO extension also but unable to get it done. The problem is while extending standard view object the changes to select statement column includes substr(assetdescription,1,50) with alias left untouched. The generated JPX file doesnt show any info of substitution after extension.

    I dont know why..
    Can you someone shed some light??

    mallik
  • 3. Re: Restricting display field size to 50 for standard OAF
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    Size of that DB column must be already set.
    So what you can do is, extend controller class and in PR method, set the size of the bean to 50.

    --Sushant                                                                                                                                                                                                                                                                                                                                   
  • 4. Re: Restricting display field size to 50 for standard OAF
    761975 Newbie
    Currently Being Moderated
    Hi Sushant,

    Do you have any example piece of code to work on this issue of restricting size??

    mallik
  • 5. Re: Restricting display field size to 50 for standard OAF
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    1) Extend the controller class.

    2) In PR method, get the handle of the bean for which you want to restrict size. For example, if it is text input field, then:
    OAMessageTextInputBean mtib = (OAMessageTextInputBean)webBean.findChildRecursive("fieldId");
    if (mtib != null) {
    mtib.setMaximumLength(50);
    }

    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
  • 6. Re: Restricting display field size to 50 for standard OAF
    761975 Newbie
    Currently Being Moderated
    Hi Sushant,

    I'm getting this error:

    oracle.apps.fnd.framework.OAException: java.lang.ClassCastException: oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean cannot be cast to oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean

    I have used this code:

    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {
    super.processRequest(oapagecontext, oawebbean);
    OATableLayoutBean oatablelayoutbean = (OATableLayoutBean)oawebbean.findChildRecursive("EamADTableLayout");
    OAMessageTextInputBean mtib = (OAMessageTextInputBean)oatablelayoutbean.findChildRecursive("EamAssetDesc");
    if (mtib != null) {
    mtib.setMaximumLength(50);
    }
    }

    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {
    super.processFormRequest(oapagecontext, oawebbean);
    }

    The part of XML page file is:
    <oa:tableLayout id="EamADTableLayout" hAlign="center" width="100%">
    <ui:contents>
    <oa:rowLayout id="EamADRowLayout" width="100%">
    <ui:contents>
    <oa:cellFormat id="EamADCell1">
    <ui:contents>
    <oa:labeledFieldLayout id="EamADFieldLayout">
    <ui:contents>
    <oa:messageStyledText id="EamAssetNumber" prompt="Asset Number" viewName="AssetHeaderVO" viewAttr="InstanceNumber" styleClass="OraDataText" shortDesc="Asset Number" user:akAttributeCode="EAM_ASSET_NUMBER"
    user:akAttributeApplicationId="426"/>
    <oa:messageStyledText id="EamAssetDesc" prompt="Description" viewName="AssetHeaderVO" viewAttr="DescriptiveText" styleClass="OraDataText" user:akAttributeCode="EAM_ASSET_DESC" user:akAttributeApplicationId="426"
    shortDesc="Asset Number Description"/>

    Please let me know..
    mallik
  • 7. Re: Restricting display field size to 50 for standard OAF
    Gyan Darpan Guru
    Currently Being Moderated
    Mallik,

    This is becoz bean is of type MessageStyledTextBean whereas in your code u are trying to cast it to MessageTextInput Bean
    //Existing code
    OAMessageTextInputBean mtib = (OAMessageTextInputBean)oatablelayoutbean.findChildRecursive("EamAssetDesc");
    //Replace with below
    OAMessageStyledTextBean mtib = (OAMessageStyledTextBean)oatablelayoutbean.findChildRecursive("EamAssetDesc");
    Regards,
    Gyan
  • 8. Re: Restricting display field size to 50 for standard OAF
    761975 Newbie
    Currently Being Moderated
    Hi Gyan,

    I already tried this OAMessageStyledTextBean mtib = (OAMessageStyledTextBean)oatablelayoutbean.findChildRecursive("EamAssetDesc");
    And it doesn't accept mtib.setMaximumLength(50);

    Please let me know ..How can i set length of the field to restrict size to 50.?

    mallik
  • 9. Re: Restricting display field size to 50 for standard OAF
    Gyan Darpan Guru
    Currently Being Moderated
    mallik,

    Controlling the size of the message styled text in not possible.

    As the message styled text is always used for display purpose. Can you explain why do u want to control the size, is it for UI.

    Regards,
    Gyan
  • 10. Re: Restricting display field size to 50 for standard OAF
    761975 Newbie
    Currently Being Moderated
    Gyan,

    If you happen to have access to apps now:
    here is the navigation maintenance super user-->Assets-->hierarchy
    the screen shows stack layout with folders having plus sign ..here after clicking plus sign it expands details underneath each folder with asset description showing in braces.
    some of the asset has very lengthy description where client want to limit the size to 50..

    Let me know this helps to proceed.

    mallik
  • 11. Re: Restricting display field size to 50 for standard OAF
    Gyan Darpan Guru
    Currently Being Moderated
    Mallik,

    I don't have access to Assests Responsibility will be able to check in few hours and update u.

    Regards.
    Gyan
  • 12. Re: Restricting display field size to 50 for standard OAF
    shreevat Pro
    Currently Being Moderated
    Would it be possible to restrict the VO to fetch only 50 characters for the required column? This way you need not worry about field length in the message styled text/input.

    Thanks
    Shree
  • 13. Re: Restricting display field size to 50 for standard OAF
    761975 Newbie
    Currently Being Moderated
    Inititally I tried to do VO extension for the standard view with changes include in the select statement substr(assetdescription,1,50). But when i did subsitution the generated JPX file doesnt show substitution info for some reason.
    I dont know why.

    I'm guessing unless you include new column it takes effect in JPX file. Someone need to clarify.
  • 14. Re: Restricting display field size to 50 for standard OAF
    Sushant Sharma Expert
    Currently Being Moderated
    Hi,

    Can you try using this:

    import oracle.cabo.style.CSSStyle;

    CSSStyle css = new CSSStyle();
    css.setProperty("max-length", 50);

    OAMessageStyledTextBean mstb = (OAMessageStyledTextBean)webBean.findChildRecursive("fieldId");

    if (mstb != null) {
    mstb.setInlineStyle(css);
    }
    }

    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points