For Each Child in Controls

To clear all the checkboxes on a form, I can do either this:
        Dim chk As CheckBox
        For Each ctl As Control In Controls
            If TypeOf ctl Is CheckBox Then
                chk = CType(ctl, CheckBox)
                chk.Checked = False
            End If
        Next ctl
Or this:
        For Each chk As CheckBox In Controls.OfType(Of CheckBox)()
            chk.Checked = False
        Next chk
However, this will not clear checkboxes inside a container such as a groupbox.
How can I clear the checkboxes in all the containers at once?
Solitaire

Excess code in examples which use recursive control searches.
Top and bottom examples may be best. 2nd and 3rd examples have code but I don't understand the ienumerable functions used really. They're over my head.
If all controls were added to a List(Of Control) in form load using a recursive search then just the list could be used to set controls of certain types I would guess. Which would keep from requiring a recursive search of controls each time. Unless
controls are dynamically added and removed while the app is running I suppose.
Option Strict On
Public Class Form1
Dim ObjColorDict As New Dictionary(Of String, Color)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.CenterToScreen()
ObjColorDict.Add("Me", Me.BackColor)
Me.BackColor = Color.White
For Each Item As Control In Me.Controls
If Item.BackColor <> Nothing Then
ObjColorDict.Add(Item.Name, Item.BackColor)
Item.BackColor = Color.White
GetAllChildControls(Item)
End If
Next
For i = 0 To ObjColorDict.Count - 1
RichTextBox1.AppendText(ObjColorDict.Keys(i).ToString & " Color = .. " & ObjColorDict.Values(i).Name.ToString & vbCrLf)
Next
End Sub
Private Sub GetAllChildControls(ByVal ctrlParent As Control)
For Each Item As Control In ctrlParent.Controls
If Item.BackColor <> Nothing Then
ObjColorDict.Add(Item.Name, Item.BackColor)
Item.BackColor = Color.White
End If
' If the control has children,
' recursively call this sub
If Item.HasChildren Then
GetAllChildControls(Item)
End If
Next
End Sub
End Class
Option Strict On
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.CenterToScreen()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For Each RdoButton As RadioButton In Me.Controls.Cast(Of Control).SelectMany(Function(ctrl) GetAll(ctrl, GetType(RadioButton)).Concat(Me.Controls.Cast(Of Control)).Where(Function(c) c.[GetType]() = GetType(RadioButton)))
RdoButton.Checked = False
Next
End Sub
Public Function GetAll(control As Control, type As Type) As IEnumerable(Of Control)
Dim controls = control.Controls.Cast(Of Control)()
Return controls.SelectMany(Function(ctrl) GetAll(ctrl, type)).Concat(controls).Where(Function(c) c.[GetType]() = type)
End Function
Private Sub UncheckAllRadios(ContainerControl As Control)
For Each C As Control In ContainerControl.Controls
If C.Controls.Count > 0 Then
UncheckAllRadios(C)
End If
If TypeOf C Is RadioButton Then
DirectCast(C, RadioButton).Checked = False
End If
Next
End Sub
Private Sub ClearForm(ByVal ctrlParent As Control)
Dim ctrl As Control
For Each ctrl In ctrlParent.Controls
If TypeOf ctrl Is TextBox Then
ctrl.Text = ""
End If
' If the control has children,
' recursively call this function
If ctrl.HasChildren Then
ClearForm(ctrl)
End If
Next
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
For Each RdoButton As RadioButton In Me.Controls.Cast(Of Control).SelectMany(Function(ctrl) GetAll(ctrl, GetType(RadioButton)).Concat(Me.Controls.Cast(Of Control)).Where(Function(c) c.[GetType]() = GetType(RadioButton)))
RdoButton.Checked = False
Next
End Sub
End Class
Option Strict On
Public Class Form1
Dim TableLayoutPanelList As New List(Of TableLayoutPanel)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Location = New Point(CInt((Screen.PrimaryScreen.WorkingArea.Width / 2) - (Me.Width / 2)), CInt((Screen.PrimaryScreen.WorkingArea.Height / 2) - (Me.Height / 2)))
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For Each Item As TableLayoutPanel In Me.Controls.Cast(Of Control).SelectMany(Function(ctrl) GetAll(ctrl, GetType(TableLayoutPanel)).Concat(Me.Controls.Cast(Of Control)).Where(Function(c) c.[GetType]() = GetType(TableLayoutPanel)))
Dim ContainsItem As Boolean = False
If TableLayoutPanelList.Count = 0 Then TableLayoutPanelList.Add(Item) : ContainsItem = True
If TableLayoutPanelList.Count > 0 Then
For i = 0 To TableLayoutPanelList.Count - 1
If TableLayoutPanelList(i) Is Item Then
ContainsItem = True
End If
Next
End If
If ContainsItem = False Then
TableLayoutPanelList.Add(Item)
Else
ContainsItem = False
End If
Next
End Sub
Public Function GetAll(control As Control, type As Type) As IEnumerable(Of Control)
Dim controls = control.Controls.Cast(Of Control)()
Return controls.SelectMany(Function(ctrl) GetAll(ctrl, type)).Concat(controls).Where(Function(c) c.[GetType]() = type)
End Function
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
RichTextBox1.Clear()
If TableLayoutPanelList.Count > 0 Then
For Each Item In TableLayoutPanelList
RichTextBox1.AppendText(Item.Name & vbCrLf & " " & Item.BackColor.Name.ToString & vbCrLf)
Next
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
For Each Item As ColumnStyle In TableLayoutPanel1.ColumnStyles
RichTextBox1.AppendText(Item.SizeType.ToString & vbCrLf & " " & Item.Width.ToString & vbCrLf)
Next
End Sub
End Class
Option Strict On
Public Class Form1
Dim FormControlsList As New List(Of Control)
Dim TblLoutPanel As TableLayoutPanel
Dim TblLoutPanelsAdded As TableLayoutPanel
Dim ColorNames As New List(Of String)
Dim ColorName As System.Type = GetType(System.Drawing.Color)
Dim ColorPropInfo As System.Reflection.PropertyInfo() = ColorName.GetProperties()
Dim Rand As New Random
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Location = New Point(CInt((Screen.PrimaryScreen.WorkingArea.Width / 2) - (Me.Width / 2)), CInt((Screen.PrimaryScreen.WorkingArea.Height / 2) - (Me.Height / 2)))
For Each CPI As System.Reflection.PropertyInfo In ColorPropInfo
If CPI.PropertyType.Name = "Color" And CPI.Name <> "Transparent" Then
ColorNames.Add(CPI.Name)
End If
Next
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Button1.Enabled = False
TblLoutPanel = New TableLayoutPanel
With TblLoutPanel
.Name = "TableLayoutPanel1"
.Size = New Size(400, 400)
.GrowStyle = TableLayoutPanelGrowStyle.FixedSize
.CellBorderStyle = TableLayoutPanelCellBorderStyle.InsetDouble
.Left = 20
.Top = Button1.Bottom + 20
.ColumnCount = 3
.RowCount = 3
.RowStyles.Clear()
.ColumnStyles.Clear()
For i = 0 To .ColumnCount - 1
.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33!))
Next
For i = 0 To .RowCount - 1
.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33!))
Next
.BackColor = Color.FromName(ColorNames(Rand.Next(0, ColorNames.Count)))
End With
Me.Controls.Add(TblLoutPanel)
For i = 2 To 10
TblLoutPanelsAdded = New TableLayoutPanel
TblLoutPanelsAdded.Name = "TableLayoutPanel" & i.ToString
With TblLoutPanelsAdded
.Size = New Size(100, 100)
.GrowStyle = TableLayoutPanelGrowStyle.FixedSize
.CellBorderStyle = TableLayoutPanelCellBorderStyle.OutsetDouble
.Anchor = AnchorStyles.None
.ColumnCount = 2
.RowCount = 2
.RowStyles.Clear()
.ColumnStyles.Clear()
For j = 0 To .ColumnCount - 1
.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33!))
Next
For j = 0 To .RowCount - 1
.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33!))
Next
.BackColor = Color.FromName(ColorNames(Rand.Next(0, ColorNames.Count)))
End With
For Each ctl As Control In Me.Controls.OfType(Of TableLayoutPanel)()
If ctl.Name = "TableLayoutPanel1" Then
ctl.Controls.Add(TblLoutPanelsAdded)
End If
Next
Next
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
FormControlsList.AddRange(RecursiveControlSearch(Me).ToArray)
End Sub
Private Function RecursiveControlSearch(ByRef Ctl As Control) As List(Of Control)
Dim Temp As New List(Of Control)
For Each Item As Control In Ctl.Controls
Temp.Add(Item)
GetAllChildControls(Item)
Next
Return Temp
End Function
Private Sub GetAllChildControls(ByVal ctrlParent As Control)
For Each Item As Control In ctrlParent.Controls
FormControlsList.Add(Item)
If Item.HasChildren Then
GetAllChildControls(Item)
End If
Next
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
RichTextBox1.Clear()
For Each Item In FormControlsList
RichTextBox1.AppendText(Item.Name & vbCrLf)
Next
End Sub
End Class
La vida loca

Similar Messages

  • I recently purchased 2 iPad2's for my children. I currently have my own apple id and have successfully setup 2 more for each child. I have setup one iPad with the one apple id, but the second iPad has me apple id on it. How can I change the apple id on th

    Santa recently purchased 2 iPads for my kids.
    I currently have my own apple id for my iphone.
    I have created 2 aple ids for each child and succesfully setup one iPad with one of the new apple ids, but the other iPad has my own apple id.
    Can I change the apple id on a device (iPad 2)? And how?

    You sign off and sign in with the correct Apple ID.
    See this tip and is still valid for IOS 6
    iOS 5 & iCloud Tips: Sharing an Apple ID With Your Family

  • HT5646 should I set up a different account for each child?  if so, how do I manage itunes money between two kids?

    should I set up a different apple account for each child?  if so, how do I manage itunes money between two kids?

    Hello staatsfamily,
    Having a separate Apple ID for each child will allow each child to keep their purchases and iCloud information separate.  It will also allow you to provide an iTunes Store Allowance for each child:
    With iTunes Allowance, you can send a monthly iTunes Store credit to anyone with an iTunes Store account. It's a great way for parents to manage their children's spending on the iTunes Store, App Store, and iBooks Store.
    Once you have created an Apple ID for each child, you can provide an iTunes Store allowance to each Apple ID. The following article will guide you in how to set this up:
    iTunes Store Allowance
    http://support.apple.com/kb/ht2105
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Open dialog box window with checkboxes for each child record - Please Help

    Hello Everybody
    I have a 10g form with master record and 20 child records. In the child record form, currently there is a “Notes” Editor, which pops up when user click the “Edit” button. In the “Notes” editor, user enters remarks if anything is missing. For example, typical remarks will be: Statement is missing, LOC paper is missing etc.
    Now, I would like to replace “Notes” editor with a dialog box. In the dialog box , I would like to add checkboxes with values “Statement is missing” and “LOC paper is missing” etc. along with “Notes” field. The user can select checkboxes. The value of the checkboxes should go in the “Notes” field with the ability to edit it. This way, user doesn’t need to type the most common notes every time.
    I have created a “NewNotes” dialog box with checkboxes and multiline text Item. It is pops up when I click on the button. I have also created to WHEN_CHECKBOC_CHANGED trigger for each checkboxes so that the its value will go in a multiline text item.
    But, I am not sure how I can link “NewNotes” dialog box to the each record in child record block. I would really appreciate it if anybody could give me some idea.
    Thanks,

    if i understand correctly you have a note item (based on table) on every child record? when you open the dialog box: how do you put data from notes to dialog box? in the same way as you can write it back ...

  • Is it possible to create an iPhoto slideshow with a menu for each child?

    I want the DVD to open with three photos: Karen's, Lori's and Amy's.
    When Karen clicks her photo, three more of her photos will appear: a baby photo, a school-age photo, and an adult photo. If she wants to watch a slideshow of her baby pictures, she will click the baby photo...
    Each daughter will have a similar setup - three slideshows for each of them. I'm not very picky about which theme will do the job.
    I have checked two books and the Apple tutorial and can't find a similar example.
    This is only my second slideshow. Any help will be appreciated!
    Flat Panel iMac (still love it) w/superdrive   Mac OS X (10.4.4)   iLife'06, 512 mb ram, 200 GB and 250 GB hard drives, wireless network

    Yes this can be done.
    First create the 9 slideshows you need in iPhoto......for each one, when finished use the "Send to iDVD" to create a QT movie of each slideshow......be sure to pick the music/playlist in iPhoto (unless you want to use iMovie for that and other things...). When iDVD opens, just close it without saving.
    Then open iDVD and choose a menu. As an example, choose "Portfolio Color". Retitle it to "Daughters" or whatever you want.
    Then click on the "+" sign at the lower left, and choose "add submenu" -do this two more times yo get three folders. Then click on the media button, and choose three photos to use as a button instead of the folder. Just drag each photo onto the folder. Rename each submenu to Karen, Lori and Amy. Click once on the text, wait, then click again and edit.
    Then double click on one submenu. Drag in the correct three iPhoto movies you exported using the "Send to iDVD" command. By default, they go to your home directory in the Movies folder. You can also find them using the Media tab in iDVD and look for Movies.
    Go back to the "Main" menu using the back arrow (double click on it).
    Repeat for the other two submenus.
    Hope this helps,
    John B

  • Invoking BPEL partnerlink each for one child node

    Hi
    I have a requirement for invoking partnerlink (DB Adapter) for each child node of input message of BPEL service! E.g. I have to update or insert an employee! I received list of of employees in input message like below.
    <employee_list>
         <employee>
              <name> Ram </name>
              <Age> 21 </Age>
              <dept> IT </dept>
              <isNew>N</isNew>
         </employee>
         <employee>
              <name> Hari </name>
              <Age> 21 </Age>
              <dept> IT </dept>
              <isNew>Y</isNew>
         </employee>
    </employee_list>
    So the requirement is to call DB_Call partnerlink for each employee node in above!
    Is this possible in BPEL? If yes, how?
    Thanks In Advance
    Priyadarshi

    Yes you can, use a fo reach loop in bpel, loop for the count of employee, then have an if condition to check whether you want to update or insert for and use invoke node to call the appropriate operation.I hope you have gone through the upsert operation in database adpater which automatically supports insert or update. If a record is present it updates else inserts a new one.

  • Connect by query, need root element for each row

    Hi,
    I am working on a hierarchical query, using connect by prior. Each node in the tree has two properties, an type and a sequence.
    The table that contains the hierarchy has 4 fields:
    element_type_from
    element_sequence_from
    element_type_to
    element_sequence_to
    Each child has one parent, a parent can have multiple childeren. For a leaf, the fields element_type_to and element_sequence_to are null.
    To generate a tree you can run:
    select element_type_to
    ,      element_sequence_to
    from   element_hierarchy
    start with element_type_from = [root_element_type]
           and element_sequence_from = [root_element_sequence]
    connect by prior element_type_to = element_type_from
           and prior element_sequence_to = element_sequence_fromThat works fine... however... not only do I want the child elements, I would like to return the root element sequence for each child (in our table the root element type is always the same). There are multiple root elements and I want to create a list containing all trees and each node in the tree must have its root as well.
    There is the option of using sys_connect_by_path. This returns the root, but also the entire path to the current child. Also it returns a varchar2, that needs to be substr-ed and to_number-ed to get to the sequence... not nice.
    warning, extremely ugly (but functional) code:
    select element_type_to
    ,      element_sequence_to
    ,      to_number(substr(sys_connect_by_path(element_sequence_from ,','),2,instr(sys_connect_by_path(element_sequence_from ,',') ||',',',',2)-2)) root_sequence
    from   element_hierarchy
    start with element_type_from = [root_element_type]
           and element_sequence_from = ( select [root_element_sequence] from all_root_elements )
    connect by prior element_type_to = element_type_from
           and prior element_sequence_to = element_sequence_fromThere has to be a simple solution that I am missing here! Can you help?
    Edit: Oops, database version is 10.2.0.4.0

    Hi,
    What you posted was actually the best way to do it in Oracle 9.
    Since you're using Oracle 10, you can use CONNECT_BY_ROOT, as William said:
    select element_type_to
    ,      element_sequence_to
    ,      connect_by_root element_sequence_from  AS root_sequence          -- Changed
    from   element_hierarchy
    start with element_type_from = [root_element_type]
           and element_sequence_from = ( select [root_element_sequence] from all_root_elements )
    connect by prior element_type_to = element_type_from
           and prior element_sequence_to = element_sequence_from 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables, and the results you want from that data.
    Explain how you get those results from that data.

  • Tree Control Property Node for Accessing "Child Text" String Array

    When adding items to a tree control using the EditTreeItems invoke nodes, the inputs include "Child Tag", "Item Indent", "Child Only?", "Glyph Index", "Child Text", and "Left Cell String" as can be seen in this screenshot.
    There are property nodes for the tree control for accessing each of these elements, except for the "Child Text", which is an array of strings. It is possible to access this data as outlined in this forum post, but this method is somewhat involved and round about. 
    I suggest that a property for the Tree class be created to access the Child Text array directly.

     The work around only works if you do not have an empty string element some where in the middle.
    At lest could the "Active Celltring Property" read return an error when you have gone beyond the end of the array.

  • How to use Generic Object Services(GOS) for each table control record.

    Dear Expert,
                       I am using generic object services for document attachment but i am facing a problem while attaching document to a table control row. my requirement is to attach separate document for each and every row of table control but  i am unable to attach document row wise of the table control.for each row GOS should display corresponding attached document not all the attached document.
    Thanks in Advanced
    Bhuwan Tiwari
    Edited by: BHUWAN TIWARI on Feb 8, 2011 4:16 PM
    Edited by: BHUWAN TIWARI on Feb 8, 2011 4:16 PM

    You haven't explained what object and object key you're using, nor have you provided any indication of how you implemented the GOS attachment functionality.  You need to provide more information to resolve an issue like this.

  • Different values in a list box for each row of the table control...

    Dear Experts,
    Is it possible to populate different values for each row in a listbox inside a table control ?
    Example,
    Row 1 in the the table contains A, B & C
    Row 2 in the same table contains C, D & E
    If yes, How?
    yes i am using
      call function 'VRM_SET_VALUES'
        exporting
          id     = i_name
          values = i_list.
    Thank you .
    Message was edited by:
            Kokwei Wong
    Message was edited by:
            Kokwei Wong

    Hi Wong,
    this is code example for listbox
    TYPE-POOLS vrm .
    DATA: lt_vrm_values TYPE TABLE OF vrm_value.
    DATA: wa_vrm_values TYPE vrm_value.
    PARAMETER p_list AS LISTBOX VISIBLE LENGTH 10.
    INITIALIZATION.
      wa_vrm_values-key = 'Key1'.
      wa_vrm_values-text = 'Value1'.
      APPEND wa_vrm_values TO lt_vrm_values.
      wa_vrm_values-key = 'Key2'.
      wa_vrm_values-text = 'Value2'.
      APPEND wa_vrm_values TO lt_vrm_values.
      wa_vrm_values-key = 'Key3'.
      wa_vrm_values-text = 'Value3'.
      APPEND wa_vrm_values TO lt_vrm_values.
    AT SELECTION-SCREEN OUTPUT.
      CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id              = 'P_LIST'
                values          = lt_vrm_values
           EXCEPTIONS
                id_illegal_name = 1
                OTHERS          = 2.
      IF sy-subrc  0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    To fill it with data from DB, just do select in INITIALIZATION and put that values with same alghoritmus.
    Manas M.
    P.S.: This is very easy question, you should use search ...

  • Tree control tip strip for each item

    In tree control is possible set a Tip strip for each item (node) of tree?
    In tree control  tipStrip property seems relative to all tree.
    Thanks all.

    The only thing I can think of is to use an event structure
    use a mouse move event
    Get Cords
    Calculate what item the mouse is over
    Use a Tips property node to write the correct string.
    The hard part will be calculating what item the mouse is over, The Displayed Items property node should help.
    I am actively working on a program that is centered around a tree control and might like to do the same.
    If you need further help reply back 
    Omar

  • Adding a check box control for each row of data in a DataModel

    Hi all,
    I need to add a checkbox control for each row of data on a DataModel object.
    I have a "commandButton" at the bottom of DataModel, and whenever someone checks some of the rows on that list of rows,
    I need to get the selected dataModel(fragment of the list) in my backing bean.
    How do I achieve this functionality in JSF?
    Thanks,
    Meghasyam.

    Hi all,
    I need to add a checkbox control for each row of data
    on a DataModel object.
    I have a "commandButton" at the bottom of DataModel,
    and whenever someone checks some of the rows on that
    list of rows,
    I need to get the selected dataModel(fragment of the
    list) in my backing bean.
    How do I achieve this functionality in JSF?
    Thanks,
    Meghasyam.You'll want to have a wrapper class as suggested above, which has a "selected" boolean in it. Then use the "binding" attribute of the h:selectBooleanCheckbox component to bind the checkbox to that property... Make the property public and specify the properties exact name in the binding... bindings do not append "get" to the EL.
    Here is an example of what your table might look like... This code would display the list of names with a checkbox to the left of each name... When the check box is selected, the "selected" property of that wrapper class is set to true or false as needed. Then when the form is submitted, and you are inside your actionListener or action method call, you can look through your collection of wrapper classes asking each one if it was selected or not... Then do whatever you want with them... In this example, replace "myBackingBean" with the name of your backing bean, and "names" with the name of the method in your backing bean which returns the collection of wrapper classes... create a flag "public boolean selected" or similar in your wrapper class..
    <h:dataTable id="namestable"
    value="#{myBackingBean.names}"
    var="aName">
    <h:column>
    <h:selectBooleanCheckbox binding="#{aName.selected}"/>
    <h:outputText value="#{aName.nameText}"/>
    </h:column>
    </h:dataTable>
    Let me know if that isn't clear enough and I'll see if I can find a better way to explain it...
    -Garrett

  • How to append parameter with URL for each record in table control?

    Hi,
    I have one table control which contains 5 columns.
    (tripno, startdate, destination, reason, activities)
    In 5th column, i need to display URL for each record.
    for ex:
    www.abc.com/test?tripno=1
    www.abc.com/test?tripno=2
    www.abc.com/test?tripno=3
    when user clicks a particular hyperlink, it navigates to another page/component thru URL with one key field(tripno) to retrieve related records in next page.
    1) i am not able to assign tripno to each record. when i assign tripno, its taking the last value which i assigned. ie. tripno=3 only.
    How to assign URL to Reference field of LINK_TO_URL element at run time?
    OR
    2) we can do like this.
    Simply assign url to reach record without key field.
    www.abc.com/test
    www.abc.com/test
    www.abc.com/test
    when user clicks a particular link, we can assign corresponding key field to the URL.
    Where should i write this event? Bcoz, LINK_TO_URL doesnot have event.
    how to do?

    Hi MOg.
    Not sure whether I understand you .. but in the 5th column you want to have the reference URL. Is this the activities columen from you example?
    Nevertheless, you need a attribute (String) in your context node which contains the URL. Bind this to the reference filed of linktourl. If you can not extend the structure you can create a sub node (cardinality 1:1)  which contains the refernce attribute.
    Then loop over all elements and concatenate www.abc.com/test?tripno= with the tripno of the current element into the reference field.
    Hope tis helps,
    Sascha.
    Bind the

  • Controling For Each

    Hy people! i have one doubt! i have a xml that have 10 purchase orders. i use this command to get duplicated purchase orders <?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,var,1)?> . In layout i have 20 purchase orders. the first 10 are the original and the last 10 are duplicated! my doubt are: i want to put the "original" in the first 10 purchase orders and "duplicate" in the last 10 purchase orders . i try this with position() command but i cant control the foreach. when i have only one purchase orders it works fine . the problem is when my xml have more rhan 1.
    someone have any suggestion? any help would be appreciated.

    Hi Stuart
    I read again your question.
    Do you mean that the longer your program is running, the more time it takes to stop the execution once you hit a "stop button" that effects your while continuation ?
    If you really have such a central "button" it might be a problem with memory. D you have a way to monitor the memory usage, like with the Windows task manager ?
    If you have a problem with memory, check what is going into your loops. Labview has sometimes not very obvious ways to create local variables or references, that are not automatically destroyed.
    Again a sample vi would help. It's just that I have only LV 6.0.
    Gabi
    7.1 -- 2013
    CLA

  • Main vi with control for each vi

    Hello,
    I have a set of VIs that I am trying to be able to call from a main vi. The main vi front panel is just a set of boolean controls. The block diagram for the main vi is a single while loop that contains all the controls which are each wired to a case structure that calls each vi when set to true. There is a different VI being called for each control and case structure. The loop has a condition of continue while true which is wired to constant true which is outside the loop of course. I have also tried the same with a timed loop, but either way it is very basic indeed.
    Now when I run it, I can press one control and it will then start up the vi front panel that I selected. That's fine, but then after that, when I press another control on the main VI, nothing happens. Another thing I noticed is that if I turn ON all the controls and then run it, they will all work, meaning all VI front panels selected will appear.
    The issue is that when one or more controls are set to true and the respective VIs are called, it seems that the loop that controls all the VIs is no longer running. I would like to be able to select one VI, and then continue to select another VI and so forth.
    Any help would be greatly appreciated.
    Thank you

    I would still consider dynamic launching of the subvi instead of making many loops, one for each subvi.  The issue you will find (although the many loops is conceptually easier) will be in scalability,  What happens if you want to launch 20 loops, are you going to drop 20 loops on your Block diagram, also what happens if you want to take advantage of the event structure (you really want to do this if you plan on a GUI of any complexity) you can put the event structure in  each loop which will cause you to have to poll each loop and then you will need to do tempo control in each loop.  From a readability stand point a single loop with an event case that launches the subvi is veary easy to follow as well.  This is just my opinion though.
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

Maybe you are looking for