Skip to Content
author's profile photo Former Member
Former Member

Highlight ("mark with red background") input field and cells in a table

Hey there,

sry for the title, had some problems to figure an appropriate one 😉

I've the following problem:

Situation

Web Dynpro View with some InputFields and a table with one colum consisting of input fields. I'm using a custom controller (validator) for validating the entered data. If any errors occur, a the message manager is called, an according exception is created and the navigation is canceled.

2 of the InputFields are used to enter a start- and an enddate.

The table rows consist of 1. A Projects Name (Text) and 2. an InputField where a number (int) has to be entered.

Problem 1: How to mark a field as "Error source" without using the reportContextAttributeMessage-Method of the MsgMgr?

During the validation of the date fields I'm checking if the startdate is AFTER the enddate. If that's the case, I'm calling the reportContextAttributeMessage but unfortunately I can only assign ONE AttributePointer, so that only ONE InputField is highlightet. Is there any other method with which i can archieve this "highlighting effect" without an own error message displays, so that i could assign the remaining InputField? My workarounf 'till now is an empty message but that just doesn't look good..

Problem 2: How to mark multiple/certain table cells?

This is basically the same problem as I mentioned above except the fact, that the table cells are dynamically created via given Inputmapping of the webdynpro component. I've to admit I'm new to WebDynpro and this is the first time I'm dealing with tables, but I've no clue how I can get the "AttributePointer" (which is required for reportContextAttributeMessage()) of a certain table cell.

Hope someone can help me on this one 😊

Kind regards

Pascal

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 04, 2009 at 10:43 AM

    Ad 2: You can get a attribute pointer via IWDNodeElement.getAttributePointer(String attributeName). A cell in a table is identified by its row (node element) and the attribute used by the cell editor.

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      I have a same kind of requirement. I am able to highlight the field with error. But the problem is in getting focus. I have a scrollable table. So if the error is in one the rows which is visible then the focus changes on clicking the error message. But when the error is in a row which not visible presently, the focus doesnot change on clicking the error.

      e.g.:

      I have 100 lines of data in a scrollable table, and only 10 lines are visible at one time. The is at line no. 80 and presently line 1-10 are visible. So, if i click the error message, the cursor is not changing, it still shows line 1-10. But if i scroll down to line 80, and then click the error msg, the focus is changing to the exact field.

      Kindly help in this.

  • Posted on Sep 04, 2009 at 03:40 PM

    hi Pascal,

    You can use method reportContextAttributeMessage(IWDAttributePointer[] attributes,

    IWDMessage message,

    Object[] args) for highlighting multiple inputfields.

    Or you can use textviews instead of label besides the inputfield. Bind its semantic color property to an attribute.

    Set it to Negative or Marked2 to highlight it.

    Hope this helps!

    Monalisa

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hey Monalisa,

      >

      > You can use method reportContextAttributeMessage(IWDAttributePointer[] attributes,

      > IWDMessage message,

      > Object[] args) for highlighting multiple inputfields.

      thx for this hint, I should have read the docu more thoroughly 😉

      This solved my problem.

      To Julio: I was aware of that and that's not the problem, but thx anyway ^^

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.