Generate gridview dynamically with headers in metro application using C# and XAML - xaml

There is no fixed number of columns. It will come from web service dynamically. How to design and bind gridview this way.

Try Following Way:
Dim sb As New StringBuilder
sb.Append("<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">")
sb.Append("<StackPanel Orientation=""Horizontal"">")
sb.Append("<Grid>")
sb.Append("<Grid.ColumnDefinitions>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("<ColumnDefinition Width=""auto""></ColumnDefinition>")
sb.Append("</Grid.ColumnDefinitions>")
sb.Append("<Grid.RowDefinitions>")
sb.Append("<RowDefinition Height=""50""></RowDefinition>")
sb.Append("</Grid.RowDefinitions>")
sb.Append("<Border Grid.Column=""0"" BorderThickness=""1,0,1,0"" BorderBrush=""White"">")
sb.Append(" <Button x:Name=""imgEdit"" Grid.Column=""0"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" Height=""30"" Width=""37"" Click=""EditInventory"" >")
sb.Append("<Button.Background>")
sb.Append("<ImageBrush Stretch=""Fill"" ImageSource=""{Binding pencil}"" ></ImageBrush>")
sb.Append("</Button.Background>")
sb.Append("</Button>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""1"" BorderThickness=""1,0,1,0"" BorderBrush=""White"" >")
sb.Append("<TextBlock x:Name=""lblSrNo"" Text=""{Binding serial}"" FontSize=""15"" Grid.Column=""1"" Foreground=""{Binding RForeColor}"" FontFamily=""arial"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" Width=""35"" TextAlignment=""Right"" Padding=""1,0,2,0""></TextBlock>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""2"" BorderThickness=""1,0,1,0"" BorderBrush=""White"" >")
sb.Append("<TextBlock x:Name=""lblDescription"" Text=""{Binding a3}"" Loaded=""lblDesc_Loaded"" Width=""365"" FontSize=""15"" TextWrapping=""Wrap"" Grid.Column=""2"" Grid.Row=""0"" Foreground=""{Binding RForeColor}"" FontFamily=""arial"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" Padding=""2,0,1,0""></TextBlock>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""3"" Loaded=""SizeBorderDispaly"" BorderThickness=""1,0,1,0"" BorderBrush=""White"" >")
sb.Append("<TextBlock x:Name=""lblSize"" Loaded=""SizeDispaly"" TextWrapping=""Wrap"" Text=""{Binding size}"" Width=""90"" FontSize=""15"" Grid.Column=""3"" Foreground=""{Binding RForeColor}"" FontFamily=""arial"" HorizontalAlignment=""Right"" VerticalAlignment=""Center"" Padding=""2,0,1,0""></TextBlock>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""4"" Loaded=""DepartmentBorderDisplay"" Visibility=""Collapsed"" BorderThickness=""1,0,1,0"" BorderBrush=""White"" >")
sb.Append("<TextBlock x:Name=""lblDepartment"" Visibility=""Collapsed"" Loaded=""DepartmentDisplay"" TextWrapping=""Wrap"" Text=""{Binding dept_desc}"" Width=""90"" FontSize=""15"" Grid.Column=""4"" Foreground=""{Binding RForeColor}"" FontFamily=""arial"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" Padding=""2,0,1,0""></TextBlock>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""5"" BorderThickness=""1,0,1,0"" BorderBrush=""White"">")
sb.Append("<TextBox x:Name=""txtQty"" TextAlignment=""Right"" Text=""{Binding a5, Mode=TwoWay}"" GotFocus=""txtQty_GotFocus"" LostFocus=""txtQty_LostFocus"" Width=""30"" FontSize=""15"" Grid.Column=""5"" Height=""30"" Foreground=""Black"" FontFamily=""arial"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" InputScope=""Number""></TextBox>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""6"" BorderThickness=""1,0,1,0"" BorderBrush=""White"" >")
sb.Append("<TextBlock x:Name=""txtPrice"" TextAlignment=""Right"" Text=""{Binding a6, Mode=TwoWay}"" Loaded=""lblDecimalValue_Loaded"" Width=""80"" FontSize=""15"" Grid.Column=""6"" Foreground=""{Binding RForeColor}"" FontFamily=""arial"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" Padding=""1,0,2,0""></TextBlock>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""7"" BorderThickness=""1,0,1,0"" BorderBrush=""White"" >")
sb.Append("<TextBlock x:Name=""lblDisc"" TextAlignment=""Right"" Text=""{Binding a7}"" Width=""70"" FontSize=""15"" Grid.Column=""7"" Loaded=""lblDecimalValue_Loaded"" Foreground=""{Binding RForeColor}"" FontFamily=""arial"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" Padding=""1,0,2,0""></TextBlock>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""8"" BorderThickness=""1,0,1,0"" BorderBrush=""White"">")
sb.Append("<TextBlock x:Name=""lblP"" Text=""{Binding Qty}"" Width=""25"" FontSize=""15"" Grid.Column=""8"" Foreground=""{Binding RForeColor}"" FontFamily=""arial"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" TextAlignment=""Center""></TextBlock>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""9"" BorderThickness=""1,0,1,0"" BorderBrush=""White"" >")
sb.Append("<TextBlock Width=""100"" TextAlignment=""Right"" Text=""{Binding a11,Mode=TwoWay}"" x:Name=""lblExt"" FontSize=""15"" Loaded=""lblDecimalValue_Loaded"" Grid.Column=""9"" Foreground=""{Binding RForeColor}"" FontFamily=""arial"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" Padding=""1,0,2,0""></TextBlock>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""10"" Loaded=""lblBorderPts_Loaded"" BorderThickness=""1,0,1,0"" BorderBrush=""White"" >")
sb.Append("<TextBlock Width=""70"" TextAlignment=""Right"" x:Name=""lblPts"" Loaded=""lblPts_Loaded"" FontSize=""15"" Grid.Column=""10"" Text=""{Binding points}"" Foreground=""{Binding RForeColor}"" FontFamily=""arial"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" Padding=""1,0,2,0""></TextBlock>")
sb.Append("</Border>")
sb.Append("<Border Grid.Column=""11"" BorderThickness=""1,0,1,0"" BorderBrush=""White"">")
sb.Append("<Button x:Name=""imgDelete"" Width=""37"" FontSize=""17"" Grid.Column=""11"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"" Height=""30"" Click=""btnDelete_Click_1"">")
sb.Append("<Button.Background>")
sb.Append("<ImageBrush Stretch=""Fill"" ImageSource=""{Binding delete}""></ImageBrush>")
sb.Append("</Button.Background>")
sb.Append("</Button>")
sb.Append("</Border>")
sb.Append("</Grid>")
sb.Append("</StackPanel>")
sb.Append("</DataTemplate>")
Dim datatemplate As New DataTemplate
datatemplate = TryCast(XamlReader.Load(sb.ToString()), DataTemplate)
grdCustomer.ItemTemplate = datatemplate

Related

Out of memory error when adding comboboxes to userForm

I have a MS Word document which has vba macro. I have too many comboboxes in my userform. After a point i can not add a new comboboxes. When I click to view code button, it gives me out of memory error. I'm adding my userForm to below.
My vba codes are like this
Private Sub UserForm_Activate()
hpcStage4
End Sub
Private Sub hpcStage4()
Me.cmbHPC4_1.List = Array("Serviceable", "Unserviceable", "N/A per WS")
Me.cmbHPC4_2.List = Array("Serviceable", "Unserviceable", "N/A per WS")
Me.cmbHPC4_3.List = Array("Serviceable", "Unserviceable", "N/A per WS")
Me.cmbHPC4_4.List = Array("Serviceable", "Unserviceable", "N/A per WS")
Me.cmbHPC4_5.List = Array("Serviceable", "Unserviceable", "N/A per WS")
Me.cmbHPC4_6.List = Array("Serviceable", "Unserviceable", "N/A per WS")
Me.cmbHPC4_7.List = Array("Serviceable", "Unserviceable", "N/A per WS")
Me.cmbHPC4_8.List = Array("Serviceable", "Unserviceable", "N/A per WS")
Me.cmbHPC4_9.List = Array("Serviceable", "Unserviceable", "N/A per WS")
Me.cmbHPC4_10.List = Array("Serviceable", "Unserviceable", "N/A per WS")
Me.cmbHPC4_11.List = Array("Dent", "Nick", "Coating Damage", "Organic Redidues", "Dirt", "Trace", "Deposits", "Mineral Deposits", "Superficial Imperfection", "Scratch", "Scored", "Crack", "Axial Crack", "Radial Crack", "Circumferencial Crack", "Chordwise Crack", "Tip Connected Radial Crack", "Connected Loop Crack", "Full Crack", "Multi Cracks", "Tight Crack", "Burn", "Edge Burnback", "Burn Hole", "LE Burn Hole", "Burn Through Hole", "Burn Through", "Corrosion", "Discoloration", "Oxidation", "Sulphidation", "Erosion", "Blistering", "Pitting", "Peeling", "Ceramic Coating Detachment", "Missing Thermal Barrier Coating", "Tip rub", "Burr", "Curled", "Tip Curled", "Tip Corner Curled", "Missing Tip Corner", "Overlap", "Shingling", "Unlatching", "Out Of Flush", "Missing Material", "Missing Piece", "Chipped", "Flaking", "Lift Up", "Bulging", "Spalled", "Bent", "Distortion", "Tear", "Torn", "Wear", "Worn", "Plugged Air Slot", "Damper Wire Extrusion")
Me.cmbHPC4_12.List = Array("Dent", "Nick", "Coating Damage", "Organic Redidues", "Dirt", "Trace", "Deposits", "Mineral Deposits", "Superficial Imperfection", "Scratch", "Scored", "Crack", "Axial Crack", "Radial Crack", "Circumferencial Crack", "Chordwise Crack", "Tip Connected Radial Crack", "Connected Loop Crack", "Full Crack", "Multi Cracks", "Tight Crack", "Burn", "Edge Burnback", "Burn Hole", "LE Burn Hole", "Burn Through Hole", "Burn Through", "Corrosion", "Discoloration", "Oxidation", "Sulphidation", "Erosion", "Blistering", "Pitting", "Peeling", "Ceramic Coating Detachment", "Missing Thermal Barrier Coating", "Tip rub", "Burr", "Curled", "Tip Curled", "Tip Corner Curled", "Missing Tip Corner", "Overlap", "Shingling", "Unlatching", "Out Of Flush", "Missing Material", "Missing Piece", "Chipped", "Flaking", "Lift Up", "Bulging", "Spalled", "Bent", "Distortion", "Tear", "Torn", "Wear", "Worn", "Plugged Air Slot", "Damper Wire Extrusion")
Me.cmbHPC4_13.List = Array("Dent", "Nick", "Coating Damage", "Organic Redidues", "Dirt", "Trace", "Deposits", "Mineral Deposits", "Superficial Imperfection", "Scratch", "Scored", "Crack", "Axial Crack", "Radial Crack", "Circumferencial Crack", "Chordwise Crack", "Tip Connected Radial Crack", "Connected Loop Crack", "Full Crack", "Multi Cracks", "Tight Crack", "Burn", "Edge Burnback", "Burn Hole", "LE Burn Hole", "Burn Through Hole", "Burn Through", "Corrosion", "Discoloration", "Oxidation", "Sulphidation", "Erosion", "Blistering", "Pitting", "Peeling", "Ceramic Coating Detachment", "Missing Thermal Barrier Coating", "Tip rub", "Burr", "Curled", "Tip Curled", "Tip Corner Curled", "Missing Tip Corner", "Overlap", "Shingling", "Unlatching", "Out Of Flush", "Missing Material", "Missing Piece", "Chipped", "Flaking", "Lift Up", "Bulging", "Spalled", "Bent", "Distortion", "Tear", "Torn", "Wear", "Worn", "Plugged Air Slot", "Damper Wire Extrusion")
Me.cmbHPC4_14.List = Array("Dent", "Nick", "Coating Damage", "Organic Redidues", "Dirt", "Trace", "Deposits", "Mineral Deposits", "Superficial Imperfection", "Scratch", "Scored", "Crack", "Axial Crack", "Radial Crack", "Circumferencial Crack", "Chordwise Crack", "Tip Connected Radial Crack", "Connected Loop Crack", "Full Crack", "Multi Cracks", "Tight Crack", "Burn", "Edge Burnback", "Burn Hole", "LE Burn Hole", "Burn Through Hole", "Burn Through", "Corrosion", "Discoloration", "Oxidation", "Sulphidation", "Erosion", "Blistering", "Pitting", "Peeling", "Ceramic Coating Detachment", "Missing Thermal Barrier Coating", "Tip rub", "Burr", "Curled", "Tip Curled", "Tip Corner Curled", "Missing Tip Corner", "Overlap", "Shingling", "Unlatching", "Out Of Flush", "Missing Material", "Missing Piece", "Chipped", "Flaking", "Lift Up", "Bulging", "Spalled", "Bent", "Distortion", "Tear", "Torn", "Wear", "Worn", "Plugged Air Slot", "Damper Wire Extrusion")
Me.cmbHPC4_15.List = Array("Dent", "Nick", "Coating Damage", "Organic Redidues", "Dirt", "Trace", "Deposits", "Mineral Deposits", "Superficial Imperfection", "Scratch", "Scored", "Crack", "Axial Crack", "Radial Crack", "Circumferencial Crack", "Chordwise Crack", "Tip Connected Radial Crack", "Connected Loop Crack", "Full Crack", "Multi Cracks", "Tight Crack", "Burn", "Edge Burnback", "Burn Hole", "LE Burn Hole", "Burn Through Hole", "Burn Through", "Corrosion", "Discoloration", "Oxidation", "Sulphidation", "Erosion", "Blistering", "Pitting", "Peeling", "Ceramic Coating Detachment", "Missing Thermal Barrier Coating", "Tip rub", "Burr", "Curled", "Tip Curled", "Tip Corner Curled", "Missing Tip Corner", "Overlap", "Shingling", "Unlatching", "Out Of Flush", "Missing Material", "Missing Piece", "Chipped", "Flaking", "Lift Up", "Bulging", "Spalled", "Bent", "Distortion", "Tear", "Torn", "Wear", "Worn", "Plugged Air Slot", "Damper Wire Extrusion")
Me.cmbHPC4_16.List = Array("Dent", "Nick", "Coating Damage", "Organic Redidues", "Dirt", "Trace", "Deposits", "Mineral Deposits", "Superficial Imperfection", "Scratch", "Scored", "Crack", "Axial Crack", "Radial Crack", "Circumferencial Crack", "Chordwise Crack", "Tip Connected Radial Crack", "Connected Loop Crack", "Full Crack", "Multi Cracks", "Tight Crack", "Burn", "Edge Burnback", "Burn Hole", "LE Burn Hole", "Burn Through Hole", "Burn Through", "Corrosion", "Discoloration", "Oxidation", "Sulphidation", "Erosion", "Blistering", "Pitting", "Peeling", "Ceramic Coating Detachment", "Missing Thermal Barrier Coating", "Tip rub", "Burr", "Curled", "Tip Curled", "Tip Corner Curled", "Missing Tip Corner", "Overlap", "Shingling", "Unlatching", "Out Of Flush", "Missing Material", "Missing Piece", "Chipped", "Flaking", "Lift Up", "Bulging", "Spalled", "Bent", "Distortion", "Tear", "Torn", "Wear", "Worn", "Plugged Air Slot", "Damper Wire Extrusion")
Me.cmbHPC4_17.List = Array("Dent", "Nick", "Coating Damage", "Organic Redidues", "Dirt", "Trace", "Deposits", "Mineral Deposits", "Superficial Imperfection", "Scratch", "Scored", "Crack", "Axial Crack", "Radial Crack", "Circumferencial Crack", "Chordwise Crack", "Tip Connected Radial Crack", "Connected Loop Crack", "Full Crack", "Multi Cracks", "Tight Crack", "Burn", "Edge Burnback", "Burn Hole", "LE Burn Hole", "Burn Through Hole", "Burn Through", "Corrosion", "Discoloration", "Oxidation", "Sulphidation", "Erosion", "Blistering", "Pitting", "Peeling", "Ceramic Coating Detachment", "Missing Thermal Barrier Coating", "Tip rub", "Burr", "Curled", "Tip Curled", "Tip Corner Curled", "Missing Tip Corner", "Overlap", "Shingling", "Unlatching", "Out Of Flush", "Missing Material", "Missing Piece", "Chipped", "Flaking", "Lift Up", "Bulging", "Spalled", "Bent", "Distortion", "Tear", "Torn", "Wear", "Worn", "Plugged Air Slot", "Damper Wire Extrusion")
Me.cmbHPC4_18.List = Array("Dent", "Nick", "Coating Damage", "Organic Redidues", "Dirt", "Trace", "Deposits", "Mineral Deposits", "Superficial Imperfection", "Scratch", "Scored", "Crack", "Axial Crack", "Radial Crack", "Circumferencial Crack", "Chordwise Crack", "Tip Connected Radial Crack", "Connected Loop Crack", "Full Crack", "Multi Cracks", "Tight Crack", "Burn", "Edge Burnback", "Burn Hole", "LE Burn Hole", "Burn Through Hole", "Burn Through", "Corrosion", "Discoloration", "Oxidation", "Sulphidation", "Erosion", "Blistering", "Pitting", "Peeling", "Ceramic Coating Detachment", "Missing Thermal Barrier Coating", "Tip rub", "Burr", "Curled", "Tip Curled", "Tip Corner Curled", "Missing Tip Corner", "Overlap", "Shingling", "Unlatching", "Out Of Flush", "Missing Material", "Missing Piece", "Chipped", "Flaking", "Lift Up", "Bulging", "Spalled", "Bent", "Distortion", "Tear", "Torn", "Wear", "Worn", "Plugged Air Slot", "Damper Wire Extrusion")
Me.cmbHPC4_19.List = Array("Dent", "Nick", "Coating Damage", "Organic Redidues", "Dirt", "Trace", "Deposits", "Mineral Deposits", "Superficial Imperfection", "Scratch", "Scored", "Crack", "Axial Crack", "Radial Crack", "Circumferencial Crack", "Chordwise Crack", "Tip Connected Radial Crack", "Connected Loop Crack", "Full Crack", "Multi Cracks", "Tight Crack", "Burn", "Edge Burnback", "Burn Hole", "LE Burn Hole", "Burn Through Hole", "Burn Through", "Corrosion", "Discoloration", "Oxidation", "Sulphidation", "Erosion", "Blistering", "Pitting", "Peeling", "Ceramic Coating Detachment", "Missing Thermal Barrier Coating", "Tip rub", "Burr", "Curled", "Tip Curled", "Tip Corner Curled", "Missing Tip Corner", "Overlap", "Shingling", "Unlatching", "Out Of Flush", "Missing Material", "Missing Piece", "Chipped", "Flaking", "Lift Up", "Bulging", "Spalled", "Bent", "Distortion", "Tear", "Torn", "Wear", "Worn", "Plugged Air Slot", "Damper Wire Extrusion")
Me.cmbHPC4_20.List = Array("Dent", "Nick", "Coating Damage", "Organic Redidues", "Dirt", "Trace", "Deposits", "Mineral Deposits", "Superficial Imperfection", "Scratch", "Scored", "Crack", "Axial Crack", "Radial Crack", "Circumferencial Crack", "Chordwise Crack", "Tip Connected Radial Crack", "Connected Loop Crack", "Full Crack", "Multi Cracks", "Tight Crack", "Burn", "Edge Burnback", "Burn Hole", "LE Burn Hole", "Burn Through Hole", "Burn Through", "Corrosion", "Discoloration", "Oxidation", "Sulphidation", "Erosion", "Blistering", "Pitting", "Peeling", "Ceramic Coating Detachment", "Missing Thermal Barrier Coating", "Tip rub", "Burr", "Curled", "Tip Curled", "Tip Corner Curled", "Missing Tip Corner", "Overlap", "Shingling", "Unlatching", "Out Of Flush", "Missing Material", "Missing Piece", "Chipped", "Flaking", "Lift Up", "Bulging", "Spalled", "Bent", "Distortion", "Tear", "Torn", "Wear", "Worn", "Plugged Air Slot", "Damper Wire Extrusion")
Me.cmbHPC4_21.List = Array("EM TASK 72-00-00-200-002-B00", "AMM 72-00-00-200-016-B", "AMM 72-00-00-200-016-B01")
Me.cmbHPC4_22.List = Array("EM TASK 72-00-00-200-002-B00", "AMM 72-00-00-200-016-B", "AMM 72-00-00-200-016-B01")
Me.cmbHPC4_23.List = Array("EM TASK 72-00-00-200-002-B00", "AMM 72-00-00-200-016-B", "AMM 72-00-00-200-016-B01")
Me.cmbHPC4_24.List = Array("EM TASK 72-00-00-200-002-B00", "AMM 72-00-00-200-016-B", "AMM 72-00-00-200-016-B01")
Me.cmbHPC4_25.List = Array("EM TASK 72-00-00-200-002-B00", "AMM 72-00-00-200-016-B", "AMM 72-00-00-200-016-B01")
Me.cmbHPC4_26.List = Array("EM TASK 72-00-00-200-002-B00", "AMM 72-00-00-200-016-B", "AMM 72-00-00-200-016-B01")
Me.cmbHPC4_27.List = Array("EM TASK 72-00-00-200-002-B00", "AMM 72-00-00-200-016-B", "AMM 72-00-00-200-016-B01")
Me.cmbHPC4_28.List = Array("EM TASK 72-00-00-200-002-B00", "AMM 72-00-00-200-016-B", "AMM 72-00-00-200-016-B01")
Me.cmbHPC4_29.List = Array("EM TASK 72-00-00-200-002-B00", "AMM 72-00-00-200-016-B", "AMM 72-00-00-200-016-B01")
Me.cmbHPC4_30.List = Array("EM TASK 72-00-00-200-002-B00", "AMM 72-00-00-200-016-B", "AMM 72-00-00-200-016-B01")
End Sub
What can be cause this issue?

Modify Word Document Multilevel list to include all depth

I have a word document that has a 4 level deep multilevel list. I would like to modify the list styles (temporarily) to show the entire depth of the numbers. For instance, rather than just showing (iii), I want to modify it to show 1.1(a)(iii). I have seen instructions of attaching the style to the list, but I'm not sure how to write the style to show what I want.
So, all of the searching and the replies have not resulted in a working solution, yet, but I did discover that the .docx file is a zipped collection of xml files. So, after looking inside the docx file and the numbering.xml sub-file, I found the following section that seems to define the style for the numbering I am looking to change:
<w:abstractNum w:abstractNumId="93" w15:restartNumberingAfterBreak="0">
<w:nsid w:val="5FE75E67"/>
<w:multiLevelType w:val="multilevel"/>
<w:tmpl w:val="9C366D9C"/>
<w:lvl w:ilvl="0">
<w:start w:val="1"/>
<w:numFmt w:val="decimal"/>
<w:pStyle w:val="ArticleCL1"/>
<w:lvlText w:val="%1"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="720"/>
</w:tabs>
<w:ind w:left="0" w:firstLine="0"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman"/>
<w:b/>
<w:i w:val="0"/>
<w:caps/>
<w:smallCaps w:val="0"/>
<w:sz w:val="22"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="1">
<w:start w:val="1"/>
<w:numFmt w:val="decimal"/>
<w:pStyle w:val="ArticleCL2"/>
<w:lvlText w:val="%1.%2"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="720"/>
</w:tabs>
<w:ind w:left="720" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="22"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="2">
<w:start w:val="1"/>
<w:numFmt w:val="lowerLetter"/>
<w:pStyle w:val="ArticleCL3"/>
<w:lvlText w:val="(%3)"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="720"/>
</w:tabs>
<w:ind w:left="720" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="22"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="3">
<w:start w:val="1"/>
<w:numFmt w:val="lowerRoman"/>
<w:pStyle w:val="ArticleCL4"/>
<w:lvlText w:val="(%4)"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="1440"/>
</w:tabs>
<w:ind w:left="1440" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="22"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="4">
<w:start w:val="1"/>
<w:numFmt w:val="lowerLetter"/>
<w:pStyle w:val="ArticleCL5"/>
<w:lvlText w:val="%5."/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="2160"/>
</w:tabs>
<w:ind w:left="2160" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="24"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="5">
<w:start w:val="1"/>
<w:numFmt w:val="decimal"/>
<w:pStyle w:val="ArticleCL6"/>
<w:lvlText w:val="%6."/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="2160"/>
</w:tabs>
<w:ind w:left="2160" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman" w:hint="default"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="22"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="6">
<w:start w:val="1"/>
<w:numFmt w:val="bullet"/>
<w:lvlRestart w:val="0"/>
<w:pStyle w:val="ArticleCL7"/>
<w:lvlText w:val="·"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="1440"/>
</w:tabs>
<w:ind w:left="1440" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="24"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="7">
<w:start w:val="1"/>
<w:numFmt w:val="bullet"/>
<w:lvlRestart w:val="0"/>
<w:pStyle w:val="ArticleCL8"/>
<w:lvlText w:val="·"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="2160"/>
</w:tabs>
<w:ind w:left="2160" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="24"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="8">
<w:start w:val="1"/>
<w:numFmt w:val="bullet"/>
<w:pStyle w:val="ArticleCL9"/>
<w:lvlText w:val="·"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="2880"/>
</w:tabs>
<w:ind w:left="2880" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:color w:val="auto"/>
<w:sz w:val="24"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
Hopefully, this means that I can change the w:lvlText w:val="(%3) for w:ilvl="2" using VBA. Still investigating.
Thanks!
Rod
Well, it turns out that you can, indeed, directly modify a multiLevelList style at any level if you know how to refer to it. Using the xml file I referenced, I found that the third level style, ArticleC_L3, had it's number format set to "(%3)" which is what I wanted to change. It was in an abstract with AbstractNumId="93". The following code changes that setting:
wDoc.ListTemplates(94).ListLevels(3).NumberFormat = "%1.%2.%3"
You will notice that the ListTemplates number is one higher, and the ListLevels ID is likewise one higher. In either case, to find the precise place you need to refer to, the best workflow I have found is:
1. In the word doc, click on the number/bullet for the level you are trying to change.
2. Click the little dropdown arrow in the styles box so you can see what the style name is for that level.
3. Look in numbering.xml to see which number style is using that style name. For me the line read <w:pStyle w:val="ArticleCL3"/>
4. Follow the xml tree up to find out what level of the numbering style this is. For me the line read <w:lvl w:ilvl="2">
5. Continue to follow the xml tree up to find out what Template number the level is in. For me the line read <w:abstractNum w:abstractNumId="93" w15:restartNumberingAfterBreak="0">
6. Now you can refer to the exact level format as in the line I shared at the start.
Thanks for eveyone's help!
Rod
Presumably, something based on:
Sub ApplyMultiLevelStyleNumbers()
Dim LT As ListTemplate, i As Long
Set LT = ActiveDocument.ListTemplates.Add(OutlineNumbered:=True)
For i = 1 To 4
With LT.ListLevels(i)
.NumberFormat = Choose(i, "%1", "%1.%2", "%1.%2.%3", "%1.%2.%3.%4")
.Font.Bold = True
.ResetOnHigher = True
.StartAt = 1
.LinkedStyle = "ArticleC_L" & i
End With
Next
End Sub
The above assumes your four styles are named ArticleC_L1 - ArticleC_L4.

defining a substitution box for AES in SMT solvers

How do I define a function which performs a substitution of values according to the table here?
static const unsigned char FSb[256] =
{
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5,
0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0,
0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC,
0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A,
0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75,
0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0,
0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84,
0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B,
0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,
0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85,
0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8,
0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5,
0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2,
0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17,
0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,
0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88,
0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB,
0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C,
0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79,
0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9,
0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,
0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6,
0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,
0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E,
0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,
0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94,
0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68,
0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16
};
I was thinking about it the whole day, but to avail, I am still stuck on this problem. Any suggestions/ answers is welcome. Thanks!
Assert the equality of the select at each index to be the constant at that index in the table that you gave.
(declare-fun FSb () (Array (_ BitVec 8) (_ BitVec 8)))
(assert (= (select FSb #x00) #x63))
(assert (= (select FSb #x01) #x7C))
...
(FSB could also be modeled as an uninterpreted function.)
The define-fun version of the above will result in a long cascade of ites. This is likely to be a lot less efficient.

Table border and caption issue for PDF generation in docx4j

I'm having an issue with getting the table caption and border to output in PDF. I'm using docx4j 3.0.0 but I also had the same issue with 2.8.1.
I have a xhtml fragment generated by TinyMCE. I do some processing to get it the way docx4j wants it, and convert it to openXML using XHTMLImporterImpl.
I use the marshaller to get the docx format working and Docx4j.toPDF for the pdf format.
It works for most cases, italics, underline, bold, alignment, images, etc.
When it comes to table caption and border, it works in the docx format, but not the PDF format. It simply excludes the table with these properties. I think xhtml -> openXML is working properly, but the Docx4j.toPDF is not supporting these properties or something. I tried searching the web with no luck. I was wondering if someone already knew about this.
The error I get is
java.lang.StringIndexOutOfBoundsException: String index out of range: 9
at java.lang.String.substring(String.java:1907)
at org.apache.fop.fo.expr.PropertyTokenizer.nextColor(PropertyTokenizer.java:239)
at org.apache.fop.fo.expr.PropertyTokenizer.next(PropertyTokenizer.java:175)
at org.apache.fop.fo.expr.PropertyParser.parseProperty(PropertyParser.java:118)
at org.apache.fop.fo.expr.PropertyParser.parse(PropertyParser.java:91)
at org.apache.fop.fo.properties.PropertyMaker.make(PropertyMaker.java:438)
at org.apache.fop.fo.PropertyList.convertAttributeToProperty(PropertyList.java:413)
at org.apache.fop.fo.PropertyList.addAttributesToList(PropertyList.java:321)
at org.apache.fop.fo.FObj.processNode(FObj.java:122)
at org.apache.fop.fo.flow.table.TableFObj.processNode(TableFObj.java:232)
...
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Exception exporting package
at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:79)
at org.docx4j.Docx4J.toFO(Docx4J.java:467)
at org.docx4j.Docx4J.toPDF(Docx4J.java:477)
The openXML looks like this for the table
<w:tbl>
<w:tblPr>
<w:tblW w:w="0" w:type="auto"/>
<w:tblCellSpacing w:w="20" w:type="dxa"/>
<w:tblInd w:w="115" w:type="dxa"/>
<w:tblBorders>
<w:top w:val="inset" w:color="#000000" w:sz="8"/>
<w:left w:val="inset" w:color="#000000" w:sz="8"/>
<w:bottom w:val="inset" w:color="#000000" w:sz="8"/>
<w:right w:val="inset" w:color="#000000" w:sz="8"/>
<w:insideH w:val="none"/>
<w:insideV w:val="none"/>
</w:tblBorders>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="1045"/>
<w:gridCol w:w="903"/>
</w:tblGrid>
<w:tr>
<w:tc>
<w:tcPr>
<w:tcW w:w="1045" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="outset" w:color="#000000" w:sz="8"/>
<w:left w:val="outset" w:color="#000000" w:sz="8"/>
<w:bottom w:val="outset" w:color="#000000" w:sz="8"/>
<w:right w:val="outset" w:color="#000000" w:sz="8"/>
</w:tcBorders>
</w:tcPr>
<w:p>
<w:pPr>
<w:spacing w:after="0"/>
<w:ind w:left="0"/>
<w:jc w:val="left"/>
</w:pPr>
<w:r>
<w:rPr>
<w:b w:val="false"/>
<w:i w:val="false"/>
<w:color w:val="000000"/>
<w:sz w:val="22"/>
</w:rPr>
<w:t>Col 1</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="903" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="outset" w:color="#000000" w:sz="8"/>
<w:left w:val="outset" w:color="#000000" w:sz="8"/>
<w:bottom w:val="outset" w:color="#000000" w:sz="8"/>
<w:right w:val="outset" w:color="#000000" w:sz="8"/>
</w:tcBorders>
</w:tcPr>
<w:p>
<w:pPr>
<w:spacing w:after="0"/>
<w:ind w:left="0"/>
<w:jc w:val="left"/>
</w:pPr>
<w:r>
<w:rPr>
<w:b w:val="false"/>
<w:i w:val="false"/>
<w:color w:val="000000"/>
<w:sz w:val="22"/>
</w:rPr>
<w:t>Col2</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<w:tr>
<w:tc>
<w:tcPr>
<w:tcW w:w="1045" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="outset" w:color="#000000" w:sz="8"/>
<w:left w:val="outset" w:color="#000000" w:sz="8"/>
<w:bottom w:val="outset" w:color="#000000" w:sz="8"/>
<w:right w:val="outset" w:color="#000000" w:sz="8"/>
</w:tcBorders>
</w:tcPr>
<w:p>
<w:pPr>
<w:spacing w:after="0"/>
<w:ind w:left="0"/>
<w:jc w:val="left"/>
</w:pPr>
<w:r>
<w:rPr>
<w:b w:val="false"/>
<w:i w:val="false"/>
<w:color w:val="000000"/>
<w:sz w:val="22"/>
</w:rPr>
<w:t>Row1</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="903" w:type="dxa"/>
<w:tcBorders>
<w:top w:val="outset" w:color="#000000" w:sz="8"/>
<w:left w:val="outset" w:color="#000000" w:sz="8"/>
<w:bottom w:val="outset" w:color="#000000" w:sz="8"/>
<w:right w:val="outset" w:color="#000000" w:sz="8"/>
</w:tcBorders>
</w:tcPr>
<w:p>
<w:pPr>
<w:spacing w:after="0"/>
<w:ind w:left="0"/>
<w:jc w:val="left"/>
</w:pPr>
<w:r>
<w:rPr>
<w:b w:val="false"/>
<w:i w:val="false"/>
<w:color w:val="000000"/>
<w:sz w:val="22"/>
</w:rPr>
<w:t>table</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
</w:tbl>
I think there's a bug with the default border color going in as #000000 instead of 000000. Is there a workaround by pre-processing the xhtml?
duplicates question http://www.docx4java.org/forums/pdf-output-f27/tabl-caption-and-border-issue-docx4j-3-0-0-t1763.html
I'll update both when answered

Primefaces <p:fileUpload> component stops working

I've been working on this for a while and I managed to make this component work perfectly like this:
<h:form enctype="multipart/form-data">
<p:panelGrid columns="2">
<p:outputLabel value="Nombre:" for="nombre"/>
<p:inputText id="nombre" value="# {controladorProducto.producto.nombre}"/>
<p:outputLabel value="Descripción" for="descripcion"/>
<p:inputText id="descripcion" value="#{controladorProducto.producto.descripcion}"/>
<p:outputLabel value="Precio" for="precio"/>
<p:inputText id="precio" value="#{controladorProducto.producto.precio}"/>
<p:fileUpload id="fileuploader" value="#{controladorProducto.uploadedFile}"
mode="simple" />
<p:commandButton id="boton_cargar" value="Cargar" actionListener="#{controladorProducto.handleProductImageUpload}"
update="fotoProducto" ajax="true"/>
<p:outputLabel value="Imagen:" for="fotoProducto"/>
<p:graphicImage id="fotoProducto" value="#{controladorProducto.producto.imageToShow}"/>
<p:commandButton value="Insertar" action="#{controladorProducto.insertarProducto()}"/>
</p:panelGrid>
</h:form>
So as soon as I add any UI Component (you know, templates) it stops working. Here is the form with the template codes:
<ui:define name="top">
<h1>Buscador Clientes</h1>
<h:form id="form_growl">
<p:growl showDetail="false" />
</h:form>
</ui:define>
<ui:define name="left">
<h:form>
<p:menubar>
<p:menuitem value="Clientes" action="#{controladorCliente.buscarTodosClientes}" />
<p:separator/>
<p:menuitem value="Productos" action="#{controladorProducto.buscarTodosProductos}"/>
<p:separator/>
<p:menuitem value="Pedidos" url="#"/>
</p:menubar>
</h:form>
</ui:define>
<ui:define name ="content">
<h:form enctype="multipart/form-data">
<p:panelGrid columns="2">
<p:outputLabel value="Nombre:" for="nombre"/>
<p:inputText id="nombre" value="#{controladorProducto.producto.nombre}"/>
<p:outputLabel value="Descripción" for="descripcion"/>
<p:inputText id="descripcion" value="#{controladorProducto.producto.descripcion}"/>
<p:outputLabel value="Precio" for="precio"/>
<p:inputText id="precio" value="#{controladorProducto.producto.precio}"/>
<p:fileUpload id="fileuploader" value="#{controladorProducto.uploadedFile}"
mode="simple" />
<p:commandButton id="boton_cargar" value="Cargar" actionListener="#{controladorProducto.handleProductImageUpload}"
update="fotoProducto" ajax="true"/>
<p:outputLabel value="Imagen:" for="fotoProducto"/>
<p:graphicImage id="fotoProducto" value="#{controladorProducto.producto.imageToShow}"/>
<p:commandButton value="Insertar" action="#{controladorProducto.insertarProducto()}"/>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>
Is there any problem, I've used the same template in other places of my project and it worked fine, its just here where it crashes. I get a NullPointerException and when i Debug it It didnt even call the bean.
At this point I´ve been looking around the Internet and I've not found anything.
Does anybody has any idea of why it doesnt works?
By the way, Im using NetBeans 7.3, GlassFish 3.1.2, Primefaces 3.5, JSF 2.1....
I hope someone answers me, I'd appreciate any help or clue on this.
This is the Error trace I get:
SEVERE: Se ha recibido 'java.lang.NullPointerException' al invocar la escucha de acción '#{controladorProducto.handleProductImageUpload}' para el componente 'boton_cargar'
SEVERE: java.lang.NullPointerException
at Controlador.ControladorProducto.handleProductImageUpload(ControladorProducto.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.el.parser.AstValue.invoke(AstValue.java:254)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:302)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:153)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
SEVERE: JSF1073: se ha interceptado javax.faces.event.AbortProcessingException durante el procesamiento de INVOKE_APPLICATION 5 : UIComponent-ClientId=j_idt22:boton_cargar, Mensaje=java.lang.NullPointerException
SEVERE: java.lang.NullPointerException
javax.faces.event.AbortProcessingException: java.lang.NullPointerException
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:182)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
at Controlador.ControladorProducto.handleProductImageUpload(ControladorProducto.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.el.parser.AstValue.invoke(AstValue.java:254)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:302)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:153)
... 38 more