| Project: | formsPlayer |
| Version: | 1.6.1030-dev |
| Component: | User interface |
| Category: | support |
| Priority: | normal |
| Assigned: | abb |
| Status: | new |
I have a general question irrespective of the formsplayer version..I want to know how to move the highlight that appears on the repeat items to the newly added entry..
i,e say when I use a button to trigger adding a new item then I want the background highlight to move to that item. How can I accomplish that ?
Regards
Nirmal
Updates
You can use the xf:setindex element along with CSS (class .repeat-index) to do what you require. See the XForms specification for a description of the setindex element.
An example piece of CSS would be:
.repeat-index
{
background-color : yellow;
}
I already have the class defined in our css, but the setIndex doesn't seem to work. I have to manually select the newly added entry using the mouse inorder for the background color to appear and the row to be selected. What am I doing wrong ?
Regards
Nirmal
Please check our self contained application that we provided and go to any of the items on the Trading sub menu and select any menu item and click on the "Add" or "Add Step" button and you will see that the highlight doesn't move to the new entry. (Although you will not find the setIndex element in the action, but we tried it out here and it didn't work. You can try it by adding the setIndex at your end to see if it works) You can check the market_gui.css under the css directory to see that it has the .repeat-index class defined with a background-color of blue.
Regards
Nirmal
Could we get some feedback on this .
Thanks
| Attachment: | repeat_index_insert_highlight.html (5.13 KB) |
The attached file shows how to insert a new node into a xf:repeat and highlight the inserted node.
Hi
I understand what you are trying to show in the example. Our stuff is pretty close to that except we use the index() function for the "at" attribute of the xf:insert element, since we need
the insert to happen based on the currently selected repeat items position or index.
I basically want to insert to the position next to the currently selected index
so basically I replaced at="number(instance('inst-insert')/insert_index)" in your example to at="index('rpt_fund_split') + 1" (which is how we have the at attribute set) and it behaves the same as our stuff where the cursor just stays at the first repeat item.
Regards
Nirmal
oops please ignore the previous comment ..I made a mistake..
I am still trying to figure out why our stuff aint working. am not sure if it is any kind of styling problem causing it...The best way for you to help us out is to check our example app that we had provided.
Hi Alex,
I tried to attach the zip file but your site wouldn't take it. So I will send it to Paul Butcher (since I have his email id), and have him send it to you.
The zip file contains all the files necessary to run my xforms page. I have modified my pages so that it is simpler for you to test. Just unzip the attachment into a directory and open the file capacity_trade.htm in your browser and click on "Details" Section and the case will be made visible and click on the "Add" button and ypu will see that the blue highlight always stays at the first index as we keep clicking on the "Add" button. The css file is part of the zip file and you can check the styling there and also you can look search for "rtx1Sub" in the capacity_trade.htm which is the id for the repeat that ain't working properly.
Please let meknow what the issue is.
Regards
Nirmal
Alex,
Please ignore the above comment. I kind of figured out the issue
Thanks
Nirmal
I was using instead of
Regards
Nirmal
oops the xml tags don't show up..this is how i messed up
I was using xf:setindex id ="rtx1Sub" index="index('rtx1Sub')+1"/ instead of xf:setindex repeat="rtx1Sub" index="index('rtx1Sub')+1"/

Recent comments
14 weeks 3 days ago
14 weeks 3 days ago
18 weeks 13 hours ago
19 weeks 3 days ago
19 weeks 3 days ago
19 weeks 4 days ago
19 weeks 6 days ago
19 weeks 6 days ago
19 weeks 6 days ago
19 weeks 6 days ago