Skip to main content

need help with dojo.tabbed view

5 replies [Last post]
msreekanth
Offline
Joined: 2006-01-31

Hi ,

I have posted a question here[ https://ajax.dev.java.net/servlets/ReadMsg?list=users&msgNo=156 ]

But seems no one is sending messages to users@ajax.dev.java.net.So posting it here.

Can some one help me in fixing that problem

Thanks,
Sreekanth

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31

Hi,

And sometimes my spam filter picks up messages from users@ajax.dev.java.net. The forums are good or you can also try dev@ajax.dev.java.net.

Regards,

-Greg

yummychen
Offline
Joined: 2008-04-07

Hi Greg :

If i just want to refresh the tab page (maybe i update the database so i want to refresh the content).
I use the setInclude method to do this action. But i got an error message on page : Try to register widget with id = xxxx but that id is already registered.
It seems jmaki try to register the widget on the page but these widgets were already exist.
What can i do for reloading the page to get the newest content?
Thanks.

gmurray71
Offline
Joined: 2003-07-31

Hi Yummmy Chen,

You have 2 options.

Option 1) Don't use an id attribute on the tabbed view component (one will be assigned automatically.
2) Make sure you have unique id's on the tabbed view in the page and the one in the pane.

3) On the widget in question make the frame you are changing an iframe:

value="{items:[
{id : 'repo', label : 'Reports',
include : 'ReportsTable.jsp ', lazyLoad : false, selected : true },
{id : 'conf', label :
'Configuration', include : 'ConfigurationBuilder.jsp ', lazyLoad : true, iframe: true}
]
}"
subscribe="/jmaki/tab"/>

Let me know if this doesn't work.

-G

gmurray71
Offline
Joined: 2003-07-31

Hi,

What you are trying to do should be pretty straight forward:

If you have:

value="{items:[
{id : 'repo', label : 'Reports',
include : 'ReportsTable.jsp ', lazyLoad : false, selected : true },
{id : 'conf', label :
'Configuration', include : 'ConfigurationBuilder.jsp ', lazyLoad :
true}
]
}"
subscribe="/jmaki/tab"/>

To change the contents of any tab you can use publish and subscribe to update the contents:

From your JS Code instead of :

function onLinkClick(urlToOpen)
{
targetDiv=this.window.document.getElementById("content") ;
var xmlHttpReqObj=new XMLHttpRequest();
xmlHttpReqObj.open('GET',
"tabbedViewData.jsp?urlToOpen="+urlToOpen+"", false);
targetDiv.innerHTML="";
targetDiv.innerHTML=xmlHttpReqObj.responseText;
}

Try:

function onLinkClick(urlToOpen)
{
jmaki.publish("/jmaki/tab/setInclude", { targetId : "conf", value : urlToOpen});
}

For more details on what you can do with all the different jMaki Widgets with regardds to setting contents see:

http://wiki.java.net/bin/view/Projects/jMakiMultiViewContainerDataModel

Let me know if this doesn't work for you.

Regards,

-Greg

msreekanth
Offline
Joined: 2006-01-31

Thanks Greg that worked fine.But what if I wanted to send some data(POST request) to the target page.

Can you please kindly point me to good docs where I could get the basics right.