cancel
Showing results for 
Search instead for 
Did you mean: 

dojo widget configurations

darkstar1
Confirmed Champ
Confirmed Champ
Hello all I am trying out the new widget creation system.
I wish to use the sliding tabs and I configured a sliding them in my page thus:

 {            id : "profiled-display",            name: "alfresco/layout/SlidingTabs",            config: {                widgets: [                    {                        name: "alfresco/layout/TitleDescriptionAndContent",                        config: {                              title: "Tab 1",                              description: "First One"                        }                    },                    {                        name: "alfresco/layout/TitleDescriptionAndContent",                        config: {                              title: "Tab 2",                              description: "Description 2"                        }                    }                ]            }       }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


I originally had a custom widget instead of the title and description widget but after reading the sliding tabs comment realised that i needed to have a title attribute in my widgets.
However all I get is a blank tab with no errors in console logs. I am unsure as to how or why this is.

Thanks for any help
9 REPLIES 9

oleh
Champ in-the-making
Champ in-the-making
SlidingTabs expects each widget to have a title set outside it's config, this should work:

<javascript>
        {
            name: "alfresco/layout/SlidingTabs",
            config: {
                widgets: [
                    {
                        name: "alfresco/layout/TitleDescriptionAndContent",
                        title: "Tab 1",
                        config: {
                            title: "Wupup!",
                            description: "First One"
                        }
                    },
                    {
                        name: "alfresco/layout/TitleDescriptionAndContent",
                        title: "Tab 2",
                        config: {
                            title: "Woho",
                            description: "Description 2"
                        }
                    }
                ]
            }

        }
</javascript>

darkstar1
Confirmed Champ
Confirmed Champ
Thanks. I'd configured this in a lof of different ways with my own first test widget until I decided to use an ootb widget.

ddraper
World-Class Innovator
World-Class Innovator
First of all, really pleased to hear that you've been trying it out…

Secondly, oleh is correct… any configuration outside of the "config" object used by the parent widget, and the "config" object is essentially the instantiation arguments for the child widget. In this case the outer "title" is the title given to the tab, the inner "title" is a specific instantiation argument of the "TitleDescriptionAndContent" widgets.

It's also worth bearing in mind that these widgets that you're using are just beta quality widgets that I prototyped Smiley Happy

Regards,
Dave

oleh
Champ in-the-making
Champ in-the-making
Dave, I must add that I'm not just trying it out, we already built a complete search/overview interface for our case management system with the new widget system. Even though it's brand new and still in beta, a lot of the widgets can be used as they are.

You should pop online on IRC sometime, I have a ton of stuff I want to hear your thoughts about, like:

- Ability to turn off the dependency cache or have it cleared on every request. I've currently overridden DojoDependencyHandler and DependencyHandler to do this, and it works OK most of the time, but it's a huuuuge hack. Turning off or having it reload the files in the filesystem on every request would make a huge difference durring development with the Maven SDK (no restarts!)

- Widgets vs dashlets, I want to mix them! After seeing the light with the new Dojo widgets, I never ever want to write the old style dashlets. I want widgets! But is it possible to initialize and use the new widgets on a dashboard?

- There is a "bug" in the dependency calculation regexp, if you have too many defines in your widget, and you forget to remove the trailing comma in the list, at some point the regexp never finishes

- More out-of-the-box widgets please! Can't wait to see more Smiley Wink

I could go on.. Better keep it short for now Smiley Wink

EDIT: Forgot to mention that I think the new widget system so awesome that I'm currently writing a tutorial on it Smiley Wink

ddraper
World-Class Innovator
World-Class Innovator
Wow!…. I'm glad you're getting really getting into it… sorry I've not been on IRC very much of late. I've got a slightly different role in Alfresco now so am spending a lot more time in meetings and a lot less time writing code… I also have a lot more work so have been negligent on my Community commitments!

I can understand the frustration with the dependency cache issue during development… I've just got into the habit of doing it automatically. Obviously its good for production but not great for development… if you weren't using Maven then I'd suggest adding a curl post command to your build script to clear the caches each time.

Ideally I'd like us to start using the new widget throughout Share - but it's going to take time and there'll need to be a compelling reason to switch functional old code for the new stuff. It is possible to create a dashlet that contains the widgets, but it can be problematic in that you can end up requesting multiple copies of the same resource (merged into aggregated resources). It will work, but can be a pain debugging. Ideally this stuff should be used on its own in a single page - but it is possible to use as a Component (after all the header is just a Component that uses the framework).

Could you raise an issue in JIRA for that bug you mentioned (if you haven't already) … make sure to assign it to the Share Customizations component so that I see it.

There are more widgets on the way… probably not at a huge rate, but definitely lots of minor improvements. You should see some more things coming down the line in the next couple of weeks.

Can't wait to see the tutorial - be sure to tweet me a link to it Smiley Happy

Finally, thanks for the great feedback - it's really appreciated!

Regards,
Dave

Just another quick question. Is it possible to have template arguments in the url of these dynamically generated pages? (i.e. the get.desc.xml)
I tried adding a "userid" argument  (like test-page/{userid} ), but when I call url.templateArgs in the controller all I get is null.

ddraper
World-Class Innovator
World-Class Innovator
You can add support for them via the <uri-templates> section that you'll find in share-config.xml. If you look at the example you'll see how the user and site stuff is taken care of… I've started to add a few in, but having complete variability in there is tricky to define.

darkstar1
Confirmed Champ
Confirmed Champ
Just to echo Oleh's sentiments. You should try popping in once a week. You have a small fan base in the channel.

ddraper
World-Class Innovator
World-Class Innovator
Awesome… I'll definitely have to start joining the IRC channel again then!! Smiley Happy
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.

Welcome to the new Hyland Connect. Get started or submit feedback.