Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
Marco Napolitano
A.Dialog doesn't show button text
February 14, 2012 4:47 AM
Answer

Marco Napolitano

Rank: New Member

Posts: 19

Join Date: February 14, 2012

Recent Posts

Hi all,
I'm working on Liferay Community 6.1.0 and I've a problem with the AlloUI dialog component.
This is the code in my JSP page:
 1<aui:script>
 2function <portlet:namespace/>showUploadDialog() {
 3    var htmlForm = // HERE THERE'S SOME HTML CODE;
 4
 5    AUI().use('aui-dialog', function(A) {
 6        var dialog = new A.Dialog({
 7            height: 120,
 8            width: 300,
 9            title: 'Upload',
10            bodyContent: htmlForm,
11            centered: true,
12            close: true,
13            constrain2view: true,
14            draggable: true,
15            modal: true,
16            resizable: false,
17            buttons: [{
18                text: 'Send',
19                handler: function() {
20                    // HERE I DO SOMETHING
21                }
22            }]
23        }).render();
24       
25        dialog.show();
26    });
27}
28</aui:script>

That's quite simple but the text of the button (text: 'Send') is NOT shown.
The button appears but with no text, so it seems like a small grey circle.
I tested it on Windows 7 Professional with Firefox 10, Explorer 9 and Opera 11.
In the attachment there's a screenshot of the dialog.

Is it a bug or I miss something?

Tnx
Marco
Attachment

Attachments: FireShot Screen Capture #057.png (6.5k)
Mayur Patel
RE: A.Dialog doesn't show button text
February 14, 2012 4:58 AM
Answer

Mayur Patel

Rank: Expert

Posts: 343

Join Date: November 17, 2010

Recent Posts

Hello Marco,

Thanks for being part of Liferay Forum.

There is not having any problem with script which you're using , Its not a bug whatever you've used for displaying text of button thats correct actually.

Can you try this,

1AUI().use('aui-dialog', 'aui-overlay-manager', 'dd-constrain', function(A){ ..............  }


Can you check whether thats not problem of bodycontent which you've used, give some static value to bodyContent attibute

Also, Check any javascript error is coming through firebug

Thanks,
Mayur
Marco Napolitano
RE: A.Dialog doesn't show button text
February 14, 2012 5:22 AM
Answer

Marco Napolitano

Rank: New Member

Posts: 19

Join Date: February 14, 2012

Recent Posts

Hi,
I tried adding the 2 modules you said and to use a static text for bodyContent: nothing has changed.
And no errors inside Firebug.

Now it's a bug? emoticon

Tnx
Marco
Mayur Patel
RE: A.Dialog doesn't show button text
February 14, 2012 5:53 AM
Answer

Mayur Patel

Rank: Expert

Posts: 343

Join Date: November 17, 2010

Recent Posts

Thanks for your reply emoticon

I tested it on Windows 7 Professional with Firefox 10, Explorer 9 and Opera 11.


If you can check same on Windows XP and Browsers which you've mentioned , see there its coming text if not then It can be bug which is not supported by latest version of all browser, you can raise a bug after testing it properly in all cases

Thanks
Marco Napolitano
RE: A.Dialog doesn't show button text
February 14, 2012 5:58 AM
Answer

Marco Napolitano

Rank: New Member

Posts: 19

Join Date: February 14, 2012

Recent Posts

Just to test, I tried with this stupid JSP page.
Of course it doesn't work. emoticon

 1<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui"%>
 2
 3<aui:script>
 4function showPopup() {
 5    AUI().use('aui-dialog', 'aui-overlay-manager', 'dd-constrain', function(A) {
 6        var dialog = new A.Dialog({
 7            height: 200,
 8            width: 250,
 9            title: 'TITLE',
10            bodyContent: 'BODY',
11            centered: true,
12            buttons: [{
13                text: 'BUTTON',
14                handler: function() {
15                    alert('Button pressed');
16                }
17            }]
18        }).render();
19   
20        dialog.show();
21    });
22}
23</aui:script>
24
25<aui:button value="Apri dialog" onClick="showPopup()"/>
Marco Napolitano
RE: A.Dialog doesn't show button text
February 14, 2012 6:32 AM
Answer

Marco Napolitano

Rank: New Member

Posts: 19

Join Date: February 14, 2012

Recent Posts

I tested it on:
  • Windows 7
    • Internet Explorer 9
    • Firefox 10
    • Opera 11
  • Windows XP
    • Internet Explorer 8
    • Internet Explorer 6
    • Firefox 5
  • OS X
    • Firefox 10
    • Safari 5
  • Debian
    • Firefox 10


It doesn't work.
Mayur Patel
RE: A.Dialog doesn't show button text
February 14, 2012 10:25 PM
Answer

Mayur Patel

Rank: Expert

Posts: 343

Join Date: November 17, 2010

Recent Posts

Hey Marco,

I've tested same code on Liferay 6.0 EE SP2 , just replaced first line and thats working fine

1<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>


Now I'm sure that is case of version which you are using Lifeary CE 6.1.0

Thanks
Chakravarthy P
RE: A.Dialog doesn't show button text
February 14, 2012 11:20 PM
Answer

Chakravarthy P

Rank: New Member

Posts: 1

Join Date: February 14, 2012

Recent Posts

To test the flag functionality..
Marco Napolitano
RE: A.Dialog doesn't show button text
February 15, 2012 12:54 AM
Answer

Marco Napolitano

Rank: New Member

Posts: 19

Join Date: February 14, 2012

Recent Posts

Mayur Patel:
Hey Marco,
I've tested same code on Liferay 6.0 EE SP2 , just replaced first line and thats working fine
1<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>

Now I'm sure that is case of version which you are using Lifeary CE 6.1.0
Thanks


Hi,
I tested the different URI for taglib but it doesn't work.
It seems to be a bug in 6.1.0 CE version.
I opened an issue: http://issues.liferay.com/browse/AUI-616

Tnx
Marco
Anup Krishnan
RE: A.Dialog doesn't show button text
February 15, 2012 2:00 AM
Answer

Anup Krishnan

Rank: New Member

Posts: 9

Join Date: April 14, 2011

Recent Posts

Change the script code from text: 'BUTTON' to label: 'BUTTON'
James Falkner
RE: A.Dialog doesn't show button text
February 15, 2012 7:14 AM
Answer

James Falkner

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1348

Join Date: September 17, 2010

Recent Posts

Chakravarthy P:
To test the flag functionality..

It worked emoticon
Marco Napolitano
RE: A.Dialog doesn't show button text
February 15, 2012 7:40 AM
Answer

Marco Napolitano

Rank: New Member

Posts: 19

Join Date: February 14, 2012

Recent Posts

Akris K:
Change the script code from text: 'BUTTON' to label: 'BUTTON'


It works! Thanks!

But... where the hell is the documentation about that?
Standing at the official documentation the key is "text" and not "label".
http://www.liferay.com/community/liferay-projects/alloy-ui/demo?title=community-liferay-projects-alloy-ui-demos-dialog
Mayur Patel
RE: A.Dialog doesn't show button text
February 16, 2012 2:05 AM
Answer

Mayur Patel

Rank: Expert

Posts: 343

Join Date: November 17, 2010

Recent Posts

There should be the documentation of what changes made in new version of Lifeary 6.1.0 CE
so that we can have an idea to resolve the problem

Thanks
Marco Napolitano
RE: A.Dialog doesn't show button text
February 16, 2012 12:18 AM
Answer

Marco Napolitano

Rank: New Member

Posts: 19

Join Date: February 14, 2012

Recent Posts

Mayur Patel:
There should be the documentation of such kind of change in changes made in new version of Lifeary 6.1.0 CE
so that we can have an idea to resolve the problem

Thanks


Sorry, I don't understand.
Where is the "changes made in new version of Lifeary 6.1.0 CE" page?

Bye
Marco