Thursday, June 28, 2012

Complex forms? Simple and easy! (part 2)

In the previous post I showed a sketch of a desired form and a way to achieve it. But the result was not exact.

The inputDate doesn't fit the width of a parent cell. Moreover in the implementing of а skin, I ran into problems with getting the results like this.


The problem is in the structure of the rendered html. Rendered html code depends on the property "simple". In case of a simple input something can be done, but in another case I just give up because of IE.



I've played with firebug and find out the best stucture for me is when input and button are placed in neighbour cells of table.



I have thought: why not? The dirty hack is not good but there no other options. Moreover in the new Jdeveloper 11.1.2.2 situation is the same. I believe that the code that renders inputDate remains the same too as in the 11.1.1.2.0. Since we have the source code of ADF I decided to change a little a source code of the inputDateRenderer. And happiness come. =)

How to commit this. At first I've created a generic project ADFMod and create a java class SimpleInputDateRenderer in package oracle.adfinternal.view.faces.renderkit.rich. Copied into it the code of original class. And added to the project libraries next libraries:

In the method renderElementContent I've added these lines:
  • before rw.startElement("input", component);
  • after boolean disabled = getDisabled(bean);      
  • before rw.endElement("span");
Then I've launched the application and all was great except remaining skin.

Css like below was the end point in the story with inputDates. The next story was inputListOfValues and inputComboBoxListOfValues...

And note the skin for inputs is not full.

No comments:

Post a Comment