Hey Mario,

that sounds really nice. At least the title and viewId is something I
really appreciate. At least the viewId make the page, containing the
dialog more readable.

Is the closeButton rendering a "x" image? If yes, I think it might be
nice to have that button rendered as default. And only disable it,
when setting the value to false. In a "normal" rich/desktop
environment, there is always a "x".

Anyway, looks like a nice/needed overhaul.

-Matthias

On 4/13/07, Mario Ivankovits <[EMAIL PROTECTED]> wrote:
Hi!

I'd like to announce that the latest tomahawk-sandbox (as per today)
contains an enhanced version of the ModalDialog component.

Its now possible to render another view within the content area of the
dialog.

To achieve  this  I've added three new attributes to the component:

dialogTitle - if wanted, this allows you to automatically get a window
caption including the provided title.
closeButton - true|false - renders a close button if true - this setting
requires a dialogTitle, otherwise no caption will be rendered at all.
viewId - the JSF viewId you would like to render within the dialog

Its also possible to add a submitOnEvent to this style of dialog box
which allows you to issue a submit once the user closed the window
"using the ok button". In reality we do not know if you even have a OK
button in your dialog view, so you simply have to set a js var to true
to indicate the dismiss was due to an OK action.

Important parts from the examples
Example [1]:

            <s:modalDialog
                dialogId="viewDialog"
                dialogVar="viewDialog"
                styleClass="viewDialog"
                dialogTitle="ViewId Dialog"
                closeButton="true"
                viewId="dojo/dojoDialogView.jsf">

                <s:submitOnEvent event="dialogok" for="dismissAction" />

            </s:modalDialog>


Example [2] (see the _myfaces_ok stuff):
                <h:outputLink
                    value="#"

onclick="window.parent._myfaces_currentModal._myfaces_ok=true;window.parent._myfaces_currentModal.hide();">
                    <h:outputText value="close window" />
                </h:outputLink>


There are some css style you can use to customize your dialog:

Global styles:
modalDialogDecoration - the caption table
modalDialogTitle - the caption title row
modalDialogTitleLeft - the caption title cell
modalDialogTitleRight - the caption icons cell
modalDialogCloser - the close-icon image
modalDialogContent - the iframe

Specific styles - according to the styles above you can also use
{styleClass}Decoration, {styleClass}Title, {styleClass}TitleLeft,
{styleClass}TitleRight, {styleClass}Closer, {styleClass}Content
where you have to replace {styleClass} with the text provided at the
styleClass attribute of your modalDialog component.

See the .viewDialog* style configurations in [1] on how to configure the
size of the component.


Well, hope this is of any help for someone else too.


PS: Maybe someone is willing to create a documentation for the
ModalDialog component and adding this text? To a Wiki at least ... ?
Thanks in advance!

Have fun!
Ciao,
Mario


[1]
http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/dojo/dojoDialog.jsp?view=markup
[2]
http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/dojo/dojoDialogView.jsp?view=markup




--
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Reply via email to