Hi all, I have been using this tab view XBL Component and I know that we can switch the tab using the following action: <xforms:dispatch targetid="my-tab" name="fr-toggle"/> I would like some suggestions for the following situations: 1)The form has some external and internal tabs. When the user clicks the next or previous button, it should switch the tab. But how can I know the id of the next or previous tab? 2) How can I get the id of the current tab? I should also be able to change the name of the current tab, remove the current tab or add a new tab after this current tab. -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Inanda,
I imagine that the buttons that switch to the previous/next tab are outside of the tabview. The problem is in knowing what tab the user switched to. You would do this by listening for fr-select, but right now you can only do so by placing the listener inside the <fr:tab>. So unfortunately, you need to put one such listener for each tab, and store the current tab id in an instance. Then, assuming you are using tab ids like my-tab-1, my-tab-2…, knowing what the current tab "position" is, your previous/next button can send an <xforms:dispatch targetid="my-tab-{current-position + 1}" name="fr-toggle"/> (or -1). Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi Alessandro,
Thanks, I have used this select event to store the current tab. About the next and previous tabs, I have stored it in an instance. So, I could get the next and previous using the id of the current tab. And it worked. :) But I should also be able to create and remove tabs dynamicaly, and this is the tricky part. First because I can't dynamically generate tabs by using an xforms:repeat around fr:tab. The component does not support it. And second because even if the component support it, I should be able to add the new tab id to the instance that I use to know which one is my previous and next tab. Otherwise my solution to switch tabs would not work. |
Administrator
|
Inanda,
I am not sure that I completely understand how dynamic your situation is. The <fr:tab> can be bound to a node that you can make non-relevant to hide the tab dynamically. Then of course if tab-3 is hidden, you're on tab-2 and press "next", that button needs to figure out that it needs to go to tab-4, but this is all under your control. Is there something that I'm missing? Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
The tab is not hidden, i.e. it does not exist yet. There is a button to create as much tabs as the user want and another button to remove it if necessary. Those new tabs are a copy of my current tab. |
Administrator
|
Hi Inanda,
So it looks like the main limitation here is that the fr:tabview yet doesn't support repeats. Most likely, this is something we will implement in the next few month (as we need it in Form Builder, where we are going to add support for tabs). If you need this now, you could be extend it yourself, if you'd like to get into XBL. Or you could use an alternative UI; do you have an alternative UI not using tabs that could work in your case? Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi Alessandro,
It can not be an alternative UI. It should be using tabs. We are also using the form builder, but I have created a XSLT to convert sections in internal or external tabs before show the page to the user. So, I guess the only way is to extend this XBL component. You were who implemented this component, right? I know that there is the documentation about XBL in Orbeon site, but I guess I need something else. If you have any good XBL documentation that you have used. It would be good to me. |
Administrator
|
Hi Inanda,
Smart. The only way is to extend the XBL component. And I don't want to make it sound like it is rocket science, but this is not the easiest XBL component to start with either. The issue is that the component uses XSLT to iterate over fr:tabs, and XSLT only runs when the page is generated. Instead, we'll need to use XForms for that, which makes things a bit more complicated. See the source of the component at: https://github.com/orbeon/orbeon-forms/blob/master/src/resources-packaged/xbl/orbeon/tabview/tabview.xbl To learn XBL, I would go through the "Guide to Using and Writing XBL Components" (link below), and especially read through the code of existing component. And if you have questions, feel free to ask here. http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |